process: Add a wrapper to invoke a command under the system default shell

This commit is contained in:
Martin Willi
2014-10-06 18:24:39 +02:00
parent 02e4dedce5
commit 7dd06d274d
3 changed files with 110 additions and 0 deletions
@@ -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;
}