Files
swift-mirror/validation-test/execution/dsohandle-multi-module.swift
3405691582 e81534960c [validation] Fix some portability test issues.
Here we fix a few portability issues affecting running the validation tests on OpenBSD. The remaining failures will be dealt with separately.

1. In the `rth` tool, ensure `-z origin` is specified to the linker when
   using `$ORIGIN`, as required on this platform.

2. Explicitly set the rpath in the `dsohandle-multi-module` execution
   test, since the test uses built dynamic libraries during the test.

3. Erase the environment variable instead of using `env -u`, the latter
   of which is not portable.
2021-02-06 16:36:44 -05:00

28 lines
941 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift-dylib(%t/%target-library-name(first)) %S/Inputs/dsohandle-first.swift -emit-module -module-name first
// RUN: %target-build-swift-dylib(%t/%target-library-name(second)) %S/Inputs/dsohandle-second.swift -emit-module -module-name second
// RUN: %target-build-swift -I %t -L %t -lfirst -lsecond %s -o %t/main %target-rpath(%t)
// RUN: %target-codesign %t/main %t/%target-library-name(first) %t/%target-library-name(second)
// RUN: %target-run %t/main %t/%target-library-name(first) %t/%target-library-name(second)
// REQUIRES: executable_test
// UNSUPPORTED: linux
// XFAIL: windows
import first
import second
import StdlibUnittest
let DSOHandleTests = TestSuite("DSOHandle")
DSOHandleTests.test("Unique handles for different images") {
let firstHandle = getFirstDSOHandle()
let secondHandle = getSecondDSOHandle()
expectNotEqual(firstHandle, secondHandle)
}
runAllTests()