Skip to content

Commit 2297c3f

Browse files
committed
[Build][Test] Fix TypeRoundTrip/round-trip.swift.
`TypeRoundTrip/round-trip.swift` tries to link with `libswiftRemoteInspection`, but that library isn't in the default link path, so we need to add a `-L` option to the command line in the test. Also, we should check that `SWIFT_BUILD_REMOTE_MIRROR` is enabled and disable the test if not, because otherwise `libswiftRemoteInspection` won't have been built. rdar://123503470
1 parent 62c80a1 commit 2297c3f

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

test/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ function(get_test_dependencies SDK result_var_name)
4747
list(APPEND deps sdk-overlay)
4848
endif()
4949

50+
if(SWIFT_BUILD_REMOTE_MIRROR)
51+
list(APPEND deps swiftRemoteInspection)
52+
endif()
53+
5054
set(deps_binaries)
5155

5256
if (SWIFT_INCLUDE_TOOLS)
@@ -215,6 +219,7 @@ normalize_boolean_spelling(SWIFT_STDLIB_ENABLE_OBJC_INTEROP)
215219
normalize_boolean_spelling(SWIFT_ENABLE_BACKTRACING)
216220
normalize_boolean_spelling(SWIFT_BUILD_SWIFT_SYNTAX)
217221
normalize_boolean_spelling(SWIFT_ENABLE_SYNCHRONIZATION)
222+
normalize_boolean_spelling(SWIFT_BUILD_REMOTE_MIRROR)
218223
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" SWIFT_OPTIMIZED)
219224

220225
# Get 'SWIFT_HOST_SDKROOT' for lit.site.cfg.in
@@ -432,6 +437,10 @@ foreach(SDK ${SWIFT_SDKS})
432437
list(APPEND LIT_ARGS "--param" "synchronization")
433438
endif()
434439

440+
if(SWIFT_BUILD_REMOTE_MIRROR)
441+
list(APPEND LIT_ARGS "--param" "remote_mirror")
442+
endif()
443+
435444
list(APPEND LIT_ARGS "--param" "threading=${SWIFT_SDK_${SDK}_THREADING_PACKAGE}")
436445

437446
# Enable on-crash backtracing if supported

test/TypeRoundTrip/round-trip.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
// RUN: echo "func runAllTests() throws {" >> %t/all-tests.swift
77
// RUN: for module in %S/Inputs/testcases/*.swift; do modname=$(basename $module .swift); %target-build-swift -g -static -emit-module-path %t/$modname.swiftmodule -emit-module -emit-library -module-name $modname -o %t/%target-static-library-name($modname) -I%t -L%t $module -lRoundTrip; echo " print(\"--- $modname\")" >> %t/all-tests.swift; echo " $modname.test()" >> %t/all-tests.swift; echo " print(\"\")" >> %t/all-tests.swift; echo "-l$modname" >> %t/link.txt; done
88
// RUN: echo "}" >> %t/all-tests.swift
9-
// RUN: %target-build-swift -g -I%t -o %t/round-trip %s %t/all-tests.swift -L%t %target-cxx-lib $(cat %t/link.txt) -lm -lRoundTrip -lswiftRemoteInspection
9+
// RUN: %target-build-swift -g -I%t -o %t/round-trip %s %t/all-tests.swift -L%t %target-cxx-lib $(cat %t/link.txt) -lm -lRoundTrip -L%swift-lib-dir/swift/%target-sdk-name/%target-arch -lswiftRemoteInspection
1010
// RUN: %target-codesign %t/round-trip
1111
// RUN: %target-run %t/round-trip | %FileCheck %s
1212

1313
// REQUIRES: executable_test
1414
// REQUIRES: shell
15+
// REQUIRES: remote_mirror
1516
// UNSUPPORTED: use_os_stdlib
1617
// UNSUPPORTED: back_deployment_runtime
1718

test/lit.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,10 @@ synchronization = lit_config.params.get('synchronization', None)
537537
if synchronization is not None:
538538
config.available_features.add('synchronization')
539539

540+
remote_mirror = lit_config.params.get('remote_mirror', None)
541+
if remote_mirror is not None:
542+
config.available_features.add('remote_mirror')
543+
540544
test_options = os.environ.get('SWIFT_TEST_OPTIONS')
541545
if test_options:
542546
config.swift_test_options += ' '

0 commit comments

Comments
 (0)