|
| 1 | +# Test --build-dir option with --build and --exec modes |
| 2 | + |
| 3 | +# Test 1: --build with --build-dir to create a build in a custom location |
| 4 | +# RUN: rm -rf %t.SANDBOX %t.CUSTOM_BUILD |
| 5 | +# RUN: mkdir -p %t.CUSTOM_BUILD |
| 6 | +# RUN: lnt runtest test-suite \ |
| 7 | +# RUN: --sandbox %t.SANDBOX \ |
| 8 | +# RUN: --no-timestamp \ |
| 9 | +# RUN: --test-suite %S/Inputs/test-suite-cmake \ |
| 10 | +# RUN: --cc %{shared_inputs}/FakeCompilers/clang-r154331 \ |
| 11 | +# RUN: --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \ |
| 12 | +# RUN: --use-make %S/Inputs/test-suite-cmake/fake-make \ |
| 13 | +# RUN: --use-lit %S/Inputs/test-suite-cmake/fake-lit \ |
| 14 | +# RUN: --build \ |
| 15 | +# RUN: --build-dir %t.CUSTOM_BUILD/mybuild \ |
| 16 | +# RUN: > %t.build.log 2> %t.build.err |
| 17 | +# RUN: filecheck --check-prefix CHECK-BUILD-CUSTOM < %t.build.err %s |
| 18 | +# CHECK-BUILD-CUSTOM: Building tests (--build mode)... |
| 19 | +# CHECK-BUILD-CUSTOM: Build complete. Build directory: {{.*}}CUSTOM_BUILD/mybuild |
| 20 | +# CHECK-BUILD-CUSTOM: Use --exec --build-dir {{.*}}CUSTOM_BUILD/mybuild to run tests. |
| 21 | + |
| 22 | +# Verify that build files were created in the custom location |
| 23 | +# RUN: test -f %t.CUSTOM_BUILD/mybuild/CMakeCache.txt |
| 24 | + |
| 25 | +# Test 2: --exec with --build-dir using the custom build location |
| 26 | +# RUN: lnt runtest test-suite \ |
| 27 | +# RUN: --sandbox %t.SANDBOX \ |
| 28 | +# RUN: --no-timestamp \ |
| 29 | +# RUN: --exec \ |
| 30 | +# RUN: --build-dir %t.CUSTOM_BUILD/mybuild \ |
| 31 | +# RUN: --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \ |
| 32 | +# RUN: --use-lit %S/Inputs/test-suite-cmake/fake-lit \ |
| 33 | +# RUN: --output %t.exec.report \ |
| 34 | +# RUN: > %t.exec.log 2> %t.exec.err |
| 35 | +# RUN: filecheck --check-prefix CHECK-EXEC-CUSTOM < %t.exec.err %s |
| 36 | +# CHECK-EXEC-CUSTOM-NOT: Configuring |
| 37 | +# CHECK-EXEC-CUSTOM-NOT: Building |
| 38 | +# CHECK-EXEC-CUSTOM: Testing |
| 39 | + |
| 40 | +# Verify that report was created in the custom build directory |
| 41 | +# RUN: test -f %t.CUSTOM_BUILD/mybuild/report.json |
| 42 | + |
| 43 | +# Test 3: Error case - --exec with --build-dir pointing to non-existent directory should fail |
| 44 | +# RUN: not lnt runtest test-suite \ |
| 45 | +# RUN: --sandbox %t.SANDBOX \ |
| 46 | +# RUN: --no-timestamp \ |
| 47 | +# RUN: --exec \ |
| 48 | +# RUN: --build-dir %t.NONEXISTENT \ |
| 49 | +# RUN: --use-lit %S/Inputs/test-suite-cmake/fake-lit \ |
| 50 | +# RUN: > %t.err1.log 2> %t.err1.err |
| 51 | +# RUN: filecheck --check-prefix CHECK-ERR-NONEXISTENT < %t.err1.err %s |
| 52 | +# CHECK-ERR-NONEXISTENT: --build-dir does not exist |
| 53 | + |
| 54 | +# Test 4: Error case - --exec with --build-dir pointing to unconfigured directory should fail |
| 55 | +# RUN: rm -rf %t.UNCONFIGURED |
| 56 | +# RUN: mkdir -p %t.UNCONFIGURED |
| 57 | +# RUN: not lnt runtest test-suite \ |
| 58 | +# RUN: --sandbox %t.SANDBOX \ |
| 59 | +# RUN: --no-timestamp \ |
| 60 | +# RUN: --exec \ |
| 61 | +# RUN: --build-dir %t.UNCONFIGURED \ |
| 62 | +# RUN: --use-lit %S/Inputs/test-suite-cmake/fake-lit \ |
| 63 | +# RUN: > %t.err2.log 2> %t.err2.err |
| 64 | +# RUN: filecheck --check-prefix CHECK-ERR-UNCONFIGURED < %t.err2.err %s |
| 65 | +# CHECK-ERR-UNCONFIGURED: --build-dir is not a configured build |
0 commit comments