[clang-tools-extra] r278815 - Remove most instances of REQUIRES: shell from the tools/extra tests

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 16 09:07:46 PDT 2016


Author: rnk
Date: Tue Aug 16 11:07:46 2016
New Revision: 278815

URL: http://llvm.org/viewvc/llvm-project?rev=278815&view=rev
Log:
Remove most instances of REQUIRES: shell from the tools/extra tests

None of these tests actually require bash, they just have quoting bugs
when paths contain backslashes and colons. Fix them with the "%/T" lit
substitution variants.

Modified:
    clang-tools-extra/trunk/test/clang-tidy/clang-tidy-run-with-database.cpp
    clang-tools-extra/trunk/test/clang-tidy/list-checks.cpp
    clang-tools-extra/trunk/test/include-fixer/commandline_options.cpp
    clang-tools-extra/trunk/test/include-fixer/exit_on_fatal.cpp
    clang-tools-extra/trunk/test/include-fixer/fixeddb.cpp
    clang-tools-extra/trunk/test/include-fixer/include_path.cpp
    clang-tools-extra/trunk/test/include-fixer/merge.test
    clang-tools-extra/trunk/test/include-fixer/prefix_variable.cpp
    clang-tools-extra/trunk/test/include-fixer/yamldb.cpp
    clang-tools-extra/trunk/test/include-fixer/yamldb_autodetect.cpp

Modified: clang-tools-extra/trunk/test/clang-tidy/clang-tidy-run-with-database.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/clang-tidy-run-with-database.cpp?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/clang-tidy-run-with-database.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/clang-tidy-run-with-database.cpp Tue Aug 16 11:07:46 2016
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: mkdir -p %T/compilation-database-test/include
 // RUN: mkdir -p %T/compilation-database-test/a
 // RUN: mkdir -p %T/compilation-database-test/b
@@ -8,7 +7,7 @@
 // RUN: echo 'int *BC = 0;' > %T/compilation-database-test/b/c.cpp
 // RUN: echo 'int *HP = 0;' > %T/compilation-database-test/include/header.h
 // RUN: echo '#include "header.h"' > %T/compilation-database-test/b/d.cpp
-// RUN: sed 's|test_dir|%T/compilation-database-test|g' %S/Inputs/compilation-database/template.json > %T/compile_commands.json
+// RUN: sed 's|test_dir|%/T/compilation-database-test|g' %S/Inputs/compilation-database/template.json > %T/compile_commands.json
 // RUN: clang-tidy --checks=-*,modernize-use-nullptr -p %T %T/compilation-database-test/b/not-exist -header-filter=.*
 // RUN: clang-tidy --checks=-*,modernize-use-nullptr -p %T %T/compilation-database-test/a/a.cpp %T/compilation-database-test/a/b.cpp %T/compilation-database-test/b/b.cpp %T/compilation-database-test/b/c.cpp %T/compilation-database-test/b/d.cpp -header-filter=.* -fix
 // RUN: FileCheck -input-file=%T/compilation-database-test/a/a.cpp %s -check-prefix=CHECK-FIX1

Modified: clang-tools-extra/trunk/test/clang-tidy/list-checks.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/list-checks.cpp?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/list-checks.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/list-checks.cpp Tue Aug 16 11:07:46 2016
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: mkdir -p %T/clang-tidy/list-checks/
 // RUN: echo '{Checks: "-*,google-*"}' > %T/clang-tidy/.clang-tidy
 // RUN: cd %T/clang-tidy/list-checks

Modified: clang-tools-extra/trunk/test/include-fixer/commandline_options.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/include-fixer/commandline_options.cpp?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/include-fixer/commandline_options.cpp (original)
+++ clang-tools-extra/trunk/test/include-fixer/commandline_options.cpp Tue Aug 16 11:07:46 2016
@@ -1,9 +1,8 @@
-// REQUIRES: shell
 // RUN: echo "foo f;" > %t.cpp
 // RUN: clang-include-fixer -db=fixed -input='foo= "foo.h","bar.h"' -output-headers %t.cpp -- | FileCheck %s
-// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{FilePath: %t.cpp, QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"}]}' %t.cpp | FileCheck %s -check-prefix=CHECK-CODE
-// RUN: cat %t.cpp | not clang-include-fixer -stdin -insert-header='{FilePath: %t.cpp, QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"},{Header: "\"foo2.h\"", QualifiedName: "foo"}]}' %t.cpp
-// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{FilePath: %t.cpp, QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "a:foo"},{Header: "\"foo.h\"", QualifiedName: "b:foo"}]}' %t.cpp
+// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{FilePath: "%/t.cpp", QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"}]}' %t.cpp | FileCheck %s -check-prefix=CHECK-CODE
+// RUN: cat %t.cpp | not clang-include-fixer -stdin -insert-header='{FilePath: "%/t.cpp", QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"},{Header: "\"foo2.h\"", QualifiedName: "foo"}]}' %t.cpp
+// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{FilePath: "%/t.cpp", QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "a:foo"},{Header: "\"foo.h\"", QualifiedName: "b:foo"}]}' %t.cpp
 //
 // CHECK:     "HeaderInfos": [
 // CHECK-NEXT:  {"Header": "\"foo.h\"",

