
Zeyu Feng 201377605
Dependencies: mbed
On Minerva
Diff: tests.h
- Revision:
- 12:009895f6b6e4
- Child:
- 15:3571beaaeed8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests.h Mon May 11 14:43:16 2020 +0000 @@ -0,0 +1,36 @@ +#ifndef TEST_H +#define TEST_H + +#include "People-test.h" + +/**run all the tests of this program + + *returns number of failed tests +*/ + +int run_all_tests() +{ + int failed_tests = 0; + + printf("Testing People_test...\n"); + bool test_passed = People_test(); + + //print the result of each test + if(test_passed){ + printf("...TEST Passed!\n"); + }else{ + printf("...Failed\n"); + failed_tests++; + } + + //print test result + if(failed_tests > 0){ + printf("%d tests failed...\n",failed_tests); + }else{ + printf("All tests PASSED!!\n"); + } + + return failed_tests; +} + +#endif \ No newline at end of file