Add new timing test suite that runs the timing self test

This commit is contained in:
Paul Bakker 2016-07-19 14:57:00 +01:00 committed by Simon Butcher
parent 81c60910e1
commit 50157ff5ab
4 changed files with 23 additions and 1 deletions

View file

@ -95,6 +95,7 @@ add_test_suite(pkparse)
add_test_suite(pkwrite)
add_test_suite(shax)
add_test_suite(ssl)
add_test_suite(timing)
add_test_suite(rsa)
add_test_suite(version)
add_test_suite(xtea)

View file

@ -81,7 +81,7 @@ APPS = test_suite_aes.ecb$(EXEXT) test_suite_aes.cbc$(EXEXT) \
test_suite_pkparse$(EXEXT) test_suite_pkwrite$(EXEXT) \
test_suite_pk$(EXEXT) \
test_suite_rsa$(EXEXT) test_suite_shax$(EXEXT) \
test_suite_ssl$(EXEXT) \
test_suite_ssl$(EXEXT) test_suite_timing$(EXEXT) \
test_suite_x509parse$(EXEXT) test_suite_x509write$(EXEXT) \
test_suite_xtea$(EXEXT) test_suite_version$(EXEXT)
@ -412,6 +412,10 @@ test_suite_ssl$(EXEXT): test_suite_ssl.c $(DEP)
echo " CC $<"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
test_suite_timing$(EXEXT): test_suite_timing.c $(DEP)
echo " CC $<"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
test_suite_x509parse$(EXEXT): test_suite_x509parse.c $(DEP)
echo " CC $<"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@

View file

@ -0,0 +1,2 @@
Timing selftest
timing_selftest:

View file

@ -0,0 +1,15 @@
/* BEGIN_HEADER */
#include "mbedtls/timing.h"
/* END_HEADER */
/* BEGIN_DEPENDENCIES
* depends_on:MBEDTLS_TIMING_C
* END_DEPENDENCIES
*/
/* BEGIN_CASE depends_on:MBEDTLS_SELF_TEST */
void timing_selftest()
{
TEST_ASSERT( mbedtls_timing_self_test( 0 ) == 0 );
}
/* END_CASE */