Skip to content

Commit 87ae4fc

Browse files
committed
Use the SwiftPM overrides consistently
1 parent ed01cfb commit 87ae4fc

14 files changed

+21
-19
lines changed

build-swift-benchmarks-with-swiftpm.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: rm -rf %t.dir
66
// RUN: mkdir -p %t.dir/
77
//
8-
// RUN: %{swift} build --package-path %{swift_benchmarks_path} --build-path %t.dir 2>&1 | tee %t.build-log
8+
// RUN: %{swift-build} --package-path %{swift_benchmarks_path} --build-path %t.dir 2>&1 | tee %t.build-log
99
//
1010
// Check the build log.
1111
//

debugging-flags-SR85.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# RUN: touch %t.dir/tool/Package.swift
1010
# RUN: echo 'let foo = "bar"' > %t.dir/tool/main.swift
1111
# RUN: echo 'print(foo)' >> %t.dir/tool/main.swift
12-
# RUN: %{swift} build --package-path %t.dir/tool -v 2>&1 | tee %t.build-log
12+
# RUN: %{swift-build} --package-path %t.dir/tool -v 2>&1 | tee %t.build-log
1313

1414
# RUN: echo 'breakpoint set -f main.swift -l 2' > %t.dir/lldb.script
1515
# RUN: echo 'run' >> %t.dir/lldb.script

example-package-dealer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# RUN: git clone https://github.com/apple/example-package-dealer %t.dir/dealer
1111

1212
# RUN: rm -rf %t.dir/dealer/.build
13-
# RUN: %{swift} build --package-path %t.dir/dealer 2>&1 | tee %t.build-log
13+
# RUN: %{swift-build} --package-path %t.dir/dealer 2>&1 | tee %t.build-log
1414

1515
# Check the build log.
1616
#
@@ -38,7 +38,7 @@
3838

3939
# Verify that another 'swift build' does nothing.
4040
#
41-
# RUN: %{swift} build --package-path %t.dir/dealer 2>&1 | tee %t.rebuild-log
41+
# RUN: %{swift-build} --package-path %t.dir/dealer 2>&1 | tee %t.rebuild-log
4242
# RUN: echo END-OF-INPUT >> %t.rebuild-log
4343
# RUN: %{FileCheck} --check-prefix CHECK-BUILD-LOG --input-file %t.build-log %s
4444
#

lit.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,12 @@ config.substitutions.append( ('%{readelf}', readelf_path) )
220220
swiftpm_build = lit_config.params.get("swiftpm-build")
221221
if swiftpm_build is not None:
222222
lit_config.note("testing using swiftpm build directory: {}".format(swiftpm_build))
223+
config.substitutions.append( ('%{swift-package}', os.path.join(swiftpm_build, "swift-package")) )
223224
config.substitutions.append( ('%{swift-build}', os.path.join(swiftpm_build, "swift-build")) )
224225
config.substitutions.append( ('%{swift-test}', os.path.join(swiftpm_build, "swift-test")) )
225226
config.substitutions.append( ('%{swift-run}', os.path.join(swiftpm_build, "swift-run")) )
226227
else:
228+
config.substitutions.append( ('%{swift-package}', swift_path + ' package') )
227229
config.substitutions.append( ('%{swift-build}', swift_path + ' build') )
228230
config.substitutions.append( ('%{swift-test}', swift_path + ' test') )
229231
config.substitutions.append( ('%{swift-run}', swift_path + ' run') )

swift-build-self-host.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# RUN: cp -R %{swiftpm_srcdir} %t.dir/swiftpm
1515

1616
# RUN: rm -rf %t.dir/swiftpm/.build
17-
# RUN: %{swift} build --package-path %t.dir/swiftpm 2>&1 | tee %t.build-log
17+
# RUN: %{swift-build} --package-path %t.dir/swiftpm 2>&1 | tee %t.build-log
1818

1919
# Check the build log.
2020
#

swift-build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: mkdir -p %t.dir/tool
77
// RUN: cp %s %t.dir/tool/Package.swift
88
// RUN: echo 'print("HI")' > %t.dir/tool/main.swift
9-
// RUN: %{swift} build --package-path %t.dir/tool -v 2>&1 | tee %t.build-log
9+
// RUN: %{swift-build} --package-path %t.dir/tool -v 2>&1 | tee %t.build-log
1010
//
1111
// Check the build log.
1212
//

swift-package-init-exec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
```
66
RUN: rm -rf %t.dir
77
RUN: mkdir -p %t.dir/Project
8-
RUN: %{swift} package --package-path %t.dir/Project init --type executable
9-
RUN: %{swift} build --package-path %t.dir/Project 2>&1 | tee %t.build-log
8+
RUN: %{swift-package} --package-path %t.dir/Project init --type executable
9+
RUN: %{swift-build} --package-path %t.dir/Project 2>&1 | tee %t.build-log
1010
```
1111

