Skip to content

Commit 6897516

Browse files
committed
[test] Add new libdispatch -vfsoverlay flag for linux, as in swiftlang/swift-corelibs-libdispatch#785
This allows the tests that use libdispatch to find its modulemap, plus add the libdispatch compilation flags to one test that was missing them and fix one async test on linux.
1 parent 6e87f15 commit 6897516

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

test/Concurrency/Runtime/async_task_priority_current.swift

+4-11
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,10 @@
1010

1111
import Dispatch
1212

13-
// Work around the inability of older Swift runtimes to print a task priority.
14-
extension TaskPriority: CustomStringConvertible {
15-
public var description: String {
16-
"TaskPriority(rawValue: \(rawValue))"
17-
}
18-
}
19-
2013
@available(SwiftStdlib 5.1, *)
2114
@main struct Main {
2215
static func main() async {
23-
print("main priority: \(Task.currentPriority)") // CHECK: main priority: TaskPriority(rawValue: [[#MAIN_PRIORITY:]])
16+
print("main priority: \(Task.currentPriority)") // CHECK: main priority: TaskPriority.medium
2417
await test_detach()
2518
await test_multiple_lo_indirectly_escalated()
2619
}
@@ -29,18 +22,18 @@ extension TaskPriority: CustomStringConvertible {
2922
@available(SwiftStdlib 5.1, *)
3023
func test_detach() async {
3124
let a1 = Task.currentPriority
32-
print("a1: \(a1)") // CHECK: a1: TaskPriority(rawValue: [[#MAIN_PRIORITY]])
25+
print("a1: \(a1)") // CHECK: a1: TaskPriority.medium
3326

3427
// Note: remember to detach using a higher priority, otherwise a lower one
3528
// might be escalated by the get() and we could see `default` in the detached
3629
// task.
3730
await detach(priority: .userInitiated) {
3831
let a2 = Task.currentPriority
39-
print("a2: \(a2)") // CHECK: a2: TaskPriority(rawValue: 25)
32+
print("a2: \(a2)") // CHECK: a2: TaskPriority.high
4033
}.get()
4134

4235
let a3 = Task.currentPriority
43-
print("a3: \(a3)") // CHECK: a3: TaskPriority(rawValue: [[#MAIN_PRIORITY]])
36+
print("a3: \(a3)") // CHECK: a3: TaskPriority.medium
4437
}
4538

4639
@available(SwiftStdlib 5.1, *)

test/Concurrency/Runtime/custom_executors_complex_equality_crash.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library)
1+
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking %import-libdispatch -parse-as-library)
22

33
// REQUIRES: concurrency
44
// REQUIRES: executable_test

test/lit.cfg

+4-2
Original file line numberDiff line numberDiff line change
@@ -1643,15 +1643,17 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows-
16431643
libdispatch_artifact_dir = config.libdispatch_build_path
16441644
libdispatch_swift_module_dir = make_path(libdispatch_artifact_dir, 'src', 'swift', 'swift')
16451645
libdispatch_source_dir = make_path(config.swift_src_root, os.pardir, 'swift-corelibs-libdispatch')
1646+
libdispatch_vfs_yaml = make_path(libdispatch_artifact_dir, 'dispatch-vfs-overlay.yaml')
16461647
libdispatch_artifacts = [
1648+
libdispatch_vfs_yaml,
16471649
make_path(libdispatch_artifact_dir, 'libdispatch.so'),
16481650
make_path(libdispatch_artifact_dir, 'libswiftDispatch.so'),
16491651
make_path(libdispatch_swift_module_dir, 'Dispatch.swiftmodule')]
16501652
if (all(os.path.exists(p) for p in libdispatch_artifacts)):
16511653
config.available_features.add('libdispatch')
16521654
config.libdispatch_artifact_dir = libdispatch_artifact_dir
1653-
config.import_libdispatch = ('-I %s -I %s -L %s'
1654-
% (libdispatch_source_dir, libdispatch_swift_module_dir, libdispatch_artifact_dir))
1655+
config.import_libdispatch = ('-I %s -I %s -L %s -vfsoverlay %s'
1656+
% (libdispatch_source_dir, libdispatch_swift_module_dir, libdispatch_artifact_dir, libdispatch_vfs_yaml))
16551657

16561658
libdispatch_static_artifact_dir = os.path.join(config.libdispatch_static_build_path, 'lib')
16571659
libdispatch_static_artifacts = [

0 commit comments

Comments
 (0)