Files
swift-mirror/validation-test/execution/dsohandle-multi-module.swift
Saleem Abdulrasool b212229db1 test: add and use prefix substitutions for libraries
The naming convention is different on Windows than on Unix-like
environments.  In order to follow the convention we need to substitute
the prefix and the suffix.  Take the opportunity to rename the
`target-dylib-extension` to the CMake-like variable
`target-shared-library-suffix` and introduce
`target-shared-library-prefix`.  This helps linking the test suite
binaries on Windows.
2018-12-11 15:56:06 -08:00

27 lines
1.1 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: (cd %t && %target-build-swift %S/Inputs/dsohandle-first.swift -emit-library -emit-module -module-name first -Xlinker -install_name -Xlinker '@executable_path/libfirst.dylib')
// RUN: (cd %t && %target-build-swift %S/Inputs/dsohandle-second.swift -emit-library -emit-module -module-name second -Xlinker -install_name -Xlinker '@executable_path/libsecond.dylib')
// RUN: %target-build-swift -I %t -L %t -lfirst -lsecond %s -o %t/main
// RUN: %target-codesign %t/main %t/%{target-shared-library-prefix}first%{target-shared-library-suffix} %t/%{target-shared-library-prefix}second%{target-shared-library-suffix}
// RUN: %target-run %t/main %t/%{target-shared-library-prefix}first%{target-shared-library-suffix} %t/%{target-shared-library-prefix}second%{target-shared-library-suffix}
// REQUIRES: executable_test
// UNSUPPORTED: linux
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()