testing cleanup

This commit is contained in:
Daniel Agar
2016-05-13 13:01:41 +02:00
committed by Lorenz Meier
parent 12165ba5a4
commit 008354f935
11 changed files with 153 additions and 145 deletions
@@ -128,7 +128,7 @@ int uORBTest::UnitTest::pubsublatency_main(void)
pubsubtest_passed = true;
if (static_cast<float>(latency_integral / maxruns) > 30.0f) {
if (static_cast<float>(latency_integral / maxruns) > 40.0f) {
pubsubtest_res = uORB::ERROR;
} else {
@@ -44,31 +44,38 @@ extern "C" { __EXPORT int uorb_tests_main(int argc, char *argv[]); }
static void usage()
{
PX4_INFO("Usage: uorb_test 'test', 'latency_test'");
PX4_INFO("Usage: uorb_test 'latency_test'");
}
int
uorb_tests_main(int argc, char *argv[])
{
if (argc < 2) {
usage();
return -EINVAL;
}
#ifndef __PX4_QURT
/*
* Test the driver/device.
*/
if (!strcmp(argv[1], "test")) {
if (argc == 1) {
uORBTest::UnitTest &t = uORBTest::UnitTest::instance();
return t.test();
int rc = t.test();
if (rc == OK) {
fprintf(stdout, " [uORBTest] \t\tPASS\n");
fflush(stdout);
return 0;
} else {
fprintf(stderr, " [uORBTest] \t\tFAIL\n");
fflush(stderr);
return -1;
}
}
/*
* Test the latency.
*/
if (!strcmp(argv[1], "latency_test")) {
if (argc > 1 && !strcmp(argv[1], "latency_test")) {
uORBTest::UnitTest &t = uORBTest::UnitTest::instance();