Modified: clang-tools-extra/trunk/test/include-fixer/exit_on_fatal.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/include-fixer/exit_on_fatal.cpp?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/include-fixer/exit_on_fatal.cpp (original)
+++ clang-tools-extra/trunk/test/include-fixer/exit_on_fatal.cpp Tue Aug 16 11:07:46 2016
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: sed -e 's#//.*$##' %s > %t.cpp
 // RUN: not clang-include-fixer -db=fixed -input='foo= "foo.h"' %t.cpp --
 // RUN: FileCheck %s -input-file=%t.cpp

Modified: clang-tools-extra/trunk/test/include-fixer/fixeddb.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/include-fixer/fixeddb.cpp?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/include-fixer/fixeddb.cpp (original)
+++ clang-tools-extra/trunk/test/include-fixer/fixeddb.cpp Tue Aug 16 11:07:46 2016
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: sed -e 's#//.*$##' %s > %t.cpp
 // RUN: clang-include-fixer -db=fixed -input='foo= "foo.h","bar.h"' %t.cpp --
 // RUN: FileCheck %s -input-file=%t.cpp

Modified: clang-tools-extra/trunk/test/include-fixer/include_path.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/include-fixer/include_path.cpp?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/include-fixer/include_path.cpp (original)
+++ clang-tools-extra/trunk/test/include-fixer/include_path.cpp Tue Aug 16 11:07:46 2016
@@ -1,9 +1,8 @@
-// REQUIRES: shell
 // RUN: mkdir -p %T/include-fixer/include
 // RUN: mkdir -p %T/include-fixer/symbols
 // RUN: mkdir -p %T/include-fixer/build
 // RUN: mkdir -p %T/include-fixer/src
-// RUN: sed 's|test_dir|%T/include-fixer|g' %S/Inputs/database_template.json > %T/include-fixer/build/compile_commands.json
+// RUN: sed 's|test_dir|%/T/include-fixer|g' %S/Inputs/database_template.json > %T/include-fixer/build/compile_commands.json
 // RUN: echo -e '#include "bar.h"\nb::a::bar f;' > %T/include-fixer/src/bar.cpp
 // RUN: echo 'namespace b { namespace a { class bar {}; } }' > %T/include-fixer/include/bar.h
 // RUN: cd %T/include-fixer/build
@@ -15,6 +14,6 @@
 // RUN: clang-include-fixer -db=yaml -input=%T/include-fixer/build/find_all_symbols.yaml -minimize-paths=true -p=. %T/include-fixer/src/bar.cpp
 // RUN: FileCheck -input-file=%T/include-fixer/src/bar.cpp %s
 
-// CHECK-YAML: ../include/bar.h
+// CHECK-YAML: ..{{[/\\]}}include{{[/\\]}}bar.h
 // CHECK: #include "bar.h"
 // CHECK: b::a::bar f;

Modified: clang-tools-extra/trunk/test/include-fixer/merge.test
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/include-fixer/merge.test?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/include-fixer/merge.test (original)
+++ clang-tools-extra/trunk/test/include-fixer/merge.test Tue Aug 16 11:07:46 2016
@@ -1,4 +1,3 @@
-# REQUIRES: shell
 # RUN: find-all-symbols -merge-dir=%S/Inputs/merge %t.merged
 # RUN: sed '/^#/d' %s > %t.golden
 # RUN: diff -u %t.golden %t.merged

Modified: clang-tools-extra/trunk/test/include-fixer/prefix_variable.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/include-fixer/prefix_variable.cpp?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/include-fixer/prefix_variable.cpp (original)
+++ clang-tools-extra/trunk/test/include-fixer/prefix_variable.cpp Tue Aug 16 11:07:46 2016
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: sed -e 's#//.*$##' %s > %t.cpp
 // RUN: clang-include-fixer -db=yaml -input=%p/Inputs/fake_yaml_db.yaml %t.cpp --
 // RUN: FileCheck %s -input-file=%t.cpp

Modified: clang-tools-extra/trunk/test/include-fixer/yamldb.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/include-fixer/yamldb.cpp?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/include-fixer/yamldb.cpp (original)
+++ clang-tools-extra/trunk/test/include-fixer/yamldb.cpp Tue Aug 16 11:07:46 2016
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: sed -e 's#//.*$##' %s > %t.cpp
 // RUN: clang-include-fixer -db=yaml -input=%p/Inputs/fake_yaml_db.yaml %t.cpp --
 // RUN: FileCheck %s -input-file=%t.cpp

Modified: clang-tools-extra/trunk/test/include-fixer/yamldb_autodetect.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/include-fixer/yamldb_autodetect.cpp?rev=278815&r1=278814&r2=278815&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/include-fixer/yamldb_autodetect.cpp (original)
+++ clang-tools-extra/trunk/test/include-fixer/yamldb_autodetect.cpp Tue Aug 16 11:07:46 2016
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: mkdir -p %T/foo/bar
 // RUN: cp %p/Inputs/fake_yaml_db.yaml %T/find_all_symbols_db.yaml
 // RUN: cd %T/foo




More information about the cfe-commits mailing list