Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
tests.h
00001 #ifndef TEST_H 00002 #define TEST_H 00003 00004 #include "People-test.h" 00005 #include "shot-test.h" 00006 00007 /**run all the tests of this program 00008 00009 *returns number of failed tests 00010 */ 00011 00012 int run_all_tests() 00013 { 00014 int failed_tests = 0; 00015 00016 printf("Testing...\n"); 00017 bool test_passed1 = People_test(); 00018 bool test_passed2 = shot_test(); 00019 00020 //print the result of each test 00021 if(test_passed1){ 00022 printf("...People TEST Passed!\n"); 00023 }else{ 00024 printf("...People TEST Failed\n"); 00025 failed_tests++; 00026 } 00027 if(test_passed2){ 00028 printf("...shot TEST Passed!\n"); 00029 }else{ 00030 printf("...shot TEST Failed\n"); 00031 failed_tests++; 00032 } 00033 00034 //print test result 00035 if(failed_tests > 0){ 00036 printf("%d tests failed...\n",failed_tests); 00037 }else{ 00038 printf("All tests PASSED!!\n"); 00039 } 00040 00041 return failed_tests; 00042 } 00043 00044 #endif
Generated on Thu Jul 14 2022 12:45:25 by
1.7.2