Skip to content

Commit

Permalink
Fix LIBS and improved signal error report.
Browse files Browse the repository at this point in the history
  • Loading branch information
eerimoq committed May 27, 2020
1 parent d287422 commit e042265
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/nala.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <stdint.h>
#include <stdio.h>

#define NALA_VERSION "0.174.1"
#define NALA_VERSION "0.175.0"

/**
* Assert that given characters, numbers, pointers or strings are
Expand Down
7 changes: 5 additions & 2 deletions nala/dist/nala.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,11 @@ static void print_signal_failure(struct nala_test_t *test_p)
{
print_test_failure_report_begin();
printf(" Test: " COLOR_BOLD(CYAN, "%s\n"), full_test_name(current_test_p));
printf(" Error: " COLOR_BOLD(RED, "Terminated by signal %d.\n"),
test_p->run.signal_number);
printf(" Error: " COLOR_BOLD(RED, "Terminated by signal %d (%s).\n"),
test_p->run.signal_number,
strsignal(test_p->run.signal_number));
printf("\n Run '" COLOR(GREEN, "make gdb TEST=%s") "' to debug with GDB.\n",
full_test_name(current_test_p));
print_test_failure_report_end();
}

Expand Down
2 changes: 1 addition & 1 deletion nala/dist/nala.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <stdint.h>
#include <stdio.h>

#define NALA_VERSION "0.174.1"
#define NALA_VERSION "0.175.0"

/**
* Assert that given characters, numbers, pointers or strings are
Expand Down
2 changes: 1 addition & 1 deletion nala/subcommands/init/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ help:

$(EXE): $(OBJ)
echo "LD $@"
$(CC) $(CFLAGS) @$(BUILD)/nala_mocks.ldflags $^ $(LIBS=%=-l%) -o $@
$(CC) $(CFLAGS) @$(BUILD)/nala_mocks.ldflags $^ $(LIBS:%=-l%) -o $@

define COMPILE_template
$(patsubst %.c,$(BUILD)%.o,$(abspath $1)): $1
Expand Down
2 changes: 1 addition & 1 deletion nala/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.174.1'
__version__ = '0.175.0'
7 changes: 5 additions & 2 deletions src/nala.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,11 @@ static void print_signal_failure(struct nala_test_t *test_p)
{
print_test_failure_report_begin();
printf(" Test: " COLOR_BOLD(CYAN, "%s\n"), full_test_name(current_test_p));
printf(" Error: " COLOR_BOLD(RED, "Terminated by signal %d.\n"),
test_p->run.signal_number);
printf(" Error: " COLOR_BOLD(RED, "Terminated by signal %d (%s).\n"),
test_p->run.signal_number,
strsignal(test_p->run.signal_number));
printf("\n Run '" COLOR(GREEN, "make gdb TEST=%s") "' to debug with GDB.\n",
full_test_name(current_test_p));
print_test_failure_report_end();
}

Expand Down
12 changes: 10 additions & 2 deletions tst/test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,14 @@ TEST(subtest_run_all_tests_continue_on_failure)
result_p = subprocess_exec_output("subtest/build/app --continue-on-failure");

ASSERT_EQ(result_p->exit_code, 1);
ASSERT_SUBSTRING(result_p->stdout.buf_p, "Terminated by signal 11.");
ASSERT_SUBSTRING(result_p->stdout.buf_p,
"Terminated by signal 11 (Segmentation fault).");
ASSERT_SUBSTRING(
result_p->stdout.buf_p,
"Run '" "\x1b[0m\x1b[32m"
"make gdb TEST=test_fail::segfault" "\x1b[0m"
"' to debug "
"with GDB.\n");
ASSERT_SUBSTRING(result_p->stdout.buf_p, "2 failed");
ASSERT_SUBSTRING(result_p->stdout.buf_p, "4 passed");
ASSERT_SUBSTRING(result_p->stdout.buf_p, "6 total");
Expand All @@ -1186,7 +1193,8 @@ TEST(subtest_parallel_continue_on_with_failure)
"subtest/build/app --jobs 2 --continue-on-failure");

ASSERT_EQ(result_p->exit_code, 1);
ASSERT_SUBSTRING(result_p->stdout.buf_p, "Terminated by signal 11.");
ASSERT_SUBSTRING(result_p->stdout.buf_p,
"Terminated by signal 11 (Segmentation fault).");
ASSERT_SUBSTRING(result_p->stdout.buf_p, "2 failed");
ASSERT_SUBSTRING(result_p->stdout.buf_p, "4 passed");
ASSERT_SUBSTRING(result_p->stdout.buf_p, "6 total");
Expand Down

0 comments on commit e042265

Please sign in to comment.