| 
 | 1 | +# Check --drop-exec feature for filtering execution samples  | 
 | 2 | +# This test verifies that --drop-exec correctly drops first N execution samples  | 
 | 3 | + | 
 | 4 | +# Test 1: --drop-exec without --exec-multisample should fail  | 
 | 5 | +# RUN: not lnt runtest test-suite \  | 
 | 6 | +# RUN:     --sandbox %t.SANDBOX-ERR1 \  | 
 | 7 | +# RUN:     --no-timestamp \  | 
 | 8 | +# RUN:     --test-suite %S/Inputs/test-suite-cmake \  | 
 | 9 | +# RUN:     --cc %{shared_inputs}/FakeCompilers/clang-r154331 \  | 
 | 10 | +# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \  | 
 | 11 | +# RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \  | 
 | 12 | +# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \  | 
 | 13 | +# RUN:     --drop-exec 1 \  | 
 | 14 | +# RUN:     > %t.err1.log 2> %t.err1.err  | 
 | 15 | +# RUN: filecheck --check-prefix CHECK-ERR1 < %t.err1.err %s  | 
 | 16 | +# CHECK-ERR1: --drop-exec requires --exec-multisample > 1  | 
 | 17 | + | 
 | 18 | +# Test 2: --drop-exec with --only-compile should fail  | 
 | 19 | +# RUN: not lnt runtest test-suite \  | 
 | 20 | +# RUN:     --sandbox %t.SANDBOX-ERR2 \  | 
 | 21 | +# RUN:     --no-timestamp \  | 
 | 22 | +# RUN:     --test-suite %S/Inputs/test-suite-cmake \  | 
 | 23 | +# RUN:     --cc %{shared_inputs}/FakeCompilers/clang-r154331 \  | 
 | 24 | +# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \  | 
 | 25 | +# RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \  | 
 | 26 | +# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \  | 
 | 27 | +# RUN:     --only-compile \  | 
 | 28 | +# RUN:     --drop-exec 1 \  | 
 | 29 | +# RUN:     > %t.err2.log 2> %t.err2.err  | 
 | 30 | +# RUN: filecheck --check-prefix CHECK-ERR2 < %t.err2.err %s  | 
 | 31 | +# CHECK-ERR2: --drop-exec cannot be used with --only-compile  | 
 | 32 | + | 
 | 33 | +# Test 3: --drop-exec with --build should fail  | 
 | 34 | +# RUN: not lnt runtest test-suite \  | 
 | 35 | +# RUN:     --sandbox %t.SANDBOX-ERR3 \  | 
 | 36 | +# RUN:     --no-timestamp \  | 
 | 37 | +# RUN:     --test-suite %S/Inputs/test-suite-cmake \  | 
 | 38 | +# RUN:     --cc %{shared_inputs}/FakeCompilers/clang-r154331 \  | 
 | 39 | +# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \  | 
 | 40 | +# RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \  | 
 | 41 | +# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \  | 
 | 42 | +# RUN:     --build \  | 
 | 43 | +# RUN:     --drop-exec 1 \  | 
 | 44 | +# RUN:     > %t.err3.log 2> %t.err3.err  | 
 | 45 | +# RUN: filecheck --check-prefix CHECK-ERR3 < %t.err3.err %s  | 
 | 46 | +# CHECK-ERR3: --drop-exec cannot be used with --build  | 
 | 47 | + | 
 | 48 | +# Test 4: --drop-exec dropping all samples should fail  | 
 | 49 | +# RUN: not lnt runtest test-suite \  | 
 | 50 | +# RUN:     --sandbox %t.SANDBOX-ERR4 \  | 
 | 51 | +# RUN:     --no-timestamp \  | 
 | 52 | +# RUN:     --test-suite %S/Inputs/test-suite-cmake \  | 
 | 53 | +# RUN:     --cc %{shared_inputs}/FakeCompilers/clang-r154331 \  | 
 | 54 | +# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \  | 
 | 55 | +# RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \  | 
 | 56 | +# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \  | 
 | 57 | +# RUN:     --exec-multisample 2 \  | 
 | 58 | +# RUN:     --drop-exec 2 \  | 
 | 59 | +# RUN:     > %t.err4.log 2> %t.err4.err  | 
 | 60 | +# RUN: filecheck --check-prefix CHECK-ERR4 < %t.err4.err %s  | 
 | 61 | +# CHECK-ERR4: --drop-exec would drop all 2 samples  | 
 | 62 | + | 
 | 63 | +# Test 5: --drop-exec 1 with 3 samples should work  | 
 | 64 | +# RUN: rm -rf %t.SANDBOX-DROP1  | 
 | 65 | +# RUN: lnt runtest test-suite \  | 
 | 66 | +# RUN:     --sandbox %t.SANDBOX-DROP1 \  | 
 | 67 | +# RUN:     --no-timestamp \  | 
 | 68 | +# RUN:     --test-suite %S/Inputs/test-suite-cmake \  | 
 | 69 | +# RUN:     --cc %{shared_inputs}/FakeCompilers/clang-r154331 \  | 
 | 70 | +# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \  | 
 | 71 | +# RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \  | 
 | 72 | +# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \  | 
 | 73 | +# RUN:     --exec-multisample 3 \  | 
 | 74 | +# RUN:     --drop-exec 1 \  | 
 | 75 | +# RUN:     --output %t.drop1.json \  | 
 | 76 | +# RUN:     > %t.drop1.log 2> %t.drop1.err  | 
 | 77 | +# RUN: filecheck --check-prefix CHECK-DROP1 < %t.drop1.err %s  | 
 | 78 | +# CHECK-DROP1: Dropping first execution sample (iteration 0)  | 
 | 79 | +# CHECK-DROP1: Kept 2 of 3 execution samples after --drop-exec filtering  | 
 | 80 | + | 
 | 81 | +# Test 6: --drop-exec 2 with 5 samples should work  | 
 | 82 | +# RUN: rm -rf %t.SANDBOX-DROP2  | 
 | 83 | +# RUN: lnt runtest test-suite \  | 
 | 84 | +# RUN:     --sandbox %t.SANDBOX-DROP2 \  | 
 | 85 | +# RUN:     --no-timestamp \  | 
 | 86 | +# RUN:     --test-suite %S/Inputs/test-suite-cmake \  | 
 | 87 | +# RUN:     --cc %{shared_inputs}/FakeCompilers/clang-r154331 \  | 
 | 88 | +# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \  | 
 | 89 | +# RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \  | 
 | 90 | +# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \  | 
 | 91 | +# RUN:     --exec-multisample 5 \  | 
 | 92 | +# RUN:     --drop-exec 2 \  | 
 | 93 | +# RUN:     --output %t.drop2.json \  | 
 | 94 | +# RUN:     > %t.drop2.log 2> %t.drop2.err  | 
 | 95 | +# RUN: filecheck --check-prefix CHECK-DROP2 < %t.drop2.err %s  | 
 | 96 | +# CHECK-DROP2: Dropping first 2 execution samples (iterations 0-1)  | 
 | 97 | +# CHECK-DROP2: Kept 3 of 5 execution samples after --drop-exec filtering  | 
 | 98 | + | 
 | 99 | +# Test 7: --drop-exec with test-prebuilt mode  | 
 | 100 | +# First build  | 
 | 101 | +# RUN: rm -rf %t.SANDBOX-BUILD-PREBUILT  | 
 | 102 | +# RUN: lnt runtest test-suite \  | 
 | 103 | +# RUN:     --sandbox %t.SANDBOX-BUILD-PREBUILT \  | 
 | 104 | +# RUN:     --no-timestamp \  | 
 | 105 | +# RUN:     --test-suite %S/Inputs/test-suite-cmake \  | 
 | 106 | +# RUN:     --cc %{shared_inputs}/FakeCompilers/clang-r154331 \  | 
 | 107 | +# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \  | 
 | 108 | +# RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \  | 
 | 109 | +# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \  | 
 | 110 | +# RUN:     --build \  | 
 | 111 | +# RUN:     > %t.build-prebuilt.log 2> %t.build-prebuilt.err  | 
 | 112 | + | 
 | 113 | +# Now test prebuilt with --drop-exec  | 
 | 114 | +# RUN: rm -rf %t.SANDBOX-PREBUILT-TEST  | 
 | 115 | +# RUN: lnt runtest test-suite \  | 
 | 116 | +# RUN:     --sandbox %t.SANDBOX-PREBUILT-TEST \  | 
 | 117 | +# RUN:     --no-timestamp \  | 
 | 118 | +# RUN:     --exec \  | 
 | 119 | +# RUN:     --build-dir %t.SANDBOX-BUILD-PREBUILT/build \  | 
 | 120 | +# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \  | 
 | 121 | +# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \  | 
 | 122 | +# RUN:     --exec-multisample 3 \  | 
 | 123 | +# RUN:     --drop-exec 1 \  | 
 | 124 | +# RUN:     --output %t.prebuilt-drop.json \  | 
 | 125 | +# RUN:     > %t.prebuilt-drop.log 2> %t.prebuilt-drop.err  | 
 | 126 | +# RUN: filecheck --check-prefix CHECK-PREBUILT-DROP < %t.prebuilt-drop.err %s  | 
 | 127 | +# CHECK-PREBUILT-DROP: Dropping first execution sample (iteration 0)  | 
 | 128 | +# CHECK-PREBUILT-DROP: Kept 2 of 3 execution samples after --drop-exec filtering  | 
0 commit comments