1212
## Check the build log.

swift-package-init-lib.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
```
77
RUN: rm -rf %t.dir
88
RUN: mkdir -p %t.dir/Project
9-
RUN: %{swift} package --package-path %t.dir/Project init --type library
10-
RUN: %{swift} build --package-path %t.dir/Project 2>&1 | tee %t.build-log
11-
RUN: %{swift} test --package-path %t.dir/Project 2>&1 | tee %t.test-log
9+
RUN: %{swift-package} --package-path %t.dir/Project init --type library
10+
RUN: %{swift-build} --package-path %t.dir/Project 2>&1 | tee %t.build-log
11+
RUN: %{swift-test} --package-path %t.dir/Project 2>&1 | tee %t.test-log
1212
```
1313

1414
## Check the build log.

swift-package-with-spaces.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// RUN: cp %s %t.dir/more\ spaces/special\ tool/Package.swift
88
// RUN: echo 'foo()' > %t.dir/more\ spaces/special\ tool/main.swift
99
// RUN: echo 'func foo() { print("HI") }' > %t.dir/more\ spaces/special\ tool/some\ file.swift
10-
// RUN: %{swift} build --package-path %t.dir/more\ spaces/special\ tool -v 2>&1 | tee %t.build-log
10+
// RUN: %{swift-build} --package-path %t.dir/more\ spaces/special\ tool -v 2>&1 | tee %t.build-log
1111
//
1212
// Check the build log.
1313
//

swift-run.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
```
66
RUN: rm -rf %t.dir
77
RUN: mkdir -p %t.dir/secho
8-
RUN: %{swift} package --package-path %t.dir/secho init --type executable
8+
RUN: %{swift-package} --package-path %t.dir/secho init --type executable
99
RUN: echo "import Foundation; print(CommandLine.arguments.dropFirst().joined(separator: \" \"))" >%t.dir/secho/Sources/secho/main.swift
10-
RUN: %{swift} run --package-path %t.dir/secho secho 1 "two" 2>&1 | tee %t.run-log
10+
RUN: %{swift-run} --package-path %t.dir/secho secho 1 "two" 2>&1 | tee %t.run-log
1111
```
1212

1313
## Check the run log.

test-c-library-swiftpm/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# RUN: git -C %t.dir/z commit -m "Creating package"
2222
# RUN: git -C %t.dir/z tag 1.0.0
2323

24-
# RUN: %{swift} build --package-path %t.dir/testApp 2>&1 | tee %t.build-log
24+
# RUN: %{swift-build} --package-path %t.dir/testApp 2>&1 | tee %t.build-log
2525

2626
# Check the build log.
2727
#
@@ -41,7 +41,7 @@
4141

4242
# Verify that another 'swift build' does nothing.
4343
#
44-
# RUN: %{swift} build --package-path %t.dir/testApp 2>&1 | tee %t.rebuild-log
44+
# RUN: %{swift-build} --package-path %t.dir/testApp 2>&1 | tee %t.rebuild-log
4545
# RUN: echo END-OF-INPUT >> %t.rebuild-log
4646
# RUN: %{FileCheck} --check-prefix CHECK-BUILD-LOG --input-file %t.build-log %s
4747
#

test-foundation-package/test-foundation-package.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: mkdir -p %t.dir/tool
77
// RUN: cp %s %t.dir/tool/Package.swift
88
// RUN: cp %S/main.swift %t.dir/tool/main.swift
9-
// RUN: %{swift} build --package-path %t.dir/tool -v 2>&1 | tee %t.build-log
9+
// RUN: %{swift-build} --package-path %t.dir/tool -v 2>&1 | tee %t.build-log
1010
//
1111
// Check the build log.
1212
//

test-lldb-with-c-package/test-xctest-package.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// RUN: git -C %t.dir/CFoo tag 1.0.0
2323
//
2424
// Check the build log.
25-
// RUN: %{swift} build --package-path %t.dir/Foo 2>&1 | tee %t.build-log
25+
// RUN: %{swift-build} --package-path %t.dir/Foo 2>&1 | tee %t.build-log
2626
// RUN: %{FileCheck} --check-prefix CHECK-BUILD-LOG --input-file %t.build-log %s
2727
// CHECK-BUILD-LOG: Compile Swift Module 'Foo'
2828

test-xctest-package/test-xctest-package.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// RUN: mkdir -p %t.dir/tool
99
// RUN: cp %s %t.dir/tool/Package.swift
1010
// RUN: cp %S/main.swift %t.dir/tool/main.swift
11-
// RUN: %{swift} build --package-path %t.dir/tool -v 2>&1 | tee %t.build-log
11+
// RUN: %{swift-build} --package-path %t.dir/tool -v 2>&1 | tee %t.build-log
1212
//
1313
// Check the build log.
1414
//

0 commit comments

Comments
 (0)