Fixes a crashing URL test on Linux
Apparently, Foundation's URL#appendingPathComponent crashes cryptically on Linux if you pass it an empty string. Isn't that fun?
This commit is contained in:
parent
44fde33a21
commit
47687d66d0
|
@ -32,8 +32,10 @@ public struct APIVersion {
|
|||
}
|
||||
|
||||
func url(for path: String) -> URL {
|
||||
baseURL
|
||||
.appendingPathComponent(version)
|
||||
.appendingPathComponent(path)
|
||||
let url = baseURL.appendingPathComponent(version)
|
||||
guard !path.isEmpty else {
|
||||
return url
|
||||
}
|
||||
return url.appendingPathComponent(path)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,210 +0,0 @@
|
|||
#if !canImport(ObjectiveC)
|
||||
import XCTest
|
||||
|
||||
extension AccessTokensTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__AccessTokensTests = [
|
||||
("testAccessTokenDelete", testAccessTokenDelete),
|
||||
("testAccessTokenGet", testAccessTokenGet),
|
||||
]
|
||||
}
|
||||
|
||||
extension AgentsTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__AgentsTests = [
|
||||
("testAgentsGet", testAgentsGet),
|
||||
("testAgentsList", testAgentsList),
|
||||
("testAgentsStop", testAgentsStop),
|
||||
]
|
||||
}
|
||||
|
||||
extension AnnotationsTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__AnnotationsTests = [
|
||||
("testAnnotationsList", testAnnotationsList),
|
||||
]
|
||||
}
|
||||
|
||||
extension ArtifactsTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__ArtifactsTests = [
|
||||
("testArtifactsDelete", testArtifactsDelete),
|
||||
("testArtifactsDownload", testArtifactsDownload),
|
||||
("testArtifactsGet", testArtifactsGet),
|
||||
("testArtifactsListByBuild", testArtifactsListByBuild),
|
||||
("testArtifactsListByJob", testArtifactsListByJob),
|
||||
]
|
||||
}
|
||||
|
||||
extension BuildkiteTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__BuildkiteTests = [
|
||||
("testClosureBasedRequest", testClosureBasedRequest),
|
||||
("testClosureBasedRequestHasBody", testClosureBasedRequestHasBody),
|
||||
("testClosureBasedRequestHasBodyWithPagination", testClosureBasedRequestHasBodyWithPagination),
|
||||
("testClosureBasedRequestInvalidResponse", testClosureBasedRequestInvalidResponse),
|
||||
("testClosureBasedRequestNoContent", testClosureBasedRequestNoContent),
|
||||
("testClosureBasedRequestUnsuccessfulResponse", testClosureBasedRequestUnsuccessfulResponse),
|
||||
("testClosureBasedRequestWithPagination", testClosureBasedRequestWithPagination),
|
||||
("testFailureFromTransport", testFailureFromTransport),
|
||||
]
|
||||
}
|
||||
|
||||
extension BuildsTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__BuildsTests = [
|
||||
("testBuildsCancel", testBuildsCancel),
|
||||
("testBuildsCreate", testBuildsCreate),
|
||||
("testBuildsGet", testBuildsGet),
|
||||
("testBuildsListAllDefaultQuery", testBuildsListAllDefaultQuery),
|
||||
("testBuildsListAllSpecializedQuery", testBuildsListAllSpecializedQuery),
|
||||
("testBuildsListForOrganization", testBuildsListForOrganization),
|
||||
("testBuildsListForPipeline", testBuildsListForPipeline),
|
||||
("testBuildsRebuild", testBuildsRebuild),
|
||||
]
|
||||
}
|
||||
|
||||
extension EmojisTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__EmojisTests = [
|
||||
("testEmojisList", testEmojisList),
|
||||
]
|
||||
}
|
||||
|
||||
extension GraphQLTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__GraphQLTests = [
|
||||
("testGraphQL", testGraphQL),
|
||||
]
|
||||
}
|
||||
|
||||
extension JSONValueTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__JSONValueTests = [
|
||||
("testArrayRoundTrip", testArrayRoundTrip),
|
||||
("testBoolRoundTrip", testBoolRoundTrip),
|
||||
("testComplexObjectRoundTrip", testComplexObjectRoundTrip),
|
||||
("testDecodeArray", testDecodeArray),
|
||||
("testDecodeBool", testDecodeBool),
|
||||
("testDecodeDouble", testDecodeDouble),
|
||||
("testDecodeNull", testDecodeNull),
|
||||
("testDecodeString", testDecodeString),
|
||||
("testDoubleRoundTrip", testDoubleRoundTrip),
|
||||
("testLetsNestSomeObjectsLikeCrazyRoundTrip", testLetsNestSomeObjectsLikeCrazyRoundTrip),
|
||||
("testNullRoundTrip", testNullRoundTrip),
|
||||
("testStringRoundTrip", testStringRoundTrip),
|
||||
]
|
||||
}
|
||||
|
||||
extension JobsTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__JobsTests = [
|
||||
("testJobsDeleteLogOutput", testJobsDeleteLogOutput),
|
||||
("testJobsEnvironmentVariables", testJobsEnvironmentVariables),
|
||||
("testJobsLogOutput", testJobsLogOutput),
|
||||
("testJobsRetry", testJobsRetry),
|
||||
("testJobsUnblock", testJobsUnblock),
|
||||
]
|
||||
}
|
||||
|
||||
extension OrganizationsTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__OrganizationsTests = [
|
||||
("testOrganizationsGet", testOrganizationsGet),
|
||||
("testOrganizationsList", testOrganizationsList),
|
||||
]
|
||||
}
|
||||
|
||||
extension PipelinesTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__PipelinesTests = [
|
||||
("testPipelinesCreate", testPipelinesCreate),
|
||||
("testPipelinesDelete", testPipelinesDelete),
|
||||
("testPipelinesGet", testPipelinesGet),
|
||||
("testPipelinesList", testPipelinesList),
|
||||
("testPipelinesUpdate", testPipelinesUpdate),
|
||||
]
|
||||
}
|
||||
|
||||
extension StatusCodeTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__StatusCodeTests = [
|
||||
("testFlag", testFlag),
|
||||
]
|
||||
}
|
||||
|
||||
extension TeamsTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__TeamsTests = [
|
||||
("testTeamsList", testTeamsList),
|
||||
]
|
||||
}
|
||||
|
||||
extension TransportTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__TransportTests = [
|
||||
("testURLSessionSendClosureBasedRequest", testURLSessionSendClosureBasedRequest),
|
||||
("testURLSessionSendClosureBasedRequestFailure", testURLSessionSendClosureBasedRequestFailure),
|
||||
]
|
||||
}
|
||||
|
||||
extension UsersTests {
|
||||
// DO NOT MODIFY: This is autogenerated, use:
|
||||
// `swift test --generate-linuxmain`
|
||||
// to regenerate.
|
||||
static let __allTests__UsersTests = [
|
||||
("testUserMe", testUserMe),
|
||||
]
|
||||
}
|
||||
|
||||
public func __allTests() -> [XCTestCaseEntry] {
|
||||
return [
|
||||
testCase(AccessTokensTests.__allTests__AccessTokensTests),
|
||||
testCase(AgentsTests.__allTests__AgentsTests),
|
||||
testCase(AnnotationsTests.__allTests__AnnotationsTests),
|
||||
testCase(ArtifactsTests.__allTests__ArtifactsTests),
|
||||
testCase(BuildkiteTests.__allTests__BuildkiteTests),
|
||||
testCase(BuildsTests.__allTests__BuildsTests),
|
||||
testCase(EmojisTests.__allTests__EmojisTests),
|
||||
testCase(GraphQLTests.__allTests__GraphQLTests),
|
||||
testCase(JSONValueTests.__allTests__JSONValueTests),
|
||||
testCase(JobsTests.__allTests__JobsTests),
|
||||
testCase(OrganizationsTests.__allTests__OrganizationsTests),
|
||||
testCase(PipelinesTests.__allTests__PipelinesTests),
|
||||
testCase(StatusCodeTests.__allTests__StatusCodeTests),
|
||||
testCase(TeamsTests.__allTests__TeamsTests),
|
||||
testCase(TransportTests.__allTests__TransportTests),
|
||||
testCase(UsersTests.__allTests__UsersTests),
|
||||
]
|
||||
}
|
||||
#endif
|
|
@ -1,8 +1,2 @@
|
|||
import XCTest
|
||||
|
||||
import BuildkiteTests
|
||||
|
||||
var tests = [XCTestCaseEntry]()
|
||||
tests += BuildkiteTests.__allTests()
|
||||
|
||||
XCTMain(tests)
|
||||
// LinuxMain.swift
|
||||
fatalError("Run the tests with `swift test --enable-test-discovery`.")
|
Loading…
Reference in New Issue