[cfe-commits] [PATCH] clang/test/Tooling: Tweaks for Win32 hosts
Michael Spencer
bigcheesegs at gmail.com
Wed May 23 02:30:58 PDT 2012
On Tue, May 22, 2012 at 5:50 PM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
> They could pass also on msvc if they were -fms-compatibility tolerant.
>
> Manuel, I would be happier if you could tweak tests with -target i686-win32.
>
> ---
> clang/lib/Tooling/CompilationDatabase.cpp | 8 ++++++--
> clang/lib/Tooling/Tooling.cpp | 8 ++++++--
> clang/test/Tooling/clang-check-builtin-headers.cpp | 2 +-
> clang/test/Tooling/clang-check-chdir.cpp | 2 +-
> clang/test/Tooling/clang-check-pwd.cpp | 2 +-
> clang/test/Tooling/clang-check.cpp | 2 +-
> llvm/lib/Support/PathV2.cpp | 3 +++
> 7 files changed, 19 insertions(+), 8 deletions(-)
+ // FIXME: Does Win32 accept '.\\'?
Yes it does. Well, cmd.exe does.
diff --git a/clang/test/Tooling/clang-check-builtin-headers.cpp
b/clang/test/Tooling/clang-check-builtin-headers.cpp
index 4324dec..b640d05 100644
--- a/clang/test/Tooling/clang-check-builtin-headers.cpp
+++ b/clang/test/Tooling/clang-check-builtin-headers.cpp
@@ -1,7 +1,7 @@
// RUN: rm -rf %t
// RUN: mkdir %t
// Add a path that doesn't exist as argv[0] for the compile command line:
-// RUN: echo '[{"directory":".","command":"/random/tool -c
%t/test.cpp","file":"%t/test.cpp"}]' > %t/compile_commands.json
+// RUN: echo '[{"directory":".","command":"/random/tool -c
%t/test.cpp","file":"%t/test.cpp"}]' | sed -e 's/\\/\//g' >
%t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: clang-check "%t" "%t/test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
diff --git a/clang/test/Tooling/clang-check-chdir.cpp
b/clang/test/Tooling/clang-check-chdir.cpp
index 5d02c95..7c465f3 100644
--- a/clang/test/Tooling/clang-check-chdir.cpp
+++ b/clang/test/Tooling/clang-check-chdir.cpp
@@ -2,7 +2,7 @@
// compilation database.
// RUN: rm -rf %t
// RUN: mkdir %t
-// RUN: echo "[{\"directory\":\"%t\",\"command\":\"clang -c test.cpp
-I.\",\"file\":\"%t/test.cpp\"}]" > %t/compile_commands.json
+// RUN: echo "[{\"directory\":\"%t\",\"command\":\"clang -c test.cpp
-I.\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\//g' >
%t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: touch "%t/clang-check-test.h"
// RUN: clang-check "%t" "%t/test.cpp" 2>&1|FileCheck %s
diff --git a/clang/test/Tooling/clang-check-pwd.cpp
b/clang/test/Tooling/clang-check-pwd.cpp
index 96417df..40336cb 100644
--- a/clang/test/Tooling/clang-check-pwd.cpp
+++ b/clang/test/Tooling/clang-check-pwd.cpp
@@ -1,6 +1,6 @@
// RUN: rm -rf %t
// RUN: mkdir %t
-// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c
%t/test.cpp\",\"file\":\"%t/test.cpp\"}]" > %t/compile_commands.json
+// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c
%t/test.cpp\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\\\\/g' >
%t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: PWD="%t" clang-check "%t" "test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
diff --git a/clang/test/Tooling/clang-check.cpp
b/clang/test/Tooling/clang-check.cpp
index d197078..d37d14d 100644
--- a/clang/test/Tooling/clang-check.cpp
+++ b/clang/test/Tooling/clang-check.cpp
@@ -1,6 +1,6 @@
// RUN: rm -rf %t
// RUN: mkdir %t
-// RUN: echo '[{"directory":".","command":"clang++ -c
%t/test.cpp","file":"%t/test.cpp"}]' > %t/compile_commands.json
+// RUN: echo '[{"directory":".","command":"clang++ -c
%t/test.cpp","file":"%t/test.cpp"}]' | sed -e 's/\\/\//g' >
%t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: clang-check "%t" "%t/test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
For all these tests can we please not use sed? I'd like to get rid of
all dependencies on these tools so Windows can test without GNUWin32.
- Michael Spencer
More information about the cfe-commits
mailing list