diff -Nru ngs-sdk-2.11.2/debian/changelog ngs-sdk-2.11.2/debian/changelog --- ngs-sdk-2.11.2/debian/changelog 2022-02-18 19:44:26.000000000 +0000 +++ ngs-sdk-2.11.2/debian/changelog 2022-05-03 19:17:32.000000000 +0000 @@ -1,3 +1,11 @@ +ngs-sdk (2.11.2-4) unstable; urgency=medium + + * Team upload + * Rewriting the autopkgtest to test the package as-installed + (Closes: #1006732) + + -- Pierre Gruet Tue, 03 May 2022 21:17:32 +0200 + ngs-sdk (2.11.2-3) unstable; urgency=medium * Team upload diff -Nru ngs-sdk-2.11.2/debian/tests/run-unit-test ngs-sdk-2.11.2/debian/tests/run-unit-test --- ngs-sdk-2.11.2/debian/tests/run-unit-test 2022-02-18 19:44:26.000000000 +0000 +++ ngs-sdk-2.11.2/debian/tests/run-unit-test 2022-05-03 18:45:17.000000000 +0000 @@ -1,18 +1,47 @@ #!/bin/sh # Author: Lance Lin +# Pierre Gruet # Date: 18 February 2022 +# 3 May 2022 # File: run-unit-test # Purpose: run a simple-unit test for the ngs-sdk package # # Details: -# Run the built-in test (make test) for the ngs-sdk package +# Run the tests after building them against the libs in the -dev package. set -e -cd ngs-sdk -echo "run-unit-test: running configure" -./configure -echo "run-unit-test: making test" -make test -echo "run-unit-test: done" +pkg=ngs-sdk + +export LC_ALL=C.UTF-8 +if [ "${AUTOPKGTEST_TMP}" = "" ] ; then + AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX) + trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM +fi + +cp -a ngs-sdk/test/ "${AUTOPKGTEST_TMP}" +cd "${AUTOPKGTEST_TMP}/test" + +# Building the test-engine lib +cd test_engine +g++ -c -I/usr/include/ngs/unix/generic -Wall -fpic *.cpp +g++ -shared -o libtest_engine.so *.o + +# Building the test file against the lib and the test-engine lib. +cd ../ngs-test +g++ -I../../ -I/usr/include/ngs/unix/generic -L../test_engine -Wall -o test main.cpp -ltest_engine -lngs-c++ -lngs-adapt-c++ + +# Running the tests and collecting the results in outputTest +LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:../test_engine" ./test > outputTest + +# Now outputTest should contain something like +# "Test cases run: 107 +# Test cases passed: 107" +# So we remove everything before the colons, remove duplicates and check there +# remains only one line in the file (i.e. the count of passing tests is the +# same as the count of tests). +sed 's/.*: //' outputTest | uniq | wc -l | grep -q "1" +if [ $? -eq 0 ]; then + echo "All tests PASSED" +fi