about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-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@"