00001 #include "test_defines.h"
00002
00003 extern test_suite_t serialization_suite;
00004 extern test_suite_t data_suite;
00005
00006 void run_session(const test_session_t *tss);
00007 void run_suite(const test_suite_t *ts);
00008 void run_test(const test_t *t);
00009
00010
00011 int main(int argc, char **argv)
00012 {
00013 run_suite(&serialization_suite);
00014 run_suite(&data_suite);
00015 return 0;
00016 }
00017
00018
00019
00020
00021
00022
00023
00024 void run_test(const test_t *t)
00025 {
00026 if(!t || !t->test_fun) return;
00027
00028 printf("\n%s:\n",t->name);
00029 printf("--------------------------------------------------------------\n");
00030 t->test_fun();
00031 printf("test OK\n");
00032 }
00033
00034 void run_suite(const test_suite_t *ts)
00035 {
00036 const test_t *t;
00037 if(!ts) return;
00038 printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
00039 printf("%s:\n",ts->name);
00040 t = &ts->tests[0];
00041 while(t && t->test_fun)
00042 {
00043 run_test(t++);
00044 }
00045 printf("test suite OK\n");
00046 printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
00047 }
00048
00049 void run_session(const test_session_t *tss)
00050 {
00051 const test_suite_t *t;
00052 if(!tss) return;
00053 printf("============================================================\n");
00054 printf("============================================================\n");
00055 printf("\n%s:\n",tss->name);
00056 t = &tss->suites[0];
00057 while(t && t->tests)
00058 {
00059 run_suite(t++);
00060 }
00061 printf("test session OK\n");
00062 printf("============================================================\n");
00063 printf("============================================================\n");
00064 }
00065