Compare commits
1 Commits
42c04d28fc
...
adc5e26689
| Author | SHA1 | Date | |
|---|---|---|---|
|
adc5e26689
|
22
ci-build.sh
22
ci-build.sh
@@ -221,7 +221,7 @@ build_and_test() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run unit tests under Valgrind
|
||||
# Run unit tests
|
||||
local unit_passed=0 unit_failed=0
|
||||
if [ "$run_valgrind" = "yes" ]; then
|
||||
echo "--> Running unit tests under Valgrind..."
|
||||
@@ -236,13 +236,21 @@ build_and_test() {
|
||||
echo "ERROR: Valgrind unit tests failed (exit code $valgrind_exit)"
|
||||
exit 1
|
||||
fi
|
||||
# Extract unit test counts from cmocka output
|
||||
unit_passed=$(grep -E "^\[ PASSED \] [0-9]+ test" unit-tests-output.log | grep -oE "[0-9]+" | head -1)
|
||||
unit_failed=$(grep -E "^\[ FAILED \] [0-9]+ test" unit-tests-output.log | grep -oE "[0-9]+" | head -1)
|
||||
[ -z "$unit_passed" ] && unit_passed=0
|
||||
[ -z "$unit_failed" ] && unit_failed=0
|
||||
echo "UNIT_TESTS: passed=$unit_passed failed=$unit_failed"
|
||||
else
|
||||
echo "--> Running unit tests..."
|
||||
$MAKE tests/unittests/unittests
|
||||
tests/unittests/unittests 2>&1 | tee unit-tests-output.log
|
||||
if [ ${PIPESTATUS[0]} -ne 0 ]; then
|
||||
echo "ERROR: Unit tests failed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# Extract unit test counts from cmocka output
|
||||
unit_passed=$(grep -E "^\[ PASSED \] [0-9]+ test" unit-tests-output.log | grep -oE "[0-9]+" | head -1)
|
||||
unit_failed=$(grep -E "^\[ FAILED \] [0-9]+ test" unit-tests-output.log | grep -oE "[0-9]+" | head -1)
|
||||
[ -z "$unit_passed" ] && unit_passed=0
|
||||
[ -z "$unit_failed" ] && unit_failed=0
|
||||
echo "UNIT_TESTS: passed=$unit_passed failed=$unit_failed"
|
||||
|
||||
# Set build index for port allocation: build 1 uses ports 5230-5233,
|
||||
# build 2 uses 5234-5237, etc. This prevents port conflicts in parallel builds.
|
||||
|
||||
Reference in New Issue
Block a user