Skip to content

Commit

Permalink
Merge pull request bitmark-inc#11 from bitmark-inc/fixes/unit-test-an…
Browse files Browse the repository at this point in the history
…d-spm

Support the latest SPM
  • Loading branch information
anhnguyenbitmark authored Jan 7, 2022
2 parents f8fd111 + 700a59d commit 0433254
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 21 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode9
osx_image: xcode13.2
branches:
only:
- master
Expand All @@ -9,8 +9,5 @@ before_install:

script:
- swift build
- xcrun xcodebuild -project TweetNacl.xcodeproj -scheme TweetNacl-macOS test | xcpretty
- xcrun xcodebuild -project TweetNacl.xcodeproj -scheme TweetNacl-iOS test | xcpretty
- xcrun xcodebuild -project TweetNacl.xcodeproj -scheme TweetNacl-watchOS test | xcpretty
- xcrun xcodebuild -project TweetNacl.xcodeproj -scheme TweetNacl-tvOS test | xcpretty
- swift test
after_success: bash <(curl -s https://codecov.io/bash)
36 changes: 28 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
// swift-tools-version:4.0
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(name: "TweetNacl", products: [.library(name: "TweetNacl", targets: ["TweetNacl"])],
targets: [
.target(name: "CTweetNacl"),
.target(name: "TweetNacl", dependencies: ["CTweetNacl"]),
.testTarget(name: "TweetNaclTests", dependencies: ["TweetNacl"]),
],
swiftLanguageVersions: [4])
let package = Package(
name: "TweetNacl",
products: [
.library(
name: "TweetNacl",
targets: ["TweetNacl"]),
],
dependencies: [],
targets: [
.target(name: "CTweetNacl"),
.target(
name: "TweetNacl",
dependencies: ["CTweetNacl"]),
.testTarget(
name: "TweetNaclTests",
dependencies: ["TweetNacl"],
resources: [
.process("SecretboxTestData.json"),
.process("BoxTestData.json"),
.process("ScalarMultiTestData.json"),
.process("SignTestData.json")
]
),
]
)
3 changes: 1 addition & 2 deletions Tests/TweetNaclTests/NaclBox_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ class NaclBox_Test: XCTestCase {

let testSuite = XCTestSuite(name: NSStringFromClass(self))

let testBundle = Bundle(for: NaclBox_Test.self)
let fileURL = testBundle.url(forResource: "BoxTestData", withExtension: "json")
let fileURL = Bundle.module.url(forResource: "BoxTestData", withExtension: "json")
let fileData = try! Data(contentsOf: fileURL!)
let json = try! JSONSerialization.jsonObject(with: fileData, options: [])
let arrayOfData = json as! [Array<String>]
Expand Down
3 changes: 1 addition & 2 deletions Tests/TweetNaclTests/NaclScalarMulti_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ class NaclScalarMulti_Tests: XCTestCase {

let testSuite = XCTestSuite(name: NSStringFromClass(self))

let testBundle = Bundle(for: NaclSecretbox_Tests.self)
let fileURL = testBundle.url(forResource: "ScalarMultiTestData", withExtension: "json")
let fileURL = Bundle.module.url(forResource: "ScalarMultiTestData", withExtension: "json")
let fileData = try! Data(contentsOf: fileURL!)
let json = try! JSONSerialization.jsonObject(with: fileData, options: [])
let arrayOfData = json as! [Array<String>]
Expand Down
3 changes: 1 addition & 2 deletions Tests/TweetNaclTests/NaclSecretbox_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class NaclSecretbox_Tests: XCTestCase {

let testSuite = XCTestSuite(name: NSStringFromClass(self))

let testBundle = Bundle(for: NaclSecretbox_Tests.self)
let fileURL = testBundle.url(forResource: "SecretboxTestData", withExtension: "json")
let fileURL = Bundle.module.url(forResource: "SecretboxTestData", withExtension: "json")
let fileData = try! Data(contentsOf: fileURL!)
let jsonDecoder = JSONDecoder()
let arrayOfData = try! jsonDecoder.decode([[String]].self, from: fileData)
Expand Down
2 changes: 1 addition & 1 deletion TweetNacl.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "TweetNacl"
s.version = "1.0.2"
s.version = "1.1.1"
s.summary = "TweetNacl wrapper library written in Swift."
s.description = <<-DESC
A Swift wrapper for TweetNacl C library
Expand Down

0 comments on commit 0433254

Please sign in to comment.