|
| 1 | +Description: Fix integration tests to use correct package path |
| 2 | + Remove hardcoded usr paths and pass the correct package path to |
| 3 | + the tests. |
| 4 | +Author: Julien Blache < [email protected]> |
| 5 | + |
| 6 | +Index: swiftlang-5.6.0/swift-integration-tests/lit.cfg |
| 7 | +=================================================================== |
| 8 | +--- swiftlang-5.6.0.orig/swift-integration-tests/lit.cfg |
| 9 | ++++ swiftlang-5.6.0/swift-integration-tests/lit.cfg |
| 10 | +@@ -175,31 +175,31 @@ else: |
| 11 | + |
| 12 | + swift_path = lit_config.params.get( |
| 13 | + "swift", |
| 14 | +- os.path.join(package_path, "usr", "bin", "swift")) |
| 15 | ++ os.path.join(package_path, "bin", "swift")) |
| 16 | + lit_config.note("testing using 'swift': %r" % (swift_path,)) |
| 17 | + |
| 18 | + swiftc_path = lit_config.params.get( |
| 19 | + "swiftc", |
| 20 | +- os.path.join(package_path, "usr", "bin", "swiftc")) |
| 21 | ++ os.path.join(package_path, "bin", "swiftc")) |
| 22 | + lit_config.note("testing using 'swiftc': %r" % (swiftc_path,)) |
| 23 | + |
| 24 | + lldb_path = lit_config.params.get( |
| 25 | + "lldb", |
| 26 | +- os.path.join(package_path, "usr", "bin", "lldb")) |
| 27 | ++ os.path.join(package_path, "bin", "lldb")) |
| 28 | + lit_config.note("testing using 'lldb': {}".format(lldb_path)) |
| 29 | + |
| 30 | + repl_swift_dummy_path = lit_config.params.get( |
| 31 | + "repl_swift", |
| 32 | +- os.path.join(package_path, "usr", "bin", "repl_swift")) |
| 33 | ++ os.path.join(package_path, "bin", "repl_swift")) |
| 34 | + lit_config.note("testing using 'repl_swift': {}".format(repl_swift_dummy_path)) |
| 35 | + |
| 36 | + sourcekit_lsp_path = lit_config.params.get( |
| 37 | + "sourcekit-lsp", |
| 38 | +- os.path.join(package_path, "usr", "bin", "sourcekit-lsp")) |
| 39 | ++ os.path.join(package_path, "bin", "sourcekit-lsp")) |
| 40 | + |
| 41 | + docc_path = lit_config.params.get( |
| 42 | + "docc", |
| 43 | +- os.path.join(package_path, "usr", "bin", "docc")) |
| 44 | ++ os.path.join(package_path, "bin", "docc")) |
| 45 | + lit_config.note("testing using 'docc': {}".format(docc_path)) |
| 46 | + |
| 47 | + # Verify they exist. |
| 48 | +Index: swiftlang-5.6.0/swift-integration-tests/test-snapshot-binaries/test-rpath-linux.py |
| 49 | +=================================================================== |
| 50 | +--- swiftlang-5.6.0.orig/swift-integration-tests/test-snapshot-binaries/test-rpath-linux.py |
| 51 | ++++ swiftlang-5.6.0/swift-integration-tests/test-snapshot-binaries/test-rpath-linux.py |
| 52 | +@@ -4,26 +4,26 @@ |
| 53 | + # CHECK: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}$ORIGIN/../lib/swift/linux |
| 54 | + # |
| 55 | + # Tests that DT_RUNPATH is correct for the Swift stdlib and other libraries on Linux. |
| 56 | +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftCore.so | %{FileCheck} --check-prefix CHECK-CORE %s |
| 57 | ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftCore.so | %{FileCheck} --check-prefix CHECK-CORE %s |
| 58 | + # CHECK-CORE-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux |
| 59 | + # |
| 60 | +-# RUN: %{readelf} -d %{package_path}/usr/lib/libsourcekitdInProc.so | %{FileCheck} --check-prefix CHECK-SK %s |
| 61 | ++# RUN: %{readelf} -d %{package_path}/lib/libsourcekitdInProc.so | %{FileCheck} --check-prefix CHECK-SK %s |
| 62 | + # CHECK-SK-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux |
| 63 | + # |
| 64 | +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftRemoteMirror.so | %{FileCheck} --check-prefix CHECK-RM %s |
| 65 | ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftRemoteMirror.so | %{FileCheck} --check-prefix CHECK-RM %s |
| 66 | + # CHECK-RM-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux |
| 67 | + # |
| 68 | +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswift_Differentiation.so | %{FileCheck} --check-prefix CHECK-SD %s |
| 69 | ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswift_Differentiation.so | %{FileCheck} --check-prefix CHECK-SD %s |
| 70 | + # CHECK-SD-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux |
| 71 | + # |
| 72 | +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/lib_InternalSwiftSyntaxParser.so | %{FileCheck} --check-prefix CHECK-SP %s |
| 73 | ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/lib_InternalSwiftSyntaxParser.so | %{FileCheck} --check-prefix CHECK-SP %s |
| 74 | + # CHECK-SP-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux |
| 75 | + # |
| 76 | +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftGlibc.so | %{FileCheck} --check-prefix CHECK-SG %s |
| 77 | ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftGlibc.so | %{FileCheck} --check-prefix CHECK-SG %s |
| 78 | + # CHECK-SG-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux |
| 79 | + # |
| 80 | +-# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftSwiftOnoneSupport.so | %{FileCheck} --check-prefix CHECK-SON %s |
| 81 | ++# RUN: %{readelf} -d %{package_path}/lib/swift/linux/libswiftSwiftOnoneSupport.so | %{FileCheck} --check-prefix CHECK-SON %s |
| 82 | + # CHECK-SON-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux |
| 83 | + # |
| 84 | +-# RUN: %{readelf} -d %{package_path}/usr/lib/libswiftDemangle.so | %{FileCheck} --check-prefix CHECK-SDE %s |
| 85 | ++# RUN: %{readelf} -d %{package_path}/lib/libswiftDemangle.so | %{FileCheck} --check-prefix CHECK-SDE %s |
| 86 | + # CHECK-SDE-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux |
| 87 | +Index: swiftlang-5.6.0/swift/utils/build-script-impl |
| 88 | +=================================================================== |
| 89 | +--- swiftlang-5.6.0.orig/swift/utils/build-script-impl |
| 90 | ++++ swiftlang-5.6.0/swift/utils/build-script-impl |
| 91 | +@@ -3463,8 +3463,10 @@ function build_and_test_installable_pack |
| 92 | + |
| 93 | + if [[ "${host}" == "macosx-"* ]] || [[ "${host}" == "merged-hosts" ]]; then |
| 94 | + PKG_TESTS_SANDBOX="${PKG_TESTS_SANDBOX_PARENT}"/"${TOOLCHAIN_PREFIX}" |
| 95 | ++ PKG_TESTS_PKG_DIR="${PKG_TESTS_SANDBOX}" |
| 96 | + else # Linux |
| 97 | + PKG_TESTS_SANDBOX="${PKG_TESTS_SANDBOX_PARENT}" |
| 98 | ++ PKG_TESTS_PKG_DIR="${PKG_TESTS_SANDBOX}/${host_install_prefix}" |
| 99 | + fi |
| 100 | + |
| 101 | + LIT_EXECUTABLE_PATH="${LLVM_SOURCE_DIR}/utils/lit/lit.py" |
| 102 | +@@ -3479,7 +3481,7 @@ function build_and_test_installable_pack |
| 103 | + TIMEOUT_ARGS=--timeout=1200 # 20 minutes |
| 104 | + fi |
| 105 | + with_pushd "${PKG_TESTS_SOURCE_DIR}" \ |
| 106 | +- call python3 "${LIT_EXECUTABLE_PATH}" . -sv --param package-path="${PKG_TESTS_SANDBOX}" --param test-exec-root="${PKG_TESTS_TEMPS}" --param llvm-bin-dir="${LLVM_BIN_DIR}" ${TIMEOUT_ARGS} |
| 107 | ++ call python3 "${LIT_EXECUTABLE_PATH}" . -sv --param package-path="${PKG_TESTS_PKG_DIR}" --param test-exec-root="${PKG_TESTS_TEMPS}" --param llvm-bin-dir="${LLVM_BIN_DIR}" ${TIMEOUT_ARGS} |
| 108 | + fi |
| 109 | + fi |
| 110 | + } |
0 commit comments