diff options
author | Zachary Turner <zturner@google.com> | 2017-06-30 16:01:30 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-06-30 16:01:30 +0000 |
commit | 5a321ee929f41e6ab136995f11c2d4e48e625077 (patch) | |
tree | dcd246108322f187d458b343ebe5cc85bb785cab /test | |
parent | 333b6cb76040b4d32705e1f16f96d18b2ad7e4d5 (diff) |
[lit] Clean output directories before running tests.
Presently lit leaks files in the tests' output directories.
Specifically, if a test creates output files, lit makes no
effort to remove them prior to the next test run. This is
problematic because it leads to false positives whenever a
test passes because stale files were present. In general
it is a source of flakiness that should be removed.
This patch addresses this by building the list of all test
directories that are part of the current run set, and then
deleting those directories and recreating them anew. This
gives each test a clean baseline to start from.
Differential Revision: https://reviews.llvm.org/D34732
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306832 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.cpp | 7 | ||||
-rw-r--r-- | test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.dwo | bin | 1056 -> 1056 bytes | |||
-rw-r--r-- | test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.o | bin | 2968 -> 3360 bytes | |||
-rw-r--r-- | test/DebugInfo/Inputs/split-dwarf-multiple-cu.dwo | bin | 1040 -> 1168 bytes | |||
-rw-r--r-- | test/DebugInfo/Inputs/split-dwarf-multiple-cu.o | bin | 2992 -> 3728 bytes | |||
-rw-r--r-- | test/DebugInfo/Inputs/split-dwarf-multiple-cu1.cpp | 2 | ||||
-rw-r--r-- | test/DebugInfo/Inputs/split-dwarf-multiple-cu2.cpp | 7 | ||||
-rwxr-xr-x | test/DebugInfo/Inputs/split-dwarf-test | bin | 9208 -> 9624 bytes | |||
-rw-r--r-- | test/DebugInfo/Inputs/split-dwarf-test.dwo | bin | 1377 -> 1088 bytes | |||
-rw-r--r-- | test/DebugInfo/llvm-symbolizer.test | 8 | ||||
-rw-r--r-- | test/Other/lit-globbing.ll | 56 | ||||
-rw-r--r-- | test/Unit/lit.cfg | 8 |
12 files changed, 53 insertions, 35 deletions
diff --git a/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.cpp b/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.cpp new file mode 100644 index 00000000000..d7361f475a2 --- /dev/null +++ b/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.cpp @@ -0,0 +1,7 @@ +void f1(); +__attribute__((always_inline)) void f2() { + f1(); +} +void f3() { + f2(); +} diff --git a/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.dwo b/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.dwo Binary files differindex 2a3bc57caa6..44bdaf4bffe 100644 --- a/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.dwo +++ b/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.dwo diff --git a/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.o b/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.o Binary files differindex b6993c6cae2..540302785c2 100644 --- a/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.o +++ b/test/DebugInfo/Inputs/split-dwarf-addr-object-relocation.o diff --git a/test/DebugInfo/Inputs/split-dwarf-multiple-cu.dwo b/test/DebugInfo/Inputs/split-dwarf-multiple-cu.dwo Binary files differindex 4df9894b089..94cc3e9d0f7 100644 --- a/test/DebugInfo/Inputs/split-dwarf-multiple-cu.dwo +++ b/test/DebugInfo/Inputs/split-dwarf-multiple-cu.dwo diff --git a/test/DebugInfo/Inputs/split-dwarf-multiple-cu.o b/test/DebugInfo/Inputs/split-dwarf-multiple-cu.o Binary files differindex aa4ab4bc76f..dd0cda4a8ff 100644 --- a/test/DebugInfo/Inputs/split-dwarf-multiple-cu.o +++ b/test/DebugInfo/Inputs/split-dwarf-multiple-cu.o diff --git a/test/DebugInfo/Inputs/split-dwarf-multiple-cu1.cpp b/test/DebugInfo/Inputs/split-dwarf-multiple-cu1.cpp new file mode 100644 index 00000000000..9bed4bf8b5e --- /dev/null +++ b/test/DebugInfo/Inputs/split-dwarf-multiple-cu1.cpp @@ -0,0 +1,2 @@ +extern int i; +int i; diff --git a/test/DebugInfo/Inputs/split-dwarf-multiple-cu2.cpp b/test/DebugInfo/Inputs/split-dwarf-multiple-cu2.cpp new file mode 100644 index 00000000000..1d17cf38037 --- /dev/null +++ b/test/DebugInfo/Inputs/split-dwarf-multiple-cu2.cpp @@ -0,0 +1,7 @@ +void f1(); +inline __attribute__((always_inline)) void f2() { + f1(); +} +void f3() { + f2(); +} diff --git a/test/DebugInfo/Inputs/split-dwarf-test b/test/DebugInfo/Inputs/split-dwarf-test Binary files differindex 4d6aa0cd98a..0e9d4c880bb 100755 --- a/test/DebugInfo/Inputs/split-dwarf-test +++ b/test/DebugInfo/Inputs/split-dwarf-test diff --git a/test/DebugInfo/Inputs/split-dwarf-test.dwo b/test/DebugInfo/Inputs/split-dwarf-test.dwo Binary files differindex 588374d7d21..fb5eb9c0ffa 100644 --- a/test/DebugInfo/Inputs/split-dwarf-test.dwo +++ b/test/DebugInfo/Inputs/split-dwarf-test.dwo diff --git a/test/DebugInfo/llvm-symbolizer.test b/test/DebugInfo/llvm-symbolizer.test index 2c64804659f..49da075a451 100644 --- a/test/DebugInfo/llvm-symbolizer.test +++ b/test/DebugInfo/llvm-symbolizer.test @@ -20,8 +20,8 @@ RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input RUN: cp %p/Inputs/split-dwarf-test.dwo %T -RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input -RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input +RUN: echo "%p/Inputs/split-dwarf-test 0x400504" >> %t.input +RUN: echo "%p/Inputs/split-dwarf-test 0x4004f0" >> %t.input RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input RUN: cp %p/Inputs/split-dwarf-multiple-cu.dwo %T RUN: echo "%p/Inputs/split-dwarf-multiple-cu.o 0x4" >> %t.input @@ -141,9 +141,9 @@ CHECK-NEXT: main CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0 CHECK: f2 -CHECK-NEXT: b.cpp:3:3 +CHECK-NEXT: split-dwarf-multiple-cu2.cpp:3:3 CHECK-NEXT: f3 -CHECK-NEXT: b.cpp:6:0 +CHECK-NEXT: split-dwarf-multiple-cu2.cpp:6:0 CHECK: f2 CHECK-NEXT: split-dwarf-addr-object-relocation.cpp:3:3 diff --git a/test/Other/lit-globbing.ll b/test/Other/lit-globbing.ll index 5a668a90a40..b60510ab8b2 100644 --- a/test/Other/lit-globbing.ll +++ b/test/Other/lit-globbing.ll @@ -1,28 +1,28 @@ -RUN: echo TA > %T/TA.txt
-RUN: echo TB > %T/TB.txt
-RUN: echo TAB > %T/TAB.txt
-
-RUN: echo %T/TA* | FileCheck -check-prefix=STAR %s
-RUN: echo %T/'TA'* | FileCheck -check-prefix=STAR %s
-RUN: echo %T/T'A'* | FileCheck -check-prefix=STAR %s
-
-RUN: echo %T/T?.txt | FileCheck -check-prefix=QUESTION %s
-RUN: echo %T/'T'?.txt | FileCheck -check-prefix=QUESTION %s
-
-RUN: echo %T/T??.txt | FileCheck -check-prefix=QUESTION2 %s
-RUN: echo %T/'T'??.txt | FileCheck -check-prefix=QUESTION2 %s
-
-RUN: echo 'T*' 'T?.txt' 'T??.txt' | FileCheck -check-prefix=QUOTEDARGS %s
-
-STAR-NOT: TB.txt
-STAR: {{(TA.txt.*TAB.txt|TAB.txt.*TA.txt)}}
-
-QUESTION-NOT: TAB.txt
-QUESTION: {{(TA.txt.*TB.txt|TB.txt.*TA.txt)}}
-
-QUESTION2-NOT: TA.txt
-QUESTION2-NOT: TB.txt
-QUESTION2: TAB.txt
-
-QUOTEDARGS-NOT: .txt
-QUOTEDARGS: T* T?.txt T??.txt
+RUN: echo XXA > %T/XXA.txt +RUN: echo XXB > %T/XXB.txt +RUN: echo XXAB > %T/XXAB.txt + +RUN: echo %T/XXA* | FileCheck -check-prefix=STAR %s +RUN: echo %T/'XXA'* | FileCheck -check-prefix=STAR %s +RUN: echo %T/XX'A'* | FileCheck -check-prefix=STAR %s + +RUN: echo %T/XX?.txt | FileCheck -check-prefix=QUESTION %s +RUN: echo %T/'XX'?.txt | FileCheck -check-prefix=QUESTION %s + +RUN: echo %T/XX??.txt | FileCheck -check-prefix=QUESTION2 %s +RUN: echo %T/'XX'??.txt | FileCheck -check-prefix=QUESTION2 %s + +RUN: echo 'XX*' 'XX?.txt' 'XX??.txt' | FileCheck -check-prefix=QUOTEDARGS %s + +STAR-NOT: XXB.txt +STAR: {{(XXA.txt.*XXAB.txt|XXAB.txt.*XXA.txt)}} + +QUESTION-NOT: XXAB.txt +QUESTION: {{(XXA.txt.*XXB.txt|XXB.txt.*XXA.txt)}} + +QUESTION2-NOT: XXA.txt +QUESTION2-NOT: XXB.txt +QUESTION2: XXAB.txt + +QUOTEDARGS-NOT: .txt +QUOTEDARGS: XX* XX?.txt XX??.txt diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg index dac0bf829ba..a3c00d6d18c 100644 --- a/test/Unit/lit.cfg +++ b/test/Unit/lit.cfg @@ -39,9 +39,11 @@ for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']: config.environment[symbolizer] = os.environ[symbolizer] # Win32 seeks DLLs along %PATH%. -if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir): - config.environment['PATH'] = os.path.pathsep.join(( - config.shlibdir, config.environment['PATH'])) +if sys.platform in ['win32', 'cygwin']: + shlibdir = getattr(config, 'shlibdir', None) + if shlibdir is not None and os.path.isdir(shlibdir): + config.environment['PATH'] = os.path.pathsep.join(( + config.shlibdir, config.environment['PATH'])) # Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate. if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ: |