mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-08-16 16:20:51 +03:00
restructure test targets
This commit is contained in:
parent
d0d509c1a5
commit
518d8e578b
@ -35,21 +35,52 @@ let package = Package(
|
||||
"JSONUtilities",
|
||||
"XcodeProj",
|
||||
"PathKit",
|
||||
"Core",
|
||||
]),
|
||||
.target(name: "ProjectSpec", dependencies: [
|
||||
"JSONUtilities",
|
||||
"XcodeProj",
|
||||
"Yams",
|
||||
"Core",
|
||||
]),
|
||||
.target(name: "Core", dependencies: [
|
||||
"PathKit",
|
||||
"Yams",
|
||||
]),
|
||||
.target(name: "TestSupport", dependencies: [
|
||||
"XcodeProj",
|
||||
"Spectre",
|
||||
"PathKit",
|
||||
]),
|
||||
.testTarget(name: "XcodeGenKitTests", dependencies: [
|
||||
"XcodeGenKit",
|
||||
"Spectre",
|
||||
"PathKit",
|
||||
"TestSupport",
|
||||
]),
|
||||
.testTarget(name: "FixtureTests", dependencies: [
|
||||
"XcodeGenKit",
|
||||
"Spectre",
|
||||
"PathKit",
|
||||
"TestSupport",
|
||||
]),
|
||||
.testTarget(name: "CoreTests", dependencies: [
|
||||
"Core",
|
||||
"Spectre",
|
||||
"PathKit",
|
||||
"TestSupport",
|
||||
]),
|
||||
.testTarget(name: "ProjectSpecTests", dependencies: [
|
||||
"ProjectSpec",
|
||||
"Spectre",
|
||||
"PathKit",
|
||||
"TestSupport",
|
||||
]),
|
||||
.testTarget(name: "PerformanceTests", dependencies: [
|
||||
"XcodeGenKit",
|
||||
"Spectre",
|
||||
"PathKit",
|
||||
"TestSupport",
|
||||
]),
|
||||
]
|
||||
)
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Foundation
|
||||
import ProjectSpec
|
||||
import Core
|
||||
|
||||
public class CacheFile {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import Foundation
|
||||
import JSONUtilities
|
||||
import PathKit
|
||||
import ProjectSpec
|
||||
import XcodeProj
|
||||
import Yams
|
||||
|
@ -1,13 +1,12 @@
|
||||
import Foundation
|
||||
import PathKit
|
||||
import ProjectSpec
|
||||
import Spectre
|
||||
import XcodeProj
|
||||
import XCTest
|
||||
|
||||
let fixturePath = Path(#file).parent().parent() + "Fixtures"
|
||||
public let fixturePath = Path(#file).parent().parent().parent() + "Tests/Fixtures"
|
||||
|
||||
func doThrowing<T>(file: String = #file, line: Int = #line, _ closure: () throws -> T) throws -> T {
|
||||
public func doThrowing<T>(file: String = #file, line: Int = #line, _ closure: () throws -> T) throws -> T {
|
||||
do {
|
||||
return try closure()
|
||||
} catch {
|
||||
@ -15,7 +14,7 @@ func doThrowing<T>(file: String = #file, line: Int = #line, _ closure: () throws
|
||||
}
|
||||
}
|
||||
|
||||
func expectError<T: Error>(_ expectedError: T, function: String = #function, file: String = #file, line: Int = #line, _ closure: () throws -> Void) throws where T: CustomStringConvertible {
|
||||
public func expectError<T: Error>(_ expectedError: T, function: String = #function, file: String = #file, line: Int = #line, _ closure: () throws -> Void) throws where T: CustomStringConvertible {
|
||||
do {
|
||||
try closure()
|
||||
} catch let error as T {
|
@ -2,6 +2,7 @@ import Foundation
|
||||
import PathKit
|
||||
import ProjectSpec
|
||||
import XcodeProj
|
||||
import Core
|
||||
|
||||
struct SourceFile {
|
||||
let path: Path
|
||||
|
@ -7,6 +7,7 @@
|
||||
// Adapted from https://gist.github.com/efirestone/ce01ae109e08772647eb061b3bb387c3
|
||||
|
||||
import XCTest
|
||||
@testable import Core
|
||||
@testable import XcodeGenKit
|
||||
|
||||
class GlobTests: XCTestCase {
|
@ -1,6 +1,8 @@
|
||||
import Spectre
|
||||
import PathKit
|
||||
import XCTest
|
||||
import Core
|
||||
import TestSupport
|
||||
|
||||
class PathExtensionsTests: XCTestCase {
|
||||
|
@ -4,14 +4,19 @@ import Spectre
|
||||
import XcodeGenKit
|
||||
import XcodeProj
|
||||
import XCTest
|
||||
import TestSupport
|
||||
|
||||
class ProjectFixtureTests: XCTestCase {
|
||||
class FixtureTests: XCTestCase {
|
||||
|
||||
func testProjectFixture() {
|
||||
describe {
|
||||
$0.it("generates fixtures") {
|
||||
$0.it("generates Test Project") {
|
||||
try generateXcodeProject(specPath: fixturePath + "TestProject/project.yml")
|
||||
}
|
||||
$0.it("generates Carthage Project") {
|
||||
try generateXcodeProject(specPath: fixturePath + "CarthageProject/project.yml")
|
||||
}
|
||||
$0.it("generates SPM Project") {
|
||||
try generateXcodeProject(specPath: fixturePath + "SPM/project.yml")
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import Spectre
|
||||
import XcodeGenKit
|
||||
import XcodeProj
|
||||
import XCTest
|
||||
import TestSupport
|
||||
|
||||
class ProjectSpecTests: XCTestCase {
|
||||
|
@ -2,10 +2,10 @@ import Foundation
|
||||
import PathKit
|
||||
import ProjectSpec
|
||||
import Spectre
|
||||
import XcodeGenKit
|
||||
import XcodeProj
|
||||
import XCTest
|
||||
import Yams
|
||||
import TestSupport
|
||||
|
||||
class SpecLoadingTests: XCTestCase {
|
||||
|
@ -3,6 +3,7 @@ import Spectre
|
||||
import XCTest
|
||||
import PathKit
|
||||
@testable import XcodeGenKit
|
||||
import TestSupport
|
||||
|
||||
class CarthageDependencyResolverTests: XCTestCase {
|
||||
|
||||
|
@ -5,6 +5,7 @@ import XcodeGenKit
|
||||
import XcodeProj
|
||||
import XCTest
|
||||
import Yams
|
||||
import TestSupport
|
||||
|
||||
extension Project {
|
||||
|
||||
|
@ -5,6 +5,7 @@ import XcodeGenKit
|
||||
import XcodeProj
|
||||
import XCTest
|
||||
import Yams
|
||||
import TestSupport
|
||||
|
||||
private let app = Target(
|
||||
name: "MyApp",
|
||||
|
@ -5,6 +5,7 @@ import XcodeGenKit
|
||||
import XcodeProj
|
||||
import XCTest
|
||||
import Yams
|
||||
import TestSupport
|
||||
|
||||
private let app = Target(
|
||||
name: "MyApp",
|
||||
|
Loading…
Reference in New Issue
Block a user