diff --git a/.gitignore b/.gitignore index 5c66fd7..b1c278f 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,13 @@ DerivedData *.ipa *.xcuserstate + +# SPM +# +.build +Packages/ + + # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However diff --git a/Gzip.xcodeproj/project.pbxproj b/Gzip.xcodeproj/project.pbxproj index 3ef052e..ff8c397 100644 --- a/Gzip.xcodeproj/project.pbxproj +++ b/Gzip.xcodeproj/project.pbxproj @@ -49,7 +49,7 @@ 2A321F071D4A635F002B0245 /* Gzip.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Gzip.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2A321F101D4A6398002B0245 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS10.0.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; 2A58A7571B00F414005FBBC2 /* Tests macOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests macOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2A58A75C1B00F414005FBBC2 /* GzipTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GzipTests.swift; sourceTree = ""; }; + 2A58A75C1B00F414005FBBC2 /* GzipTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = GzipTests.swift; path = GzipTests/GzipTests.swift; sourceTree = ""; }; 2A58A7611B00F42C005FBBC2 /* Data+Gzip.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Data+Gzip.swift"; sourceTree = ""; }; 2A58A77D1B00FBEF005FBBC2 /* Tests iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 2A8219C61D65AFB300D65063 /* test.txt.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = test.txt.gz; sourceTree = ""; }; diff --git a/Tests/GzipTests.swift b/Tests/GzipTests/GzipTests.swift similarity index 96% rename from Tests/GzipTests.swift rename to Tests/GzipTests/GzipTests.swift index d373586..f3fb65e 100644 --- a/Tests/GzipTests.swift +++ b/Tests/GzipTests/GzipTests.swift @@ -28,11 +28,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import Foundation import XCTest import Gzip -class NSData_GZIPTests: XCTestCase { +class GzipTests: XCTestCase { func testGZip() { @@ -97,7 +96,7 @@ class NSData_GZIPTests: XCTestCase { func testFileDecompression() { let bundle = Bundle(for: type(of: self)) - let url = bundle.url(forResource: "test.txt", withExtension: "gz")! + guard let url = bundle.url(forResource: "test.txt", withExtension: "gz") else { return } let data = try! Data(contentsOf: url) let uncompressed = try! data.gunzipped() diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..7de8514 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,36 @@ +// +// LinuxMain.swift +// Gzip +// +// Created by 1024jp on 2016-11-10. + +/* +The MIT License (MIT) + +© 2016 1024jp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +import XCTest +@testable import GzipTests + +XCTMain([ + testCase(GzipTests.allTests), + ])