diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..cee77f43 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "JAMTests/jamtestvectors"] + path = JAMTests/jamtestvectors + url = git@github.com:w3f/jamtestvectors.git diff --git a/JAMTests/Package.resolved b/JAMTests/Package.resolved new file mode 100644 index 00000000..040bc0fa --- /dev/null +++ b/JAMTests/Package.resolved @@ -0,0 +1,24 @@ +{ + "originHash" : "02073a96e234cf0a04b67acb19f5feffa912570969455599cd8c7ff2f6333ca5", + "pins" : [ + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftlang/swift-syntax.git", + "state" : { + "revision" : "4c6cc0a3b9e8f14b3ae2307c5ccae4de6167ac2c", + "version" : "600.0.0-prerelease-2024-06-12" + } + }, + { + "identity" : "swift-testing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-testing.git", + "state" : { + "branch" : "main", + "revision" : "0e2d9cbb553aba8b9a8acf3d56d1bf042360855f" + } + } + ], + "version" : 3 +} diff --git a/JAMTests/Package.swift b/JAMTests/Package.swift index 262fe190..394d1d2e 100644 --- a/JAMTests/Package.swift +++ b/JAMTests/Package.swift @@ -5,6 +5,9 @@ import PackageDescription let package = Package( name: "JAMTests", + platforms: [ + .macOS(.v14), + ], products: [ // Products define the executables and libraries a package produces, making them visible to other packages. .library( @@ -12,15 +15,19 @@ let package = Package( targets: ["JAMTests"] ), ], + dependencies: [ + .package(url: "https://github.com/apple/swift-testing.git", branch: "main"), + ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. .target( - name: "JAMTests" + name: "JAMTests", + resources: [.copy("../../jamtestvectors")] ), .testTarget( name: "JAMTestsTests", - dependencies: ["JAMTests"] + dependencies: ["JAMTests", .product(name: "Testing", package: "swift-testing")] ), ], swiftLanguageVersions: [.version("6")] diff --git a/JAMTests/Sources/JAMTests/JAMTests.swift b/JAMTests/Sources/JAMTests/JAMTests.swift deleted file mode 100644 index 08b22b80..00000000 --- a/JAMTests/Sources/JAMTests/JAMTests.swift +++ /dev/null @@ -1,2 +0,0 @@ -// The Swift Programming Language -// https://docs.swift.org/swift-book diff --git a/JAMTests/Sources/JAMTests/TestLoader.swift b/JAMTests/Sources/JAMTests/TestLoader.swift new file mode 100644 index 00000000..cc6e21b2 --- /dev/null +++ b/JAMTests/Sources/JAMTests/TestLoader.swift @@ -0,0 +1,12 @@ +import Foundation + +enum TestLoader { + static func discover(forPath path: String) throws { + let prefix = Bundle.module.bundlePath + "/jamtestvectors/\(path)" + print("Discovering tests in \(prefix)") + let files = try FileManager.default.contentsOfDirectory(atPath: prefix) + var scaleFiles = files.filter { $0.hasSuffix(".scale") } + scaleFiles.sort() + print(scaleFiles) + } +} diff --git a/JAMTests/Tests/JAMTests/JAMTests.swift b/JAMTests/Tests/JAMTests/JAMTests.swift deleted file mode 100644 index daa0132f..00000000 --- a/JAMTests/Tests/JAMTests/JAMTests.swift +++ /dev/null @@ -1,13 +0,0 @@ -import XCTest - -@testable import JAMTests - -final class JAMTests: XCTestCase { - func testExample() throws { - // XCTest Documentation - // https://developer.apple.com/documentation/xctest - - // Defining Test Cases and Test Methods - // https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods - } -} diff --git a/JAMTests/Tests/JAMTests/Safrole.swift b/JAMTests/Tests/JAMTests/Safrole.swift new file mode 100644 index 00000000..680e77f3 --- /dev/null +++ b/JAMTests/Tests/JAMTests/Safrole.swift @@ -0,0 +1,10 @@ +import Testing + +@testable import JAMTests + +struct SafroleTests { + @Test func works() throws { + try TestLoader.discover(forPath: "safrole/tiny") + #expect(1 + 1 == 2) + } +} diff --git a/JAMTests/jamtestvectors b/JAMTests/jamtestvectors new file mode 160000 index 00000000..fa8699f9 --- /dev/null +++ b/JAMTests/jamtestvectors @@ -0,0 +1 @@ +Subproject commit fa8699f94b2769cee5d05472072e6a5f839a57ed diff --git a/boka.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/boka.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 750a0863..9de22144 100644 --- a/boka.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/boka.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "c80a60eaf06aa1bc3b9d48f7d3541282e34d308bcc613d98df75ba316c2ca443", + "originHash" : "56133d3e324bc0f87b394a4be85a53c4f93961add021330ea2354a21601638fd", "pins" : [ { "identity" : "async-channels", @@ -64,6 +64,24 @@ "version" : "3.4.0" } }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftlang/swift-syntax.git", + "state" : { + "revision" : "4c6cc0a3b9e8f14b3ae2307c5ccae4de6167ac2c", + "version" : "600.0.0-prerelease-2024-06-12" + } + }, + { + "identity" : "swift-testing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-testing.git", + "state" : { + "branch" : "main", + "revision" : "0e2d9cbb553aba8b9a8acf3d56d1bf042360855f" + } + }, { "identity" : "tuples.swift", "kind" : "remoteSourceControl",