diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-12-09 12:56:41 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-12-09 12:56:41 +0100 |
| commit | 08d3e239e8870e16571401952db9b9245c2345de (patch) | |
| tree | 13c36a4ea75df2998ca8a03006eb47d1de8e6738 | |
| parent | 702390105f4982590b739508df6b7e8b933b0a84 (diff) | |
| download | libasm_test-08d3e239e8870e16571401952db9b9245c2345de.tar.gz libasm_test-08d3e239e8870e16571401952db9b9245c2345de.tar.bz2 libasm_test-08d3e239e8870e16571401952db9b9245c2345de.zip | |
Added segfault report log with arguments
| -rw-r--r-- | helper.c | 6 | ||||
| -rw-r--r-- | libasm_test.h | 6 | ||||
| -rw-r--r-- | prettier.py | 6 |
3 files changed, 9 insertions, 9 deletions
@@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/08 03:07:07 by cacharle #+# #+# */ -/* Updated: 2020/04/13 15:01:20 by charles ### ########.fr */ +/* Updated: 2020/12/09 12:52:33 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,8 +18,8 @@ void print_ok(void) fflush(stdout); } -void print_signaled_ko(void) +void print_signaled_ko(const char *code) { - printf("KO: [SEGFAULT]: %s\n", test_name); + printf("KO: [SEGFAULT]: %s: with: %s\n", test_name, code); fflush(stdout); } diff --git a/libasm_test.h b/libasm_test.h index afbc959..6218586 100644 --- a/libasm_test.h +++ b/libasm_test.h @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/08 03:07:19 by cacharle #+# #+# */ -/* Updated: 2020/11/07 17:13:23 by charles ### ########.fr */ +/* Updated: 2020/12/09 12:53:01 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -80,7 +80,7 @@ void ft_list_remove_if_test(void); * helpers */ void print_ok(void); -void print_signaled_ko(void); +void print_signaled_ko(const char *code); # ifdef LIBASM_TEST_BONUS int* create_data_elem(int data); @@ -129,7 +129,7 @@ extern char *test_name; # define TEST_ASM_FUNCTION(x) do { \ TEST_SEGFAULT(x); \ if (signaled) \ - print_signaled_ko(); \ + print_signaled_ko(#x); \ else \ print_ok(); \ } while(0) diff --git a/prettier.py b/prettier.py index 1833a71..04bb04c 100644 --- a/prettier.py +++ b/prettier.py @@ -6,7 +6,7 @@ # By: cacharle <marvin@42.fr> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/02/05 23:04:13 by cacharle #+# #+# # -# Updated: 2020/05/04 14:44:44 by charles ### ########.fr # +# Updated: 2020/12/09 12:56:07 by charles ### ########.fr # # # # **************************************************************************** # @@ -45,7 +45,7 @@ def parse(): continue m = None if line.find("SEGFAULT") != -1: - name = line[4:] + name = line[4:line.find("with")] else: m = re.search("^KO: \[COMPARE\]: (.*): expected: (.*) got: (.*)( with: .*)?$", line) if m is None: @@ -65,7 +65,7 @@ def parse(): "type": "SEGFAULT", "expected": None, "actual": None, - "with": None + "with": line[line.find("with:") + len("with:"):] }) else: l["ko_info"].append({ |
