[PATCH] D29628: [compiler-rt] [test] Enable the strace_test only if strace is installed

2017-02-08 Thread Michał Górny via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL294425: [test] Enable the strace_test only if strace is 
installed (authored by mgorny).

Changed prior to commit:
  https://reviews.llvm.org/D29628?vs=87392=87603#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D29628

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


Index: compiler-rt/trunk/test/lsan/TestCases/strace_test.cc
===
--- compiler-rt/trunk/test/lsan/TestCases/strace_test.cc
+++ compiler-rt/trunk/test/lsan/TestCases/strace_test.cc
@@ -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
 
Index: compiler-rt/trunk/test/lsan/lit.common.cfg
===
--- compiler-rt/trunk/test/lsan/lit.common.cfg
+++ compiler-rt/trunk/test/lsan/lit.common.cfg
@@ -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 @@
   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 + "/../"


Index: compiler-rt/trunk/test/lsan/TestCases/strace_test.cc
===
--- compiler-rt/trunk/test/lsan/TestCases/strace_test.cc
+++ compiler-rt/trunk/test/lsan/TestCases/strace_test.cc
@@ -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
 
Index: compiler-rt/trunk/test/lsan/lit.common.cfg
===
--- compiler-rt/trunk/test/lsan/lit.common.cfg
+++ compiler-rt/trunk/test/lsan/lit.common.cfg
@@ -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 @@
   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 + "/../"
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D29628: [compiler-rt] [test] Enable the strace_test only if strace is installed

2017-02-07 Thread Kostya Serebryany via Phabricator via cfe-commits
kcc accepted this revision.
kcc added a comment.
This revision is now accepted and ready to land.

LGTM, 
but please manually verify that the test runs if strace *is* available.


Repository:
  rL LLVM

https://reviews.llvm.org/D29628



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D29628: [compiler-rt] [test] Enable the strace_test only if strace is installed

2017-02-07 Thread Michał Górny via Phabricator via cfe-commits
mgorny created this revision.
Herald added a subscriber: dberris.

Check whether strace is to be found in PATH, and control the strace_test 
appropriately. This fixes a test failure when strace is not installed.


Repository:
  rL LLVM

https://reviews.llvm.org/D29628

Files:
  test/lsan/TestCases/strace_test.cc
  test/lsan/lit.common.cfg


Index: test/lsan/lit.common.cfg
===
--- test/lsan/lit.common.cfg
+++ test/lsan/lit.common.cfg
@@ -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 @@
   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 + "/../"
Index: test/lsan/TestCases/strace_test.cc
===
--- test/lsan/TestCases/strace_test.cc
+++ test/lsan/TestCases/strace_test.cc
@@ -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
 


Index: test/lsan/lit.common.cfg
===
--- test/lsan/lit.common.cfg
+++ test/lsan/lit.common.cfg
@@ -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 @@
   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 + "/../"
Index: test/lsan/TestCases/strace_test.cc
===
--- test/lsan/TestCases/strace_test.cc
+++ test/lsan/TestCases/strace_test.cc
@@ -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
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits