summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorJakub Czapiga <jacz@semihalf.com>2021-03-25 13:10:31 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-04-06 06:58:05 +0000
commit084ad93663d113a3c4d5c5b41d50179cb29b2881 (patch)
treef79dd5763414ca9646a15af8b28bea66e0c81a88 /src/include
parentf5c0021e058ecba3570b1743f1d1077b2eb86565 (diff)
downloadcoreboot-084ad93663d113a3c4d5c5b41d50179cb29b2881.tar.xz
include/rules.h: Add ENV_TEST definition
Some functions/macros like assert() require redefinition for testing purposes. ENV_TEST is introduced to make it possible without using bypass hacks. This patch also adds a global __TEST__ define to TEST_CFLAGS for all test targets in order to enable ENV_TEST. Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: Ib8f2932902a73a7dbe181adc82cc18437abb48e8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/51803 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/rules.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/rules.h b/src/include/rules.h
index 6ebb37e804..ec3d22d7d1 100644
--- a/src/include/rules.h
+++ b/src/include/rules.h
@@ -3,6 +3,12 @@
#ifndef _RULES_H
#define _RULES_H
+#if defined(__TEST__)
+#define ENV_TEST 1
+#else
+#define ENV_TEST 0
+#endif
+
#if defined(__TIMELESS__)
#define ENV_TIMELESS 1
#else