[compiler-rt] r294425 - [test] Enable the strace_test only if strace is installed

Michal Gorny via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 00:43:45 PST 2017


Author: mgorny
Date: Wed Feb  8 02:43:44 2017
New Revision: 294425

URL: http://llvm.org/viewvc/llvm-project?rev=294425&view=rev
Log:
[test] Enable the strace_test only if strace is installed

Differential Revision: https://reviews.llvm.org/D29628

Modified:
    compiler-rt/trunk/test/lsan/TestCases/strace_test.cc
    compiler-rt/trunk/test/lsan/lit.common.cfg

Modified: compiler-rt/trunk/test/lsan/TestCases/strace_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lsan/TestCases/strace_test.cc?rev=294425&r1=294424&r2=294425&view=diff
==============================================================================
--- compiler-rt/trunk/test/lsan/TestCases/strace_test.cc (original)
+++ compiler-rt/trunk/test/lsan/TestCases/strace_test.cc Wed Feb  8 02:43:44 2017
@@ -1,4 +1,5 @@
 // Test that lsan reports a proper error when running under strace.
+// REQUIRES: strace
 // RUN: %clangxx_lsan %s -o %t
 // RUN: not strace -o /dev/null %run %t 2>&1 | FileCheck %s
 

Modified: compiler-rt/trunk/test/lsan/lit.common.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lsan/lit.common.cfg?rev=294425&r1=294424&r2=294425&view=diff
==============================================================================
--- compiler-rt/trunk/test/lsan/lit.common.cfg (original)
+++ compiler-rt/trunk/test/lsan/lit.common.cfg Wed Feb  8 02:43:44 2017
@@ -4,6 +4,8 @@
 
 import os
 
+import lit.util
+
 def get_required_attr(config, attr_name):
   attr_value = getattr(config, attr_name, None)
   if attr_value == None:
@@ -29,6 +31,9 @@ else:
   lit_config.fatal("Unknown LSan test mode: %r" % lsan_lit_test_mode)
 config.name += config.name_suffix
 
+if lit.util.which('strace'):
+  config.available_features.add('strace')
+
 clang_cflags = ["-O0", config.target_cflags] + config.debug_info_flags
 clang_cxxflags = config.cxx_mode_flags + clang_cflags
 lsan_incdir = config.test_source_root + "/../"




More information about the llvm-commits mailing list