From da471302d021df65bcf725055e8fea036390281e Mon Sep 17 00:00:00 2001 From: tanner0101 Date: Sat, 21 Apr 2018 02:03:28 -0400 Subject: [PATCH] spm first init --- .gitignore | 4 ++++ Package.swift | 28 ++++++++++++++++++++++++++++ README.md | 3 +++ Sources/SQL/SQL.swift | 3 +++ Tests/LinuxMain.swift | 7 +++++++ Tests/SQLTests/SQLTests.swift | 16 ++++++++++++++++ Tests/SQLTests/XCTestManifests.swift | 9 +++++++++ 7 files changed, 70 insertions(+) create mode 100644 .gitignore create mode 100644 Package.swift create mode 100644 README.md create mode 100644 Sources/SQL/SQL.swift create mode 100644 Tests/LinuxMain.swift create mode 100644 Tests/SQLTests/SQLTests.swift create mode 100644 Tests/SQLTests/XCTestManifests.swift diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..02c08753 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..c9ce4fa2 --- /dev/null +++ b/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version:4.0 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "SQL", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "SQL", + targets: ["SQL"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "SQL", + dependencies: []), + .testTarget( + name: "SQLTests", + dependencies: ["SQL"]), + ] +) diff --git a/README.md b/README.md new file mode 100644 index 00000000..25c2817e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# SQL + +A description of this package. diff --git a/Sources/SQL/SQL.swift b/Sources/SQL/SQL.swift new file mode 100644 index 00000000..06759456 --- /dev/null +++ b/Sources/SQL/SQL.swift @@ -0,0 +1,3 @@ +struct SQL { + var text = "Hello, World!" +} diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 00000000..911c99c4 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import SQLTests + +var tests = [XCTestCaseEntry]() +tests += SQLTests.allTests() +XCTMain(tests) \ No newline at end of file diff --git a/Tests/SQLTests/SQLTests.swift b/Tests/SQLTests/SQLTests.swift new file mode 100644 index 00000000..0ea977ce --- /dev/null +++ b/Tests/SQLTests/SQLTests.swift @@ -0,0 +1,16 @@ +import XCTest +@testable import SQL + +final class SQLTests: XCTestCase { + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(SQL().text, "Hello, World!") + } + + + static var allTests = [ + ("testExample", testExample), + ] +} diff --git a/Tests/SQLTests/XCTestManifests.swift b/Tests/SQLTests/XCTestManifests.swift new file mode 100644 index 00000000..760274d7 --- /dev/null +++ b/Tests/SQLTests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !os(macOS) +public func allTests() -> [XCTestCaseEntry] { + return [ + testCase(SQLTests.allTests), + ] +} +#endif \ No newline at end of file