Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor test apps to use unit-test framework #4014

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
cdd4380
Initial work on unittest framework, tested
bennylp Jun 8, 2024
eaef323
Finished reorganizing pjlib-test to use unit-test framework
bennylp Jun 11, 2024
93f2848
Fix big problem where performance improvement is not observed with th…
bennylp Jun 12, 2024
51d6d93
Tidying up global vars in pjlib-test. Add test options: stop on error…
bennylp Jun 13, 2024
9383baa
Change the PJ_TEST_XX() signature to be more generic and does not for…
bennylp Jun 13, 2024
1d842db
Modifications to some existing tests to use unit-test test macros
bennylp Jun 13, 2024
d8bd130
Updated VS projects with argparse.h and unittest.h
bennylp Jun 14, 2024
c8f93dd
Fix warnings on Windows
bennylp Jun 19, 2024
56d221a
Disable parallel unit-testing for ioqueue stress test on Windows beca…
bennylp Jun 19, 2024
cbefbdf
Non-parallel test case will now run exclusively (previously it did no…
bennylp Jun 20, 2024
19f9f17
Add pjlib-test/test_util.h for common utilities for parsing, configur…
bennylp Jun 20, 2024
b2e3108
Dirty hack to fix error message being displayed when user selected es…
bennylp Jun 20, 2024
13db0c6
Replace PJ_TEST_PARALLEL with PJ_TEST_EXCLUSIVE
bennylp Jun 21, 2024
6bfb5d2
Ported pjnath-test to use unit-testing framework, with limited speed-…
bennylp Jun 21, 2024
2b735d0
Large modifications in pjnath-test to speed-up test. It is fast now (…
bennylp Jun 21, 2024
b8594fe
Ported pjmedia-test to use unit-test
bennylp Jun 22, 2024
af408ea
Porting of pjsip test to unit testing framework. Not much of speed im…
bennylp Jun 25, 2024
4f5d62c
Merged changes from master
bennylp Jun 26, 2024
2e5fa0e
Modifications in pj_argparse API (changed get() to get_bool() and add…
bennylp Jun 26, 2024
d4b267e
Refactor tsx_uas_test() to allow parallel testing
bennylp Jun 26, 2024
f7f7392
Parallelize tsx_uac_test()
bennylp Jun 27, 2024
64d5a61
Further effort to parallize tests in pjsip-test. Discoverd major issu…
bennylp Jun 27, 2024
2b90407
Showing PJLIB config is optional with cmd line option
bennylp Jun 30, 2024
9caadb2
Bug fixing failed pjsip tests when running in parallel mode
bennylp Jun 30, 2024
e886488
Finished paralleizing all pjsip tests except one
bennylp Jul 1, 2024
47d94bb
Continuing correcting errors
bennylp Jul 2, 2024
ed3ac46
Add test shuffle feature
bennylp Jul 2, 2024
97b99c1
Merge #4006 and fix transport_loop_test error
bennylp Jul 2, 2024
46ef3e6
Modify CI workflows to use standard arguments: -w 3 --shuffle. These …
bennylp Jul 3, 2024
b012957
Updated due to change in argparse API signature (swap arg order)
bennylp Jul 10, 2024
37272e8
Merged changes from master (unit test, argparse, etc.)
bennylp Jul 10, 2024
7117775
Removed unittest.md (it was draft for the PR)
bennylp Jul 11, 2024
cfe3a3a
Fix the use of GitHub repository vars
bennylp Jul 11, 2024
3682785
Merge branch 'master' into unittest-framework
bennylp Jul 12, 2024
e1b1e45
Tidying up minor conflicting merge in VC projects and pjlib.h
bennylp Jul 12, 2024
0246ac9
Attempt to fix assertion failure when tdata is being accessed after r…
bennylp Jul 13, 2024
d6b892f
Fixing failure in transport_loop_test(), first in loop_resolve_error(…
bennylp Jul 13, 2024
bd96226
Attempt to fix unresolved winmm.lib API (e.g. timeKillEvent, timeGetT…
bennylp Jul 16, 2024
c930d4c
Split exclusive part of transport_loop_test
bennylp Jul 16, 2024
bc8f174
CI mods: split steps, envs, shorten job names
bennylp Jul 17, 2024
49b3b5c
Fix failed tsx_basic_test
bennylp Jul 17, 2024
5148484
Restore previously shortened job names
bennylp Jul 18, 2024
cf5d2cc
Replace assertion with PJ_TEST_XX in resolver_test
bennylp Jul 18, 2024
4cfff2f
Add --stdout-buf and --stderr-buf options in test apps to control std…
bennylp Jul 18, 2024
72d425e
Fix missing sipp exe on Windows CI
bennylp Jul 18, 2024
311edb9
Fix wrong CI args on Mac. Use -j for faster make
bennylp Jul 18, 2024
78c9adf
Replace pj_rand() with own rand in unittest because rand() yields dif…
bennylp Jul 19, 2024
b08343b
Fix swig make error on Linux and runall.py error reading log file on …
bennylp Jul 19, 2024
7b86a22
Attempt to fix test repeatability by 1) delete all calls to pj_srand(…
bennylp Jul 19, 2024
7dc7ee9
Merge branch 'master' into unittest-framework
bennylp Dec 17, 2024
d0a68f2
Fixed inexistant function
bennylp Dec 17, 2024
988f65d
Relaxing the strictness of the test since sometimes it raises error
bennylp Dec 17, 2024
6e9e4b2
Set regc_test() exclusive because it crashes sometimes, probably conc…
bennylp Dec 17, 2024
6dbb1ba
Modified thread counter to unsigned long (from pj_uint32_t) since the…
bennylp Dec 18, 2024
0f3941c
Fixed port double destruction in mips_test() and include benchmark te…
bennylp Dec 18, 2024
b2a5134
Use any port since sometimes test fails with address in use error
bennylp Dec 18, 2024
420595f
Merge branch 'master' into unittest-framework
bennylp Dec 18, 2024
aea2049
Merge branch 'mips_test' into unittest-framework
bennylp Dec 18, 2024
b69ac09
Merge branch 'master' into unittest-framework
bennylp Dec 18, 2024
d8f0280
Fix conflicted return value in udp_ioqueue_test() and let it immediat…
bennylp Dec 18, 2024
cb5f7f8
Restore sleep(0) in thread test since without it the test may occasio…
bennylp Dec 18, 2024
6d185a6
Various attempt to fix fluke error in resolve_test.c: 1) servers use …
bennylp Dec 19, 2024
01712f1
Merge branch 'master' into unittest-framework
bennylp Dec 19, 2024
97b0949
More relaxed packet count tests in resolver_test
bennylp Dec 19, 2024
d283d3b
Use any port instead of hardcoded one in udp ioqueue unregister_test …
bennylp Dec 19, 2024
cb2074d
Merge branch 'master' into unittest-framework
bennylp Dec 19, 2024
734312f
Rollback previous changes in resolver_test that relaxed packet count …
bennylp Dec 20, 2024
3203ce8
Protect access to pool from worker thread with mutex in resolver_test
bennylp Dec 20, 2024
aea63e2
Faster resolver_test time by reducing timeout
bennylp Dec 20, 2024
1506d37
Merge branch 'unittest-framework' of https://github.com/pjsip/pjproje…
bennylp Dec 20, 2024
58602a4
Use high number port to make it less prone to bind error
bennylp Dec 20, 2024
dadf081
Remove hardcoded port number, replace with bind to any
bennylp Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Initial work on unittest framework, tested
  • Loading branch information
bennylp committed Jun 8, 2024
commit cdd43808a15a1439f62ed84936303ca64193f6bd
4 changes: 2 additions & 2 deletions pjlib/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export PJLIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
os_info.o pool.o pool_buf.o pool_caching.o pool_dbg.o rand.o \
rbtree.o sock_common.o sock_qos_common.o \
ssl_sock_common.o ssl_sock_ossl.o ssl_sock_gtls.o ssl_sock_dump.o \
ssl_sock_darwin.o string.o timer.o types.o
ssl_sock_darwin.o string.o timer.o types.o unittest.o
export PJLIB_CFLAGS += $(_CFLAGS)
export PJLIB_CXXFLAGS += $(_CXXFLAGS)
export PJLIB_LDFLAGS += $(_LDFLAGS)
Expand All @@ -52,7 +52,7 @@ export TEST_OBJS += activesock.o atomic.o echo_clt.o errno.o exception.o \
select.o sleep.o sock.o sock_perf.o ssl_sock.o \
string.o test.o thread.o timer.o timestamp.o \
udp_echo_srv_sync.o udp_echo_srv_ioqueue.o \
util.o
unittest_test.o util.o
export TEST_CFLAGS += $(_CFLAGS)
export TEST_CXXFLAGS += $(_CXXFLAGS)
export TEST_LDFLAGS += $(PJLIB_LDLIB) $(_LDFLAGS)
Expand Down
112 changes: 112 additions & 0 deletions pjlib/build/pjlib.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -8420,6 +8420,118 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\pj\unittest.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<Filter
Name="Other Targets"
>
Expand Down
1 change: 1 addition & 0 deletions pjlib/build/pjlib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,7 @@
<ClCompile Include="..\src\pj\timer.c" />
<ClCompile Include="..\src\pj\types.c" />
<ClCompile Include="..\src\pj\unicode_win32.c" />
<ClCompile Include="..\src\pj\unittest.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\third_party\threademulation\include\ThreadEmulation.h" />
Expand Down
3 changes: 3 additions & 0 deletions pjlib/build/pjlib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
<ClCompile Include="..\src\pj\unicode_win32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pj\unittest.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pj\addr_resolv_linux_kernel.c">
<Filter>Source Files\Other Targets</Filter>
</ClCompile>
Expand Down
112 changes: 112 additions & 0 deletions pjlib/build/pjlib_test.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -7334,6 +7334,118 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\pjlib-test\unittest_test.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug-Dynamic|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release-Static|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\pjlib-test\util.c"
>
Expand Down
1 change: 1 addition & 0 deletions pjlib/build/pjlib_test.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@
<ClCompile Include="..\src\pjlib-test\timestamp.c" />
<ClCompile Include="..\src\pjlib-test\udp_echo_srv_ioqueue.c" />
<ClCompile Include="..\src\pjlib-test\udp_echo_srv_sync.c" />
<ClCompile Include="..\src\pjlib-test\unittest_test.c" />
<ClCompile Include="..\src\pjlib-test\util.c" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions pjlib/build/pjlib_test.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
<ClCompile Include="..\src\pjlib-test\udp_echo_srv_sync.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pjlib-test\unittest_test.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pjlib-test\util.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
Loading