diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ff0777a3..917066b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,8 +14,8 @@ jobs: strategy: matrix: valgrind: - - { configure: '' , make: 'check' } - - { configure: '--enable-valgrind' , make: 'check-valgrind' } + - { configure: '' , cflags: '', make: 'check' } + - { configure: '--enable-valgrind' , cflags: '-O2', make: 'check-valgrind' } options: - { configure: '' } - { configure: '--without-libxml2' } @@ -35,7 +35,7 @@ jobs: - name: Build the library run: | ./bootstrap.sh - ./configure ${{ matrix.options.configure }} ${{ matrix.valgrind.configure }} CFLAGS="-Werror -g3" + ./configure ${{ matrix.options.configure }} ${{ matrix.valgrind.configure }} CFLAGS="-Werror -g3 ${{ matrix.valgrind.cflags }}" make -j$(nproc) - name: Run tests run: | @@ -135,6 +135,11 @@ jobs: if: ${{ !failure() }} run: | cat testbuild.log + - name: Error logs + if: ${{ failure() }} + run: | + cat testbuild.log || true + cat testerr.log || true code-style: runs-on: ubuntu-20.04 diff --git a/.gitignore b/.gitignore index 8b39b998..3d309496 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ examples/roster examples/uuid examples/vcard testbuild*.log +testerr*.log test-release/ test_stamp test-suite*.log diff --git a/Makefile.am b/Makefile.am index 394ac065..f918c979 100644 --- a/Makefile.am +++ b/Makefile.am @@ -333,6 +333,7 @@ dist-archives: test-release: dist @touch testbuild-$(PACKAGE_VERSION).log && ln -sf testbuild-$(PACKAGE_VERSION).log testbuild.log + @touch testerr-$(PACKAGE_VERSION).log && ln -sf testerr-$(PACKAGE_VERSION).log testerr.log @mkdir -p test-release && cp $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.* test-release && pushd test-release && \ tar xzf $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz && pushd $(PACKAGE_TARNAME)-$(PACKAGE_VERSION) && ./testbuild.sh && popd && rm -rf $(PACKAGE_TARNAME)-$(PACKAGE_VERSION) && \ echo "Success" && popd diff --git a/testbuild.sh b/testbuild.sh index 16ec4285..be53be43 100755 --- a/testbuild.sh +++ b/testbuild.sh @@ -1,6 +1,7 @@ #!/bin/sh logfile="../../testbuild.log" +errfile="../../testerr.log" err_out() { tail $logfile @@ -8,6 +9,6 @@ err_out() { } ./bootstrap.sh -./configure >> $logfile || err_out -make -j$(( `nproc` * 2 + 1 )) >> $logfile || err_out -make check >> $logfile || err_out +./configure >> $logfile 2>> $errfile || err_out +make -j$(( `nproc` * 2 + 1 )) >> $logfile 2>> $errfile || err_out +make check >> $logfile 2>> $errfile || err_out diff --git a/tests/test_serialize_sm.c b/tests/test_serialize_sm.c index 8088ef30..ce4846a1 100644 --- a/tests/test_serialize_sm.c +++ b/tests/test_serialize_sm.c @@ -147,6 +147,7 @@ int main() conn->intf = intf; state = conn->state; conn->state = XMPP_STATE_CONNECTED; + conn->sock = 123; xmpp_send_raw(conn, "foo", 3); ENSURE_EQ(xmpp_conn_send_queue_len(conn), 1);