With this patch the test binary checks the DPDK_TEST
environment variable and if set, the contents of the var
are inserted on the test app command line, and run.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Reviewed-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
+ last_test_result = ret;
if (ret == 0)
printf("Test OK\n");
else
if (ret == 0)
printf("Test OK\n");
else
int
main(int argc, char **argv)
{
int
main(int argc, char **argv)
{
if (cl == NULL) {
return -1;
}
if (cl == NULL) {
return -1;
}
+
+ char *dpdk_test = getenv("DPDK_TEST");
+ if (dpdk_test && strlen(dpdk_test)) {
+ char buf[1024];
+ snprintf(buf, sizeof(buf), "%s\n", dpdk_test);
+ if (cmdline_in(cl, buf, strlen(buf)) < 0) {
+ printf("error on cmdline input\n");
+ return -1;
+ }
+
+ cmdline_stdin_exit(cl);
+ return last_test_result;
+ }
+ /* if no DPDK_TEST env variable, go interactive */
cmdline_interact(cl);
cmdline_stdin_exit(cl);
#endif
cmdline_interact(cl);
cmdline_stdin_exit(cl);
#endif
printf(" + Tests Failed : %2d\n", failed);
printf(" + ------------------------------------------------------- +\n");
printf(" + Tests Failed : %2d\n", failed);
printf(" + ------------------------------------------------------- +\n");
+ last_test_result = failed;
+
};
int unit_test_suite_runner(struct unit_test_suite *suite);
};
int unit_test_suite_runner(struct unit_test_suite *suite);
+extern int last_test_result;
#define RECURSIVE_ENV_VAR "RTE_TEST_RECURSIVE"
#define RECURSIVE_ENV_VAR "RTE_TEST_RECURSIVE"