Script to generate test Swift function names for XCTest on Linux
⚠️ While this project was never really maintained, it's now officially DEPRECATED. It will receive no further maintenance.
Currently when using XCTest on Linux you have to manually declare all tests to be ran, which is an annoying chore that can be automated with this super naive generator. Just run it in your test directory and it will print out exactly the code that you need to copy into your test classes.
Just clone this repo and run
swift /path/to/SwiftXCTestLinuxNameGenerator.swift /absolute/path/to/YourXCTestCaseFile.swift
The generator will print out the code you need to copy into your test file (above/below your test case class).
➜ for i in *swift; do swift ../../../SwiftXCTestLinuxNameGenerator/SwiftXCTestLinuxNameGenerator.swift $PWD/$i; done
Output:
Using /Users/honzadvorsky/Documents/Jay/Tests/Jay/ConstsTests.swift
Copy the lines below into your testcase file
----------------------------------------------
#if os(Linux)
extension ConstsTests: XCTestCaseProvider {
var allTests : [(String, () throws -> Void)] {
return [
("testConsts", testConsts),
("testUnicodeTesting", testUnicodeTesting)
]
}
}
#endif
----------------------------------------------
Please create an issue with a description of your problem or open a pull request with a fix.
MIT
Honza Dvorsky - http://honzadvorsky.com, @czechboy0