34 lines
781 B
C++
34 lines
781 B
C++
#include <stdio.h>
|
|
#include "test.h"
|
|
|
|
//tests
|
|
int testFiles_parent();
|
|
int testFiles_file();
|
|
int testFiles_extention();
|
|
|
|
int testUtil_Count();
|
|
int testUtil_equalsIgnoreCase();
|
|
int testUtil_toLower();
|
|
|
|
test_t tests[] = {testFiles_parent, testFiles_file, testFiles_extention, testUtil_Count, testUtil_equalsIgnoreCase, testUtil_toLower, NULL};
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
test_t* current = tests;
|
|
int failcount = 0;
|
|
int testcount = 0;
|
|
for(; *current; current++) {
|
|
testcount++;
|
|
printf("\033[1mRunning test number: %d ", testcount);
|
|
if((*current)()) {
|
|
printf("\033[1;92msucceeded\033[0;1m!\n");
|
|
} else {
|
|
printf("\033[1;91mfailed\033[0;1m\n");
|
|
failcount++;
|
|
}
|
|
}
|
|
|
|
printf("\033[1;93m%d\033[0;1m/%d failed\n", failcount, testcount);
|
|
return failcount > 0;
|
|
}
|