git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test: skip tests when missing requirements
[dpdk.git]
/
app
/
test
/
test.c
diff --git
a/app/test/test.c
b/app/test/test.c
index
1c91ed6
..
194a92a
100644
(file)
--- a/
app/test/test.c
+++ b/
app/test/test.c
@@
-67,6
+67,7
@@
do_recursive_call(void)
{ "test_memory_flags", no_action },
{ "test_file_prefix", no_action },
{ "test_no_huge_flag", no_action },
{ "test_memory_flags", no_action },
{ "test_file_prefix", no_action },
{ "test_no_huge_flag", no_action },
+ { "timer_secondary_spawn_wait", test_timer_secondary },
};
if (recursive_call == NULL)
};
if (recursive_call == NULL)
@@
-130,7
+131,10
@@
main(int argc, char **argv)
}
#ifdef RTE_LIBRTE_TIMER
}
#ifdef RTE_LIBRTE_TIMER
- rte_timer_subsystem_init();
+ if (rte_timer_subsystem_init() < 0) {
+ ret = -1;
+ goto out;
+ }
#endif
if (commands_init() < 0) {
#endif
if (commands_init() < 0) {
@@
-183,6
+187,9
@@
main(int argc, char **argv)
ret = 0;
out:
ret = 0;
out:
+#ifdef RTE_LIBRTE_TIMER
+ rte_timer_subsystem_finalize();
+#endif
rte_eal_cleanup();
return ret;
}
rte_eal_cleanup();
return ret;
}
@@
-201,14
+208,16
@@
unit_test_suite_runner(struct unit_test_suite *suite)
printf(" + Test Suite : %s\n", suite->suite_name);
}
printf(" + Test Suite : %s\n", suite->suite_name);
}
- if (suite->setup)
- if (suite->setup() != 0) {
+ if (suite->setup) {
+ test_success = suite->setup();
+ if (test_success != 0) {
/*
/*
- * setup
failed, so count all enabled tests and mark
- *
them as fail
ed
+ * setup
did not pass, so count all enabled tests and
+ *
mark them as failed/skipp
ed
*/
while (suite->unit_test_cases[total].testcase) {
*/
while (suite->unit_test_cases[total].testcase) {
- if (!suite->unit_test_cases[total].enabled)
+ if (!suite->unit_test_cases[total].enabled ||
+ test_success == TEST_SKIPPED)
skipped++;
else
failed++;
skipped++;
else
failed++;
@@
-216,6
+225,7
@@
unit_test_suite_runner(struct unit_test_suite *suite)
}
goto suite_summary;
}
}
goto suite_summary;
}
+ }
printf(" + ------------------------------------------------------- +\n");
printf(" + ------------------------------------------------------- +\n");
@@
-239,6
+249,8
@@
unit_test_suite_runner(struct unit_test_suite *suite)
test_success = suite->unit_test_cases[total].testcase();
if (test_success == TEST_SUCCESS)
succeeded++;
test_success = suite->unit_test_cases[total].testcase();
if (test_success == TEST_SUCCESS)
succeeded++;
+ else if (test_success == TEST_SKIPPED)
+ skipped++;
else if (test_success == -ENOTSUP)
unsupported++;
else
else if (test_success == -ENOTSUP)
unsupported++;
else
@@
-255,6
+267,8
@@
unit_test_suite_runner(struct unit_test_suite *suite)
if (test_success == TEST_SUCCESS)
status = "succeeded";
if (test_success == TEST_SUCCESS)
status = "succeeded";
+ else if (test_success == TEST_SKIPPED)
+ status = "skipped";
else if (test_success == -ENOTSUP)
status = "unsupported";
else
else if (test_success == -ENOTSUP)
status = "unsupported";
else
@@
-286,7
+300,8
@@
suite_summary:
last_test_result = failed;
if (failed)
last_test_result = failed;
if (failed)
- return -1;
-
- return 0;
+ return TEST_FAILED;
+ if (total == skipped)
+ return TEST_SKIPPED;
+ return TEST_SUCCESS;
}
}