Successful tests on Linux - steps need to be done
Closed this issue · 1 comments
rbukovansky commented
Hi, it seems that Guaka can be build on Linux, but tests are not working. This needs to happen to get swift test
running:
- In
Tests/LinuxMain.swift
you need to change:
@testable import ProcessTests
to
@testable import GuakaTests
- All classes
*Tests
in files of directoryTests/GuakaTests
need to have static variable calledallTests
like this one:
static var allTests : [(String, (CommandArgumentsTests) -> () throws -> Void)] {
return [
("testEmptySignature", testEmptySignature),
("testRequiredArguments", testRequiredArguments),
("testOptionalArguments", testOptionalArguments),
("testExtraneousArguments", testExtraneousArguments),
("testNonTerminalWithRequiredArguments", testNonTerminalWithRequiredArguments),
("testNonTerminalWithOptionalArguments", testNonTerminalWithOptionalArguments),
("testParameterPlacement", testParameterPlacement),
("testCombinedRequiredAndOptionalArguments", testCombinedRequiredAndOptionalArguments),
("testEmptyOptionalCollectedParameter", testEmptyOptionalCollectedParameter),
("testQuotedArguments", testQuotedArguments)
]
}
- When 2. is done, then
Tests/LinuxMain.swift
needs to have similar definition ofXTCMain
like this one:
XCTMain([
testCase(CommandArgumentsTests.allTests),
testCase(CommandMessageGeneratorTests.allTests),
testCase(OptionsTests.allTests),
testCase(RouterTests.allTests),
testCase(SwiftCLITests.allTests)
])
This all will make sure, that swift test
on Linux will run all tests.
I would submit PR for this, but I'm not sure if there is order to those tests if any, so I wouldn't like to mess it up.
PS: Examples taken from similar framework called SwiftCLI
: https://github.com/jakeheis/SwiftCLI
goyox86 commented
Hey @rbukovansky feel free to submit the PR! After all we are on git and if we mess something up we can go back and try again a different approach ;)