about summary refs log tree commit diff homepage
path: root/test
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2014-01-13 18:04:52 +0000
committerDan Liew <daniel.liew@imperial.ac.uk>2014-01-20 14:46:52 +0000
commit48ce6b94f4fe5131242ba87485cd79e081a991ed (patch)
tree4fac7a153d0d80f260d6229594c43dc3120fb895 /test
parent2914a43e42184efe46a7b28caccfbb54c781e795 (diff)
downloadklee-48ce6b94f4fe5131242ba87485cd79e081a991ed.tar.gz
Only run SELinux test if support for SELinux was detected at configure
time.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile1
-rw-r--r--test/Runtime/POSIX/SELinux/SELinux.c (renamed from test/Runtime/POSIX/SELinux.c)0
-rw-r--r--test/Runtime/POSIX/SELinux/lit.local.cfg7
-rw-r--r--test/lit.site.cfg.in1
4 files changed, 9 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile
index ea6624d0..23c891e4 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -123,4 +123,5 @@ lit.site.cfg: lit.site.cfg.in
 	     -e "s#@ENABLE_UCLIBC@#$(ENABLE_UCLIBC)#g" \
 	     -e "s#@ENABLE_POSIX_RUNTIME@#$(ENABLE_POSIX_RUNTIME)#g" \
 	     -e "s#@TARGET_TRIPLE@#$(TARGET_TRIPLE)#g" \
+	     -e "s#@HAVE_SELINUX@#$(HAVE_SELINUX)#g" \
 	     $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
diff --git a/test/Runtime/POSIX/SELinux.c b/test/Runtime/POSIX/SELinux/SELinux.c
index 65dd1a7f..65dd1a7f 100644
--- a/test/Runtime/POSIX/SELinux.c
+++ b/test/Runtime/POSIX/SELinux/SELinux.c
diff --git a/test/Runtime/POSIX/SELinux/lit.local.cfg b/test/Runtime/POSIX/SELinux/lit.local.cfg
new file mode 100644
index 00000000..2046d4d0
--- /dev/null
+++ b/test/Runtime/POSIX/SELinux/lit.local.cfg
@@ -0,0 +1,7 @@
+def getRoot(config):
+    if not config.parent:
+        return config
+    return getRoot(config.parent)
+
+if not getRoot(config).have_selinux:
+    config.unsupported = True
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 11159415..6fc3d49c 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -16,6 +16,7 @@ config.llvmgxx = "@LLVMCXX@"
 # Features
 config.enable_uclibc = True if @ENABLE_UCLIBC@ == 1 else False
 config.enable_posix_runtime = True if @ENABLE_POSIX_RUNTIME@ == 1 else False
+config.have_selinux = True if @HAVE_SELINUX@ == 1 else False
 
 # Current target
 config.target_triple = "@TARGET_TRIPLE@"