Removed running selftest program from basic-build-test.sh

All self tests are run in the unit test framework as well.
This commit is contained in:
Paul Bakker 2016-07-20 09:52:01 +01:00 committed by Simon Butcher
parent 03091e1e6a
commit 4b8bc5228a

View File

@ -12,8 +12,8 @@
# test report and code coverage report. # test report and code coverage report.
# #
# The tests include: # The tests include:
# * Self-tests - executed using program/test/selftest
# * Unit tests - executed using tests/scripts/run-test-suite.pl # * Unit tests - executed using tests/scripts/run-test-suite.pl
# * Self-tests - executed using the test suites above
# * System tests - executed using tests/ssl-opt.sh # * System tests - executed using tests/ssl-opt.sh
# * Interoperability tests - executed using tests/compat.sh # * Interoperability tests - executed using tests/compat.sh
# #
@ -21,7 +21,7 @@
# #
# Note the tests self-adapt due to configurations in include/mbedtls/config.h # Note the tests self-adapt due to configurations in include/mbedtls/config.h
# which can lead to some tests being skipped, and can cause the number of # which can lead to some tests being skipped, and can cause the number of
# available self-tests to fluctuate. # available tests to fluctuate.
# #
# This script has been written to be generic and should work on any shell. # This script has been written to be generic and should work on any shell.
# #
@ -56,19 +56,15 @@ make -j
TEST_OUTPUT=out_${PPID} TEST_OUTPUT=out_${PPID}
cd tests cd tests
# Step 2a - Self-tests # Step 2a - Unit Tests
../programs/test/selftest |tee self-test-$TEST_OUTPUT
echo
# Step 2b - Unit Tests
perl scripts/run-test-suites.pl -v |tee unit-test-$TEST_OUTPUT perl scripts/run-test-suites.pl -v |tee unit-test-$TEST_OUTPUT
echo echo
# Step 2c - System Tests # Step 2b - System Tests
sh ssl-opt.sh |tee sys-test-$TEST_OUTPUT sh ssl-opt.sh |tee sys-test-$TEST_OUTPUT
echo echo
# Step 2d - Compatibility tests # Step 2c - Compatibility tests
sh compat.sh |tee compat-test-$TEST_OUTPUT sh compat.sh |tee compat-test-$TEST_OUTPUT
echo echo
@ -85,28 +81,7 @@ echo
cd tests cd tests
# Step 4a - Self-tests # Step 4a - Unit tests
echo "Self tests - ./programs/test/selftest"
PASSED_TESTS=$(grep 'passed' self-test-$TEST_OUTPUT |wc -l)
FAILED_TESTS=$(grep 'failed' self-test-$TEST_OUTPUT |wc -l)
AVAIL_TESTS=$(($PASSED_TESTS + $FAILED_TESTS))
EXED_TESTS=$(($PASSED_TESTS + $FAILED_TESTS))
echo "Passed : $PASSED_TESTS"
echo "Failed : $FAILED_TESTS"
echo "Skipped : n/a"
echo "Total tests : $AVAIL_TESTS"
echo
TOTAL_PASS=$PASSED_TESTS
TOTAL_FAIL=$FAILED_TESTS
TOTAL_SKIP=0
TOTAL_AVAIL=$(($PASSED_TESTS + $FAILED_TESTS))
TOTAL_EXED=$(($PASSED_TESTS + $FAILED_TESTS))
# Step 4b - Unit tests
echo "Unit tests - tests/scripts/run-test-suites.pl" echo "Unit tests - tests/scripts/run-test-suites.pl"
PASSED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/test cases passed :[\t]*\([0-9]*\)/\1/p'| tr -d ' ') PASSED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/test cases passed :[\t]*\([0-9]*\)/\1/p'| tr -d ' ')
@ -122,14 +97,13 @@ echo "Total exec'd tests : $(($PASSED_TESTS + $FAILED_TESTS))"
echo "Total avail tests : $(($PASSED_TESTS + $FAILED_TESTS + $SKIPPED_TESTS))" echo "Total avail tests : $(($PASSED_TESTS + $FAILED_TESTS + $SKIPPED_TESTS))"
echo echo
TOTAL_PASS=$(($TOTAL_PASS+$PASSED_TESTS)) TOTAL_PASS=$PASSED_TESTS
TOTAL_FAIL=$(($TOTAL_FAIL+$FAILED_TESTS)) TOTAL_FAIL=$FAILED_TESTS
TOTAL_SKIP=$(($TOTAL_SKIP+$SKIPPED_TESTS)) TOTAL_SKIP=$SKIPPED_TESTS
TOTAL_AVAIL=$(($TOTAL_AVAIL + $PASSED_TESTS + $FAILED_TESTS + $SKIPPED_TESTS)) TOTAL_AVAIL=$(($PASSED_TESTS + $FAILED_TESTS + $SKIPPED_TESTS))
TOTAL_EXED=$(($TOTAL_EXED + $PASSED_TESTS + $FAILED_TESTS)) TOTAL_EXED=$(($PASSED_TESTS + $FAILED_TESTS))
# Step 4b - TLS Options tests
# Step 4c - TLS Options tests
echo "TLS Options tests - tests/ssl-opt.sh" echo "TLS Options tests - tests/ssl-opt.sh"
PASSED_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p') PASSED_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p')
@ -151,7 +125,7 @@ TOTAL_AVAIL=$(($TOTAL_AVAIL + $TOTAL_TESTS + $SKIPPED_TESTS))
TOTAL_EXED=$(($TOTAL_EXED + $TOTAL_TESTS)) TOTAL_EXED=$(($TOTAL_EXED + $TOTAL_TESTS))
# Step 4d - System Compatibility tests # Step 4c - System Compatibility tests
echo "System/Compatibility tests - tests/compat.sh" echo "System/Compatibility tests - tests/compat.sh"
PASSED_TESTS=$(tail -n5 compat-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p') PASSED_TESTS=$(tail -n5 compat-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p')
@ -173,7 +147,7 @@ TOTAL_AVAIL=$(($TOTAL_AVAIL + $EXED_TESTS + $SKIPPED_TESTS))
TOTAL_EXED=$(($TOTAL_EXED + $EXED_TESTS)) TOTAL_EXED=$(($TOTAL_EXED + $EXED_TESTS))
# Step 4e - Grand totals # Step 4d - Grand totals
echo "-------------------------------------------------------------------------" echo "-------------------------------------------------------------------------"
echo "Total tests" echo "Total tests"
@ -185,7 +159,7 @@ echo "Total avail tests : $TOTAL_AVAIL"
echo echo
# Step 4f - Coverage # Step 4e - Coverage
echo "Coverage" echo "Coverage"
LINES_TESTED=$(tail -n3 cov-$TEST_OUTPUT|sed -n -e 's/ lines......: [0-9]*.[0-9]% (\([0-9]*\) of [0-9]* lines)/\1/p') LINES_TESTED=$(tail -n3 cov-$TEST_OUTPUT|sed -n -e 's/ lines......: [0-9]*.[0-9]% (\([0-9]*\) of [0-9]* lines)/\1/p')
@ -204,7 +178,6 @@ echo "Functions Tested : $FUNCS_TESTED of $FUNCS_TOTAL $FUNCS_PERCENT%"
echo echo
rm self-test-$TEST_OUTPUT
rm unit-test-$TEST_OUTPUT rm unit-test-$TEST_OUTPUT
rm sys-test-$TEST_OUTPUT rm sys-test-$TEST_OUTPUT
rm compat-test-$TEST_OUTPUT rm compat-test-$TEST_OUTPUT