Skip to content

Commit 4f9b9e8

Browse files
authored
Merge pull request #55 from hartbit/swiftpm-overrides
Use the SwiftPM overrides consistently
2 parents ed01cfb + 87ae4fc commit 4f9b9e8

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.

0 commit comments

Comments
 (0)