diff options
| author | jvoisin | 2023-06-25 18:35:23 +0200 |
|---|---|---|
| committer | jvoisin | 2023-06-25 18:35:23 +0200 |
| commit | 8848bca36ef19c15b071939e69bec77603d64ca1 (patch) | |
| tree | 2c51874ecfaadaa319eee7c0927c7d5f184c7e5d /tests | |
| parent | fe149628eaae9748be08815d726cc56e8e492c73 (diff) | |
Fix clang support
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Makefile | 17 | ||||
| -rw-r--r-- | tests/test_poll.c | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/tests/Makefile b/tests/Makefile index ee43a93..48374bf 100644 --- a/tests/Makefile +++ b/tests/Makefile | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | CC=../x86_64-linux-musl-native/bin/gcc | ||
| 2 | GCOV=../x86_64-linux-musl-native/bin/gcov | ||
| 3 | CFLAGS=-I../include/ -D_FORTIFY_SOURCE=3 -static -O2 | 1 | CFLAGS=-I../include/ -D_FORTIFY_SOURCE=3 -static -O2 |
| 4 | 2 | ||
| 5 | TARGETS= \ | 3 | TARGETS= \ |
| @@ -36,7 +34,18 @@ TARGETS= \ | |||
| 36 | test_poll \ | 34 | test_poll \ |
| 37 | test_ppoll \ | 35 | test_ppoll \ |
| 38 | 36 | ||
| 39 | .SILENT: | 37 | #.SILENT: |
| 38 | |||
| 39 | gcc: CC=../x86_64-linux-musl-native/bin/gcc | ||
| 40 | gcc: GCOV=../x86_64-linux-musl-native/bin/gcov | ||
| 41 | gcc: clean all | ||
| 42 | |||
| 43 | clang: CC=clang | ||
| 44 | clang: GCOV=gcov | ||
| 45 | clang: CFLAGS+=-I/usr/include/x86_64-linux-musl | ||
| 46 | clang: CLFAGS+=-nostdlib | ||
| 47 | clang: clean all | ||
| 48 | |||
| 40 | 49 | ||
| 41 | all: $(TARGETS) run | 50 | all: $(TARGETS) run |
| 42 | 51 | ||
| @@ -51,7 +60,7 @@ $(TARGETS): %: %.c | |||
| 51 | 60 | ||
| 52 | run: $(TARGETS) | 61 | run: $(TARGETS) |
| 53 | $(foreach EXE, $(TARGETS), \ | 62 | $(foreach EXE, $(TARGETS), \ |
| 54 | ./$(EXE) 1 2 3 4 5 6 7 8 9 0 >/dev/null && echo "$(EXE) OK" || echo "$(EXE) FAIL" ; \ | 63 | timeout 1s ./$(EXE) 1 2 3 4 5 6 7 8 9 0 >/dev/null && echo "$(EXE) OK" || echo "$(EXE) FAIL" ; \ |
| 55 | ) | 64 | ) |
| 56 | 65 | ||
| 57 | clean: | 66 | clean: |
diff --git a/tests/test_poll.c b/tests/test_poll.c index 397aa3d..06237aa 100644 --- a/tests/test_poll.c +++ b/tests/test_poll.c | |||
| @@ -6,7 +6,7 @@ int main(int argc, char** argv) { | |||
| 6 | struct pollfd buffer[12] = {0}; | 6 | struct pollfd buffer[12] = {0}; |
| 7 | 7 | ||
| 8 | CHK_FAIL_START | 8 | CHK_FAIL_START |
| 9 | poll(buffer, 14, NULL); | 9 | poll(buffer, 14, 0); |
| 10 | CHK_FAIL_END | 10 | CHK_FAIL_END |
| 11 | 11 | ||
| 12 | puts(buffer); | 12 | puts(buffer); |
