test/security: add inline inbound IPsec cases
[dpdk.git] / app / test / test.c
index ac0a663..e69cae3 100644 (file)
@@ -8,7 +8,6 @@
 #include <stdarg.h>
 #include <stdlib.h>
 #include <errno.h>
-#include <termios.h>
 #include <ctype.h>
 #include <sys/queue.h>
 
@@ -38,7 +37,8 @@ extern cmdline_parse_ctx_t main_ctx[];
 
 #define FOR_EACH_SUITE_TESTCASE(iter, suite, case)                     \
        for (iter = 0, case = suite->unit_test_cases[0];                \
-               suite->unit_test_cases[iter].testcase;                  \
+               suite->unit_test_cases[iter].testcase ||                \
+               suite->unit_test_cases[iter].testcase_with_data;        \
                iter++, case = suite->unit_test_cases[iter])
 
 #define FOR_EACH_SUITE_TESTSUITE(iter, suite, sub_ts)                  \
@@ -62,7 +62,9 @@ do_recursive_call(void)
                const char *env_var;
                int (*action_fn)(void);
        } actions[] =  {
+#ifndef RTE_EXEC_ENV_WINDOWS
                        { "run_secondary_instances", test_mp_secondary },
+#endif
 #ifdef RTE_LIB_PDUMP
 #ifdef RTE_NET_RING
                        { "run_pdump_server_tests", test_pdump },
@@ -81,7 +83,9 @@ do_recursive_call(void)
                        { "test_file_prefix", no_action },
                        { "test_no_huge_flag", no_action },
 #ifdef RTE_LIB_TIMER
+#ifndef RTE_EXEC_ENV_WINDOWS
                        { "timer_secondary_spawn_wait", test_timer_secondary },
+#endif
 #endif
        };
 
@@ -232,7 +236,6 @@ main(int argc, char **argv)
 
                cmdline_interact(cl);
                cmdline_stdin_exit(cl);
-               cmdline_free(cl);
        }
 #endif
        ret = 0;
@@ -341,7 +344,13 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 
                if (test_success == TEST_SUCCESS) {
                        /* run the test case */
-                       test_success = tc.testcase();
+                       if (tc.testcase)
+                               test_success = tc.testcase();
+                       else if (tc.testcase_with_data)
+                               test_success = tc.testcase_with_data(tc.data);
+                       else
+                               test_success = -ENOTSUP;
+
                        if (test_success == TEST_SUCCESS)
                                suite->succeeded++;
                        else if (test_success == TEST_SKIPPED)