From b3636fa8864913413455a050c5425447c9e98bc0 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 28 Aug 2024 10:53:10 -0400 Subject: build: Move feature test macros to prelude.h This replaces the explicit CPPFLAGS list in flags.mk with just `-include src/prelude.h`, shortening our compiler command lines and allowing them to be easily documented. --- tests/alloc.c | 1 - tests/bfstd.c | 1 - tests/bit.c | 3 +-- tests/ioq.c | 1 - tests/list.c | 3 +-- tests/main.c | 1 - tests/sighook.c | 1 - tests/tests.h | 2 -- tests/trie.c | 3 +-- tests/xspawn.c | 1 - tests/xtime.c | 3 +-- tests/xtouch.c | 2 -- 12 files changed, 4 insertions(+), 18 deletions(-) (limited to 'tests') diff --git a/tests/alloc.c b/tests/alloc.c index ec8e8f7..f91b428 100644 --- a/tests/alloc.c +++ b/tests/alloc.c @@ -1,7 +1,6 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" #include "tests.h" #include "alloc.h" diff --git a/tests/bfstd.c b/tests/bfstd.c index 068e371..fe64ff3 100644 --- a/tests/bfstd.c +++ b/tests/bfstd.c @@ -1,7 +1,6 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" #include "tests.h" #include "bfstd.h" diff --git a/tests/bit.c b/tests/bit.c index 854398c..1446b13 100644 --- a/tests/bit.c +++ b/tests/bit.c @@ -1,12 +1,11 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" +#include "tests.h" #include "bfs.h" #include "bit.h" #include "diag.h" -#include "tests.h" #include #include diff --git a/tests/ioq.c b/tests/ioq.c index 61a924f..a2db813 100644 --- a/tests/ioq.c +++ b/tests/ioq.c @@ -1,7 +1,6 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" #include "tests.h" #include "bfstd.h" diff --git a/tests/list.c b/tests/list.c index 820fbe4..b3d74a1 100644 --- a/tests/list.c +++ b/tests/list.c @@ -1,11 +1,10 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" +#include "tests.h" #include "bfs.h" #include "list.h" -#include "tests.h" struct item { int n; diff --git a/tests/main.c b/tests/main.c index 9cbdcfb..dcb5d98 100644 --- a/tests/main.c +++ b/tests/main.c @@ -5,7 +5,6 @@ * Entry point for unit tests. */ -#include "prelude.h" #include "tests.h" #include "bfstd.h" diff --git a/tests/sighook.c b/tests/sighook.c index adc53d8..4121a44 100644 --- a/tests/sighook.c +++ b/tests/sighook.c @@ -1,7 +1,6 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" #include "tests.h" #include "atomic.h" diff --git a/tests/tests.h b/tests/tests.h index 2c1eb3a..4c6b3d2 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -8,8 +8,6 @@ #ifndef BFS_TESTS_H #define BFS_TESTS_H -#include "prelude.h" - #include "bfstd.h" #include "diag.h" diff --git a/tests/trie.c b/tests/trie.c index 41b729e..9e9a294 100644 --- a/tests/trie.c +++ b/tests/trie.c @@ -1,11 +1,10 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" +#include "tests.h" #include "bfs.h" #include "diag.h" -#include "tests.h" #include "trie.h" #include diff --git a/tests/xspawn.c b/tests/xspawn.c index 20617de..3194adc 100644 --- a/tests/xspawn.c +++ b/tests/xspawn.c @@ -1,7 +1,6 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" #include "tests.h" #include "alloc.h" diff --git a/tests/xtime.c b/tests/xtime.c index 6d7716d..c87a69e 100644 --- a/tests/xtime.c +++ b/tests/xtime.c @@ -1,12 +1,11 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" +#include "tests.h" #include "bfs.h" #include "bfstd.h" #include "diag.h" -#include "tests.h" #include "xtime.h" #include diff --git a/tests/xtouch.c b/tests/xtouch.c index 705d4e2..e7c2e00 100644 --- a/tests/xtouch.c +++ b/tests/xtouch.c @@ -1,8 +1,6 @@ // Copyright © Tavian Barnes // SPDX-License-Identifier: 0BSD -#include "prelude.h" - #include "bfstd.h" #include "sanity.h" #include "xtime.h" -- cgit v1.2.3