File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ pull_request :
6+ workflow_dispatch :
7+
8+ jobs :
9+ posix :
10+ name : ${{ matrix.name }}
11+ runs-on : ${{ matrix.os }}
12+
13+ strategy :
14+ fail-fast : false
15+ matrix :
16+ include :
17+ - name : Ubuntu 22.04 GCC
18+ os : ubuntu-22.04
19+ cc : gcc
20+ cxx : g++
21+ packages : build-essential
22+ cc_flags : -march=native
23+
24+ - name : Ubuntu 22.04 Clang
25+ os : ubuntu-22.04
26+ cc : clang
27+ cxx : clang++
28+ packages : clang
29+ cc_flags : -march=native
30+
31+ - name : Ubuntu 24.04 GCC
32+ os : ubuntu-24.04
33+ cc : gcc
34+ cxx : g++
35+ packages : build-essential
36+ cc_flags : -march=native
37+
38+ - name : Ubuntu 24.04 Clang
39+ os : ubuntu-24.04
40+ cc : clang
41+ cxx : clang++
42+ packages : clang
43+ cc_flags : -march=native
44+
45+ env :
46+ CC : ${{ matrix.cc }}
47+ CXX : ${{ matrix.cxx }}
48+ CC_FLAGS : ${{ matrix.cc_flags }}
49+
50+ steps :
51+ - name : Checkout
52+ uses : actions/checkout@v4
53+
54+ - name : Install dependencies
55+ run : |
56+ sudo apt-get update
57+ sudo apt-get install -y cmake expect netcat-openbsd ${{ matrix.packages }}
58+
59+ - name : Show tool versions
60+ run : |
61+ cmake --version
62+ "${CC}" --version
63+
64+ - name : Configure
65+ run : |
66+ cmake \
67+ -DCMAKE_C_FLAGS="-Werror ${CC_FLAGS}" \
68+ -S platforms/posix \
69+ -B platforms/posix/build
70+
71+ - name : Build
72+ run : cmake --build platforms/posix/build
73+
74+ - name : Test
75+ working-directory : platforms/posix/build
76+ run : ctest -V
Original file line number Diff line number Diff line change @@ -93,7 +93,10 @@ ENDIF (IS_BIG_ENDIAN)
9393
9494enable_testing ()
9595
96- add_test (basic ${CMAKE_SOURCE_DIR } /../../scripts/do-test.sh ${CMAKE_SOURCE_DIR } )
96+ add_test (NAME basic COMMAND
97+ ${CMAKE_COMMAND } -E env BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}
98+ ${CMAKE_SOURCE_DIR } /../../scripts/do-test.sh ${CMAKE_SOURCE_DIR }
99+ )
97100add_test (NAME usipy_test_uac COMMAND usipy_test_uac )
98101add_test (NAME usipy_test_ua COMMAND usipy_test_ua )
99102
Original file line number Diff line number Diff line change 1- ${BUILDDIR}/usipy_test 2>&1 | tee "${MLOG}" &
1+ MON_PIDFILE="${BUILDDIR}/usipy_test.pid"
2+ rm -f "${MON_PIDFILE}"
3+ (
4+ "${BUILDDIR}/usipy_test" 2>&1 &
5+ echo ${!} > "${MON_PIDFILE}"
6+ wait ${!}
7+ ) | tee "${MLOG}" &
8+ MON_PIPE_PID=${!}
Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ bind_loopback_udp(void)
4343 sin .sin_family = AF_INET ;
4444 sin .sin_addr .s_addr = htonl (INADDR_LOOPBACK );
4545 sin .sin_port = 0 ;
46- assert (bind (sock , (struct sockaddr * )& sin , sizeof (sin )) == 0 );
46+ if (bind (sock , (struct sockaddr * )& sin , sizeof (sin )) != 0 ) {
47+ perror ("bind_loopback_udp bind" );
48+ assert (0 );
49+ }
4750 return (sock );
4851}
4952
Original file line number Diff line number Diff line change @@ -318,7 +318,10 @@ bind_loopback_udp(void)
318318 sin .sin_family = AF_INET ;
319319 sin .sin_port = htons (0 );
320320 sin .sin_addr .s_addr = htonl (INADDR_LOOPBACK );
321- assert (bind (sock , (const struct sockaddr * )& sin , sizeof (sin )) == 0 );
321+ if (bind (sock , (const struct sockaddr * )& sin , sizeof (sin )) != 0 ) {
322+ perror ("bind_loopback_udp bind" );
323+ assert (0 );
324+ }
322325 return (sock );
323326}
324327
Original file line number Diff line number Diff line change @@ -10,6 +10,22 @@ TOOLSDIR=`dirname ${TOOLSPATH}`
1010
1111MLOG=" ${BUILDDIR} /monitor.log"
1212TESTS=" empty foobar 100trying ACK OPTIONS INVITE CANCEL 200OK"
13+ MON_PID=
14+ MON_PIPE_PID=
15+
16+ cleanup ()
17+ {
18+ if [ ! -z " ${MON_PID} " ]
19+ then
20+ kill -TERM " ${MON_PID} " 2> /dev/null || true
21+ wait " ${MON_PID} " 2> /dev/null || true
22+ fi
23+ if [ ! -z " ${MON_PIPE_PID} " ]
24+ then
25+ wait " ${MON_PIPE_PID} " 2> /dev/null || true
26+ fi
27+ }
28+ trap cleanup EXIT INT TERM
1329
1430if [ -e " ${MLOG} " ]
1531then
1834
1935. " ${SRCDIR} /scripts/test_start.sub"
2036MON_RC=${?}
21- MON_PID=${! }
37+ i=0
38+ while [ ${i} -lt 10 ] && [ ! -s " ${MON_PIDFILE} " ]
39+ do
40+ sleep 1
41+ i=$(( ${i} + 1 ))
42+ done
43+ if [ ! -s " ${MON_PIDFILE} " ]
44+ then
45+ exit 1
46+ fi
47+ MON_PID=` cat " ${MON_PIDFILE} " `
2248
2349. " ${SRCDIR} /scripts/test_waitready.sub"
2450
3662 done
3763 sleep 3
3864fi
39- kill -TERM ${MON_PID}
40- wait ${ MON_PID} || true
65+ cleanup
66+ MON_PID=
4167if [ -z " ${BRD_IP} " ]
4268then
4369 exit 1
Original file line number Diff line number Diff line change 1717 . "${SRCDIR}/scripts/test.common.sub"
1818fi
1919
20- BUILDDIR="${SRCDIR}/build"
20+ BUILDDIR="${BUILDDIR:-${ SRCDIR}/build} "
2121DIFF="diff -u"
You can’t perform that action at this time.
0 commit comments