summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2022-09-02 17:17:35 +1000
committerThomas Heijligen <src@posteo.de>2022-09-12 12:44:19 +0000
commita30be92ff32832c416303a1bee39d3549f8b3b0c (patch)
tree4ab847def0d9a798071e80ac1846c3e1631f8881 /tests
parent73c0a1d8785f846bb2586a96a3f0a4808456791d (diff)
downloadflashrom-a30be92ff32832c416303a1bee39d3549f8b3b0c.tar.gz
flashrom-a30be92ff32832c416303a1bee39d3549f8b3b0c.tar.bz2
flashrom-a30be92ff32832c416303a1bee39d3549f8b3b0c.zip
tests: Guard Linux-specific linux/spidev.h header file
This allows unit tests to build on non-Linux platforms. BUG=b:237606255 TEST=unit tests compile on two environments: 1) FreeBSD 13.1-RELEASE-p2 GENERIC amd64 2) Debian 5.17.11 x86_64 GNU/Linux Change-Id: Icdb1b0cb29c5d62187153788ad5e0e631e8d0b62 TICKET: https://ticket.coreboot.org/issues/411 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67311 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/lifecycle.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/lifecycle.h b/tests/lifecycle.h
index 1379f7d77..69f111969 100644
--- a/tests/lifecycle.h
+++ b/tests/lifecycle.h
@@ -18,7 +18,9 @@
#include <include/test.h>
#include <string.h>
+#if defined(__linux__) && !defined(__ANDROID__)
#include <linux/spi/spidev.h>
+#endif
#include "tests.h"
#include "libflashrom.h"