diff --git a/test.h b/test.h index 88d3586..26a2dcd 100644 --- a/test.h +++ b/test.h @@ -40,7 +40,7 @@ do { \ char buf__[BUFSIZ]; \ ptrdiff_t len__ = snprintf(buf__, BUFSIZ, "%s" fmt "%s\n", clr, KNRM); \ - write((fd), buf__, len__); \ + assert(len__ == write((fd), buf__, len__)); \ } while (0) #define suite() pr(STDOUT_FILENO, "Suite: " __FILE__, KCYN) diff --git a/test/Makefile b/test/Makefile index 39904f7..fb9abae 100644 --- a/test/Makefile +++ b/test/Makefile @@ -8,7 +8,7 @@ DELIM = echo "~~" ASAN = -fsanitize=address UBSAN = -fsanitize=undefined TSAN = -fsanitize=thread -CFLAGS = -std=$(STD) -Wall -Wextra -Wconversion -Wno-sign-conversion -Wdouble-promotion -Wcast-qual -Wvla -Werror -pedantic -O0 -g3 -DNCOLOR=$(NCOLOR) -fpie +CFLAGS = -std=$(STD) -Wall -Wextra -Wconversion -Wno-sign-conversion -Wdouble-promotion -Wcast-qual -Wvla -Werror -pedantic -g3 -DNCOLOR=$(NCOLOR) -fpie LDFLAGS = -Wl,-pie check: test_arena test_spinlock test_msi @@ -21,7 +21,7 @@ test_arena: arena arena: arena.c .force $(CC) -o $@ $(CFLAGS) $(ASAN) $(UBSAN) $< $(LDFLAGS) -test_spinlock: spinlock_tsan spinlock_asan +test_spinlock: spinlock_asan @$(DELIM) @echo "[Under TSan]" @./spinlock_tsan