| Cutter Reference Manual | ||||
|---|---|---|---|---|
#define cut_user_data #define cut_fork () #define cut_wait_process (pid, usec_timeout) #define cut_fork_get_stdout_message (pid) #define cut_fork_get_stderr_message (pid)
#define cut_user_data
This is useful only if you make a custom test runner like cutter command. You can pass a data from your custom test runner to test programs. They will receive your data through this.
Returns : |
a data from a program who invokes your test. |
#define cut_fork()
Makes child process.
e.g.:
int pid;
pid = cut_fork();
cut_assert_errno();
if (pid == 0) {
do_something_for_child_process();
_exit(EXIT_SUCCESS);
}
do_something_for_parent_process();
Returns : |
Process ID. |
Since 0.8
#define cut_wait_process(pid, usec_timeout)
Waits a process specified by pid.
e.g.:
int pid;
pid = cut_fork();
cut_assert_errno();
if (pid == 0) {
do_something_for_child_process();
_exit(EXIT_SUCCESS);
}
do_something_for_parent_process();
cut_assert_equal_int(EXIT_SUCCESS, cut_wait_process(pid, 100));
|
Process ID to wait. |
|
Timeout in usec. |
Since 0.8
#define cut_fork_get_stdout_message(pid)
Reads a message from a process specified by pid.
e.g.:
int pid;
pid = cut_fork();
cut_assert_errno();
if (pid == 0) {
g_print("I'm a child.");
_exit(EXIT_SUCCESS);
}
cut_assert_equal_string("I'm a child.", cut_fork_get_stdout_message(pid));
cut_assert_equal_int(EXIT_SUCCESS, cut_wait_process(pid, 100));
|
Process ID. |
Since 0.8
#define cut_fork_get_stderr_message(pid)
Reads a message from a process specified by pid.
e.g.:
int pid;
pid = cut_fork();
cut_assert_errno();
if (pid == 0) {
g_print("I'm a child.");
_exit(EXIT_SUCCESS);
}
cut_assert_equal_string("I'm a child.", cut_fork_get_stderr_message(pid));
cut_assert_equal_int(EXIT_SUCCESS, cut_wait_process(pid, 100));
|
Process ID. |
Since 0.8