aboutsummaryrefslogtreecommitdiff
path: root/apps/px4
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-01-12 00:53:45 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-01-12 00:53:45 +0100
commit6c1b00e22fca4272c0cd3b861074893d351fe903 (patch)
tree3cf0f6314ff55a5eae70b102dbe54359408f50ff /apps/px4
parentdad7f9f436e38fa1cae185156bb13c7920ae29da (diff)
downloadpx4-firmware-6c1b00e22fca4272c0cd3b861074893d351fe903.tar.gz
px4-firmware-6c1b00e22fca4272c0cd3b861074893d351fe903.tar.bz2
px4-firmware-6c1b00e22fca4272c0cd3b861074893d351fe903.zip
Counting the number of tests correctly
Diffstat (limited to 'apps/px4')
-rw-r--r--apps/px4/tests/test_bson.c2
-rw-r--r--apps/px4/tests/tests_main.c16
2 files changed, 12 insertions, 6 deletions
diff --git a/apps/px4/tests/test_bson.c b/apps/px4/tests/test_bson.c
index e2a10ec29..a42c462ca 100644
--- a/apps/px4/tests/test_bson.c
+++ b/apps/px4/tests/test_bson.c
@@ -240,5 +240,5 @@ test_bson(int argc, char *argv[])
decode(&decoder);
free(buf);
- exit(0);
+ return OK;
} \ No newline at end of file
diff --git a/apps/px4/tests/tests_main.c b/apps/px4/tests/tests_main.c
index 26f7ef96b..5c3b0b0c2 100644
--- a/apps/px4/tests/tests_main.c
+++ b/apps/px4/tests/tests_main.c
@@ -107,9 +107,9 @@ struct {
{"perf", test_perf, OPT_NOJIGTEST, 0},
{"all", test_all, OPT_NOALLTEST | OPT_NOJIGTEST, 0},
{"jig", test_jig, OPT_NOJIGTEST | OPT_NOALLTEST, 0},
- {"param", test_param, 0, 0},
- {"bson", test_bson, 0, 0},
- {"file", test_file, 0, 0},
+ {"param", test_param, OPT_NOJIGTEST, 0},
+ {"bson", test_bson, OPT_NOJIGTEST, 0},
+ {"file", test_file, OPT_NOJIGTEST, 0},
{"help", test_help, OPT_NOALLTEST | OPT_NOHELP | OPT_NOJIGTEST, 0},
{NULL, NULL, 0, 0}
};
@@ -133,6 +133,7 @@ test_all(int argc, char *argv[])
unsigned i;
char *args[2] = {"all", NULL};
unsigned int failcount = 0;
+ unsigned int testscount = 0;
printf("\nRunning all tests...\n\n");
@@ -153,6 +154,8 @@ test_all(int argc, char *argv[])
printf(" [%s] \t\t\tPASS\n", tests[i].name);
fflush(stdout);
}
+
+ testscount++;
}
}
@@ -184,7 +187,7 @@ test_all(int argc, char *argv[])
printf(" \\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_____\\ \n");
printf(" \\/_/ \\/_/\\/_/ \\/_/ \\/_____/ \n");
printf("\n");
- printf(" Some tests failed (%d of %d)\n", failcount, i);
+ printf(" Some tests failed (%d of %d)\n", failcount, testscount);
}
printf("\n");
@@ -242,6 +245,7 @@ int test_jig(int argc, char *argv[])
unsigned i;
char *args[2] = {"jig", NULL};
unsigned int failcount = 0;
+ unsigned int testscount = 0;
printf("\nRunning all tests...\n\n");
for (i = 0; tests[i].name; i++) {
@@ -259,6 +263,8 @@ int test_jig(int argc, char *argv[])
printf(" [%s] \t\t\tPASS\n", tests[i].name);
fflush(stdout);
}
+
+ testscount++;
}
}
@@ -287,7 +293,7 @@ int test_jig(int argc, char *argv[])
printf(" \\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_____\\ \n");
printf(" \\/_/ \\/_/\\/_/ \\/_/ \\/_____/ \n");
printf("\n");
- printf(" Some tests failed (%d of %d)\n", failcount, i);
+ printf(" Some tests failed (%d of %d)\n", failcount, testscount);
}
printf("\n");