X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Tools%2FNetTest_Runner%2Fmain.c;fp=Tools%2FNetTest_Runner%2Fmain.c;h=57ac080ea6d31d7a5e1aeddbb65ff3600549f7a1;hb=01401dc92068f781e6af6c601be7deba954b3444;hp=b1d95c13f847b93b897171e8fba0f8e4c69f6a97;hpb=e87706ae66c48a9617fd1c30cf4697896802fee7;p=tpg%2Facess2.git diff --git a/Tools/NetTest_Runner/main.c b/Tools/NetTest_Runner/main.c index b1d95c13..57ac080e 100644 --- a/Tools/NetTest_Runner/main.c +++ b/Tools/NetTest_Runner/main.c @@ -27,16 +27,19 @@ int main(int argc, char *argv[]) Test_ARP_Basic, Test_TCP_Basic, Test_TCP_WindowSizes, + Test_TCP_Reset, NULL }; + // Truncate the two output files // TODO: Move to stack.c - FILE *fp; - fp = fopen("stdout.txt", "w"); fclose(fp); - fp = fopen("stderr.txt", "w"); fclose(fp); + fclose( fopen("stdout.txt", "w") ); + fclose( fopen("stderr.txt", "w") ); Net_Open(0, "/tmp/acess2net"); + int n_pass = 0; + int n_fail = 0; for(int i = 0; tests[i]; i ++ ) { Stack_AddDevice("/tmp/acess2net", (char[]){TEST_MAC}); @@ -48,18 +51,22 @@ int main(int argc, char *argv[]) if( Net_Receive(0, 1, &argc, 1000) == 0 ) goto teardown; - if( tests[i]() ) - printf("%s: PASS\n", gsTestName); + bool result = tests[i](); + + printf("%s: %s\n", gsTestName, (result ? "PASS" : "FAIL")); + if(result) + n_pass ++; else - printf("%s: FAIL\n", gsTestName); + n_fail ++; teardown: Stack_Kill(); } Net_Close(0); unlink("/tmp/acess2net"); + printf("--- All tests done %i pass, %i fail\n", n_pass, n_fail); - return 0; + return n_fail; } void PrintUsage(const char *ProgName)