Skip to content

czechboy0-deprecated/SwiftXCTestLinuxNameGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

[DEPRECATED] SwiftXCTestLinuxNameGenerator

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.

Why?

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).

Run for all test Swift files in a directory

➜ 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
----------------------------------------------

💝 Contributing

Please create an issue with a description of your problem or open a pull request with a fix.

✌️ License

MIT

👽 Author

Honza Dvorsky - http://honzadvorsky.com, @czechboy0

About

Script to generate test Swift function names for XCTest on Linux

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages