process: Add a wrapper to invoke a command under the system default shell
This commit is contained in:
@@ -176,6 +176,18 @@ START_TEST(test_env)
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_shell)
|
||||
{
|
||||
process_t *process;
|
||||
int retval;
|
||||
|
||||
process = process_start_shell(NULL, NULL, NULL, NULL, "exit %d", 3);
|
||||
ck_assert(process != NULL);
|
||||
ck_assert(process->wait(process, &retval));
|
||||
ck_assert_int_eq(retval, 3);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
Suite *process_suite_create()
|
||||
{
|
||||
Suite *s;
|
||||
@@ -201,5 +213,9 @@ Suite *process_suite_create()
|
||||
tcase_add_test(tc, test_env);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
tc = tcase_create("shell");
|
||||
tcase_add_test(tc, test_shell);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user