1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import Commands
import PackageModel
import SourceControl
import SPMTestSupport
import Workspace
import XCTest
final class ModuleAliasingFixtureTests: XCTestCase {
func testModuleDirectDeps1() async throws {
try await fixture(name: "ModuleAliasing/DirectDeps1") { fixturePath in
let pkgPath = fixturePath.appending(components: "AppPkg")
let buildPath = pkgPath.appending(components: ".build", try UserToolchain.default.targetTriple.platformBuildPathComponent, "debug")
await XCTAssertBuilds(pkgPath, extraArgs: ["--vv"])
XCTAssertFileExists(buildPath.appending(components: "App"))
XCTAssertFileExists(buildPath.appending(components: "Modules", "GameUtils.swiftmodule"))
XCTAssertFileExists(buildPath.appending(components: "Modules", "Utils.swiftmodule"))
_ = try await SwiftPM.Build.execute(packagePath: pkgPath)
}
}
func testModuleDirectDeps2() async throws {
try await fixture(name: "ModuleAliasing/DirectDeps2") { fixturePath in
let pkgPath = fixturePath.appending(components: "AppPkg")
let buildPath = pkgPath.appending(components: ".build", try UserToolchain.default.targetTriple.platformBuildPathComponent, "debug")
await XCTAssertBuilds(pkgPath, extraArgs: ["--vv"])
XCTAssertFileExists(buildPath.appending(components: "App"))
XCTAssertFileExists(buildPath.appending(components: "Modules", "AUtils.swiftmodule"))
XCTAssertFileExists(buildPath.appending(components: "Modules", "BUtils.swiftmodule"))
_ = try await SwiftPM.Build.execute(packagePath: pkgPath)
}
}
}
|