Browse Source

[lit] Move ls *.pdb to unique directory. (#5254)

* [lit] Move ls *.pdb to unique directory

Avoid check *.pdb by moving ls *.pdb to unique directory.
This will fix the random failure caused by entangled with pdb output of other tests.
Xiang Li 2 years ago
parent
commit
19c32587be

+ 5 - 1
tools/clang/test/DXC/embed_dbg.test

@@ -1,8 +1,12 @@
 // Embed debug info
 // Embed debug info
+
+// NOTE: cd into unique directory to avoid ls *.pdb affected by pdb files generated by other tests.
+// RUN: mkdir -p %T/embed_dbg && cd %T/embed_dbg
 // RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl /Zi /Qembed_debug /Fo %t.embedpdb
 // RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl /Zi /Qembed_debug /Fo %t.embedpdb
 // RUN: %dxc -dumpbin %t.embedpdb | FileCheck  %s --check-prefix=EMBED_PDB
 // RUN: %dxc -dumpbin %t.embedpdb | FileCheck  %s --check-prefix=EMBED_PDB
 
 
-// RUN: ls -1 %T | not grep "\\.pdb$"
+// Make sure the pdb file not exist with /Zi /Qembed_debug.
+// RUN: ls -1 %T/embed_dbg | not grep "\\.pdb$"
 
 
 // Auto-embed debug info when no debug output, and expect warning signifying that this is the case.
 // Auto-embed debug info when no debug output, and expect warning signifying that this is the case.
 // RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl  /Zi /Fo %t.embedpdb2 /Fe %t.err.embedpdb
 // RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl  /Zi /Fo %t.embedpdb2 /Fe %t.err.embedpdb

+ 1 - 1
tools/clang/test/DXC/fd_zs.test

@@ -1,7 +1,7 @@
 // /Fd plus /Zs
 // /Fd plus /Zs
 // RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl /Zs /Fd %t.pdb /Fo %t.dxo_fd
 // RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl /Zs /Fd %t.pdb /Fo %t.dxo_fd
 
 
-// RUN:FileCheck --input-file=%t.pdb %s --check-prefix=PDB && rm %t.pdb
+// RUN:FileCheck --input-file=%t.pdb %s --check-prefix=PDB
 // Make sure PDB not empty.
 // Make sure PDB not empty.
 // PDB:{{.+}}
 // PDB:{{.+}}
 // RUN:FileCheck --input-file=%t.dxo_fd %s --check-prefix=FD_FO
 // RUN:FileCheck --input-file=%t.dxo_fd %s --check-prefix=FD_FO

+ 1 - 1
tools/clang/test/DXC/recompile.test

@@ -15,7 +15,7 @@
 // RUN: %dxc -dumpbin %t.recompiled.pdb | FileCheck %s --check-prefix=RECOMPILE_PDB
 // RUN: %dxc -dumpbin %t.recompiled.pdb | FileCheck %s --check-prefix=RECOMPILE_PDB
 // RECOMPILE_PDB:DICompileUnit
 // RECOMPILE_PDB:DICompileUnit
 // RUN: %dxc %t.recompiled.pdb  /recompile > %t.recompiled.pdb.ll
 // RUN: %dxc %t.recompiled.pdb  /recompile > %t.recompiled.pdb.ll
-// RUN: %dxc %t.recompiled.pdb /recompile /T ps_6_0 /E main && rm %t.recompiled.pdb
+// RUN: %dxc %t.recompiled.pdb /recompile /T ps_6_0 /E main
 
 
 
 
 // Command-line Defines, Recompile
 // Command-line Defines, Recompile

+ 8 - 2
tools/clang/test/DXC/strip_dbg.test

@@ -1,7 +1,13 @@
 // /Fd implies /Qstrip_debug ; path with / produces auto hash-named .pdb file
 // /Fd implies /Qstrip_debug ; path with / produces auto hash-named .pdb file
-// RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl /Zi /Fd ./ /Fo %t.strip
+
+// NOTE: cd into unique directory to avoid ls *.pdb affected by pdb files generated by other tests.
+// RUN: mkdir -p %T/strip_dbg && cd %T/strip_dbg
+
+// RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl /Zi -Zss /Fd %T/strip_dbg/ /Fo %t.strip
 // RUN: %dxc -dumpbin %t.strip | FileCheck  %s --check-prefix=STRIP_DBG
 // RUN: %dxc -dumpbin %t.strip | FileCheck  %s --check-prefix=STRIP_DBG
-// RUN: ls *.pdb && rm *.pdb
+
+// Make sure the pdb file exist.
+// RUN: ls -1 %T/strip_dbg | grep "\\.pdb$" | count 1
 
 
 // /Zi with /Qstrip_debug and no output should not embed
 // /Zi with /Qstrip_debug and no output should not embed
 // RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl /Zi /Qstrip_debug /Fo %t.strip2
 // RUN: %dxc /T ps_6_0 %S/Inputs/smoke.hlsl /Zi /Qstrip_debug /Fo %t.strip2