Skip to content

Commit 6132396

Browse files
committed
Test: Merge IntegrationTests into Tests
Consolidate all the tests into a single folders. This change only moves the IntegrationTests at the root of the project directory into the Tests directory. A subsequent change will find better homes for the tests under Tests/IntegrationTests.
1 parent c6874d3 commit 6132396

File tree

55 files changed

+40
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+40
-53
lines changed

IntegrationTests/Package.swift

Lines changed: 0 additions & 25 deletions
This file was deleted.

IntegrationTests/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

Package.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,18 @@ let package = Package(
806806
name: "BuildTests",
807807
dependencies: ["Build", "PackageModel", "Commands", "_InternalTestSupport", "_InternalBuildTestSupport"]
808808
),
809+
.testTarget(
810+
name: "IntegrationTests",
811+
dependencies: [
812+
"swift-package-manager",
813+
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
814+
.product(name: "TSCTestSupport", package: "swift-tools-support-core"),
815+
.target(name: "swift-build"),
816+
.target(name: "swift-package"),
817+
.target(name: "swift-run"),
818+
.target(name: "swift-test")
819+
]
820+
),
809821
.testTarget(
810822
name: "LLBuildManifestTests",
811823
dependencies: ["Basics", "LLBuildManifest", "_InternalTestSupport"]

IntegrationTests/Tests/IntegrationTests/XCBuildTests.swift renamed to Tests/IntegrationTests/XCBuildTests.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ final class XCBuildTests: XCTestCase {
3636
XCTAssertFileExists(releasePath.appending(component: "bar"))
3737
XCTAssertNoSuchPath(releasePath.appending(component: "cbar"))
3838
}
39+
}
40+
41+
func testExecutableProducts2() throws {
42+
#if !os(macOS)
43+
try XCTSkip("Test requires macOS")
44+
#endif
3945

4046
fixture(name: "XCBuild/ExecutableProducts") { path in
4147
let fooPath = path.appending(component: "Foo")
@@ -55,6 +61,12 @@ final class XCBuildTests: XCTestCase {
5561
XCTAssertFileExists(releasePath.appending(component: "bar"))
5662
XCTAssertNoSuchPath(releasePath.appending(component: "cbar"))
5763
}
64+
}
65+
66+
func testExecutableProducts3() throws {
67+
#if !os(macOS)
68+
try XCTSkip("Test requires macOS")
69+
#endif
5870

5971
fixture(name: "XCBuild/ExecutableProducts") { path in
6072
let fooPath = path.appending(component: "Foo")
@@ -74,6 +86,12 @@ final class XCBuildTests: XCTestCase {
7486
XCTAssertNoSuchPath(releasePath.appending(component: "bar"))
7587
XCTAssertNoSuchPath(releasePath.appending(component: "cbar"))
7688
}
89+
}
90+
91+
func testExecutableProducts4() throws {
92+
#if !os(macOS)
93+
try XCTSkip("Test requires macOS")
94+
#endif
7795

7896
fixture(name: "XCBuild/ExecutableProducts") { path in
7997
let fooPath = path.appending(component: "Foo")
@@ -93,6 +111,12 @@ final class XCBuildTests: XCTestCase {
93111
XCTAssertFileExists(releasePath.appending(component: "bar"))
94112
XCTAssertNoSuchPath(releasePath.appending(component: "cbar"))
95113
}
114+
}
115+
116+
func testExecutableProducts5() throws {
117+
#if !os(macOS)
118+
try XCTSkip("Test requires macOS")
119+
#endif
96120

97121
fixture(name: "XCBuild/ExecutableProducts") { path in
98122
let fooPath = path.appending(component: "Foo")

Utilities/build-using-self

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,8 @@ def main() -> None:
160160
shlex.split(f"swift test --configuration {args.config} --parallel {swift_testing_arg} {xctest_arg}"),
161161
)
162162

163-
with change_directory(REPO_ROOT_PATH / "IntegrationTests"):
164-
call(
165-
shlex.split("swift package update"),
166-
)
167-
call(
168-
shlex.split(
169-
f"{swiftpm_bin_dir / 'swift-test'} --parallel",
170-
),
171-
)
172-
173163
run_bootstrap(swiftpm_bin_dir=swiftpm_bin_dir)
174164

175165

176166
if __name__ == "__main__":
177-
main()
167+
main()

Utilities/soundness.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ for language in swift-or-c bash python; do
7171
-o -path "./Sources/PackageSigning/embedded_resources.swift"
7272
-o -path "./Examples/*"
7373
-o -path "./Fixtures/*"
74-
-o -path "./IntegrationTests/*"
7574
-o -path "./Tests/ExtraTests/*"
7675
-o -path "./Tests/PackageLoadingTests/Inputs/*"
7776
)
@@ -91,7 +90,7 @@ for language in swift-or-c bash python; do
9190
EOF
9291
;;
9392
bash)
94-
exceptions=( -path "./Examples/*" -o -path "./Fixtures/*" -o -path "./IntegrationTests/*" -o -path "*/.build/*" )
93+
exceptions=( -path "./Examples/*" -o -path "./Fixtures/*" -o -path "*/.build/*" )
9594
matching_files=( -name '*.sh' )
9695
cat > "$tmp" <<"EOF"
9796
#!/bin/bash
@@ -109,7 +108,7 @@ EOF
109108
EOF
110109
;;
111110
python)
112-
exceptions=( -path "./Examples/*" -o -path "./Fixtures/*" -o -path "./IntegrationTests/*" -o -path "*/.build/*" )
111+
exceptions=( -path "./Examples/*" -o -path "./Fixtures/*" -o -path "*/.build/*" )
113112
matching_files=( -name '*.py' )
114113
cat > "$tmp" <<"EOF"
115114
#!/usr/bin/env python3

Utilities/test-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test(args):
104104
else:
105105
cmd += ['%s=%s' % (key,value)]
106106

107-
integration_test_dir = os.path.join(args.project_root, "IntegrationTests")
107+
integration_test_dir = os.path.join(args.project_root)
108108
cmd += [
109109
args.swift_test_path,
110110
"--package-path", integration_test_dir,

0 commit comments

Comments
 (0)