diff options
author | Alice Frosi <afrosi@redhat.com> | 2023-05-10 15:19:49 +0200 |
---|---|---|
committer | Alice Frosi <afrosi@redhat.com> | 2023-05-11 10:52:53 +0200 |
commit | 94df2efe2d2221bf0c4d77510142c95283d76f2b (patch) | |
tree | 68a137ca71de1f8d5f552d78de3ea3111230067b /tests/unit/testutil.h | |
parent | b29288b8b000730bbd416b0e1f4f4c694e346e20 (diff) | |
download | seitan-94df2efe2d2221bf0c4d77510142c95283d76f2b.tar seitan-94df2efe2d2221bf0c4d77510142c95283d76f2b.tar.gz seitan-94df2efe2d2221bf0c4d77510142c95283d76f2b.tar.bz2 seitan-94df2efe2d2221bf0c4d77510142c95283d76f2b.tar.lz seitan-94df2efe2d2221bf0c4d77510142c95283d76f2b.tar.xz seitan-94df2efe2d2221bf0c4d77510142c95283d76f2b.tar.zst seitan-94df2efe2d2221bf0c4d77510142c95283d76f2b.zip |
Clean-up error message and test
Refactoring error messages:
- standardize error messages and functions
- return on error instead of exit
- test error when target doesn't exist
- include ability to capture stderr and stdout in the tests
Diffstat (limited to 'tests/unit/testutil.h')
-rw-r--r-- | tests/unit/testutil.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/unit/testutil.h b/tests/unit/testutil.h index ec881c7..861efb0 100644 --- a/tests/unit/testutil.h +++ b/tests/unit/testutil.h @@ -1,6 +1,6 @@ #ifndef TESTUTIL_H #define TESTUTIL_H - +#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <stdbool.h> @@ -67,6 +67,8 @@ extern struct args_target *at; extern int pipefd[2]; extern pid_t pid; extern char path[PATH_MAX]; +extern char stderr_buff[BUFSIZ]; +extern char stdout_buff[BUFSIZ]; extern struct gluten gluten; @@ -85,4 +87,7 @@ void continue_target(); void mock_syscall_target(); void set_args_no_check(struct args_target *at); void check_target_result_nonegative(); +void ck_error_msg(char *s); +void ck_stderr(); +void ck_stdout(); #endif /* TESTUTIL_H */ |