Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,16 @@ else:
for name in ('swift-build', 'FileCheck', 'readelf'):
config.substitutions.append((' {0} '.format(name),
' unquoted-command-name-{0} '.format(name)))

# Add substitutions for SourceKit stress tester executables
sk_stress_test_path = lit_config.params.get(
"sk-stress-test",
os.path.join(package_path, "usr", "bin", "sk-stress-test"))
sk_swiftc_wrapper_path = lit_config.params.get(
"sk-swiftc-wrapper",
os.path.join(package_path, "usr", "bin", "sk-swiftc-wrapper"))

lit_config.note("testing using 'sk-stress-test': {}".format(sk_stress_test_path))
lit_config.note("testing using 'sk-swiftc-wrapper': {}".format(sk_swiftc_wrapper_path))
config.substitutions.append( ('%{sk-stress-test}', sk_stress_test_path) )
config.substitutions.append( ('%{sk-swiftc-wrapper}', sk_swiftc_wrapper_path) )
20 changes: 20 additions & 0 deletions sk-stress-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Trivial test for the SourceKit stress tester and compiler wrapper.
//
// REQUIRES: platform=Darwin
//
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/test.swift
//
// 1) Make sure both exit successfully running over a valid file
// RUN: %{sk-stress-test} %t.dir/test.swift swiftc %t.dir/test.swift
// RUN: %{sk-swiftc-wrapper} %t.dir/test.swift
//
// 2) Make sure the wrapper fails when the underlying compilation fails
// RUN: echo " undefined_symbol " >> %t.dir/test.swift
// RUN: %{not} %{sk-swiftc-wrapper} %t.dir/test.swift
//

func foo() {
print("hello")
}