From 3ae4113e33297f98d5d76e688b426a1bc54da954 Mon Sep 17 00:00:00 2001 From: Andrew Wagner <845683+drewag@users.noreply.github.com> Date: Tue, 23 Jul 2019 15:28:11 -0600 Subject: [PATCH] Add Linux support (#117) Only a few minor changes needed to be made for this to work properly on Linux. - Upgraded to Swift 5.0.1 - There was a logical error in XMLStackParser causing a crash on forced unwrapping - Element names returned from the XMLParser on linux have the namespace coming after the name. I put a hack in to reverse them back. - The allTests definitions are no longer relevant. Instead, I used `swift test --generate-linuxmain` --- .swiftlint.yml | 5 +- README.md | 7 +- .../XMLCoder/Auxiliaries/XMLStackParser.swift | 7 +- Tests/LinuxMain.swift | 15 +- .../AttributedEnumIntrinsicTest.swift | 5 - .../AttributedIntrinsicTest.swift | 6 - Tests/XMLCoderTests/BenchmarkTests.swift | 19 - Tests/XMLCoderTests/BooksTest.swift | 4 - Tests/XMLCoderTests/BreakfastTest.swift | 4 - Tests/XMLCoderTests/CDTest.swift | 4 - Tests/XMLCoderTests/ClassTests.swift | 4 - .../DynamicNodeDecodingTest.swift | 6 - .../DynamicNodeEncodingTest.swift | 6 - Tests/XMLCoderTests/ErrorContextTest.swift | 25 +- Tests/XMLCoderTests/Minimal/BoolTests.swift | 6 - .../XMLCoderTests/Minimal/BoxTreeTests.swift | 11 +- Tests/XMLCoderTests/Minimal/DataTests.swift | 10 - Tests/XMLCoderTests/Minimal/DateTests.swift | 9 - .../XMLCoderTests/Minimal/DecimalTests.swift | 6 - Tests/XMLCoderTests/Minimal/EmptyTests.swift | 5 - Tests/XMLCoderTests/Minimal/FloatTests.swift | 6 - Tests/XMLCoderTests/Minimal/IntTests.swift | 6 - .../XMLCoderTests/Minimal/KeyedIntTests.swift | 6 - Tests/XMLCoderTests/Minimal/KeyedTests.swift | 8 - Tests/XMLCoderTests/Minimal/NullTests.swift | 5 - .../XMLCoderTests/Minimal/OptionalTests.swift | 4 - Tests/XMLCoderTests/Minimal/StringTests.swift | 6 - Tests/XMLCoderTests/Minimal/UIntTests.swift | 6 - Tests/XMLCoderTests/Minimal/URLTests.swift | 6 - .../Minimal/UnkeyedIntTests.swift | 4 - .../XMLCoderTests/Minimal/UnkeyedTests.swift | 7 - Tests/XMLCoderTests/NamespaceTest.swift | 97 ++- Tests/XMLCoderTests/NestingTests.swift | 11 - .../NodeEncodingStrategyTests.swift | 6 - Tests/XMLCoderTests/NoteTest.swift | 5 - Tests/XMLCoderTests/PlantTest.swift | 10 +- Tests/XMLCoderTests/RJITest.swift | 4 - Tests/XMLCoderTests/RelationshipsTest.swift | 4 - Tests/XMLCoderTests/SingleChildTests.swift | 5 - Tests/XMLCoderTests/XCTestManifests.swift | 758 ++++++++++++++++++ azure-pipelines.yml | 6 + test_linux.sh | 6 + 42 files changed, 911 insertions(+), 229 deletions(-) create mode 100644 Tests/XMLCoderTests/XCTestManifests.swift create mode 100755 test_linux.sh diff --git a/.swiftlint.yml b/.swiftlint.yml index 501f19e1..ec484261 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -15,4 +15,7 @@ function_body_length: - 50 type_name: - min_length: 1 \ No newline at end of file + min_length: 1 + +excluded: +- Tests/XMLCoderTests/XCTestManifests.swift diff --git a/README.md b/README.md index 292562cd..c332cedd 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Encoder & Decoder for XML using Swift's `Codable` protocols. [![Build Status](https://dev.azure.com/max0484/max/_apis/build/status/MaxDesiatov.XMLCoder?branchName=master)](https://dev.azure.com/max0484/max/_build/latest?definitionId=4&branchName=master) [![Version](https://img.shields.io/cocoapods/v/XMLCoder.svg?style=flat)](https://cocoapods.org/pods/XMLCoder) [![License](https://img.shields.io/cocoapods/l/XMLCoder.svg?style=flat)](https://cocoapods.org/pods/XMLCoder) -[![Platform](https://img.shields.io/cocoapods/p/XMLCoder.svg?style=flat)](https://cocoapods.org/pods/XMLCoder) +[![Platform](https://img.shields.io/badge/platform-watchos%20%7C%20ios%20%7C%20tvos%20%7C%20macos%20%7C%20linux-lightgrey.svg?style=flat)](https://cocoapods.org/pods/XMLCoder) [![Coverage](https://img.shields.io/codecov/c/github/MaxDesiatov/XMLCoder/master.svg?style=flat)](https://codecov.io/gh/maxdesiatov/XMLCoder) This package is a fork of the original @@ -211,10 +211,15 @@ you can now set a property `trimValueWhitespaces` to `false` (the default value ### Requirements +**Apple Platforms** - Xcode 10.0 or later - Swift 4.2 or later - iOS 9.0 / watchOS 2.0 / tvOS 9.0 / macOS 10.10 or later deployment targets +**Linux** +- Ubuntu 14.04 or Later +- Swift 5.0.1 or later + ### Swift Package Manager [Swift Package Manager](https://swift.org/package-manager/) is a tool for diff --git a/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift b/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift index 7d4aae16..07ec9b51 100644 --- a/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift +++ b/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift @@ -44,7 +44,7 @@ class XMLStackParser: NSObject { xmlParser.shouldProcessNamespaces = shouldProcessNamespaces xmlParser.delegate = self - guard !xmlParser.parse(), root == nil else { + guard !xmlParser.parse() || root == nil else { return root! } @@ -126,6 +126,11 @@ extension XMLStackParser: XMLParserDelegate { namespaceURI: String?, qualifiedName: String?, attributes attributeDict: [String: String] = [:]) { + #if os(Linux) + // For some reason, element names on linux are coming out with the namespace after the name + // https://bugs.swift.org/browse/SR-11191 + let elementName = elementName.components(separatedBy: ":").reversed().joined(separator: ":") + #endif let attributes = attributeDict.map { key, value in Attribute(key: key, value: value) } diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift index da995d32..97ddf0cd 100644 --- a/Tests/LinuxMain.swift +++ b/Tests/LinuxMain.swift @@ -1,11 +1,8 @@ import XCTest -@testable import XMLCoderTests -XCTMain([ - testCase(RelationshipsTest.allTests), - testCase(BreakfastTest.allTests), - testCase(NodeEncodingStrategyTests.allTests), - testCase(BooksTest.allTests), - testCase(NoteTest.allTests), - testCase(PlantTest.allTests), -]) +import XMLCoderTests + +var tests = [XCTestCaseEntry]() +tests += XMLCoderTests.__allTests() + +XCTMain(tests) diff --git a/Tests/XMLCoderTests/AttributedEnumIntrinsicTest.swift b/Tests/XMLCoderTests/AttributedEnumIntrinsicTest.swift index d4b7dea7..6e22170c 100644 --- a/Tests/XMLCoderTests/AttributedEnumIntrinsicTest.swift +++ b/Tests/XMLCoderTests/AttributedEnumIntrinsicTest.swift @@ -118,9 +118,4 @@ final class AttributedEnumIntrinsicTest: XCTestCase { // XCTAssertEqual(foo.number[0].type, FooEnum.string("ABC")) // XCTAssertEqual(foo.number[1].type, FooEnum.int(123)) // } - - static var allTests = [ - ("testEncode", testEncode), - // ("testDecode", testDecode), - ] } diff --git a/Tests/XMLCoderTests/AttributedIntrinsicTest.swift b/Tests/XMLCoderTests/AttributedIntrinsicTest.swift index bfbd3de0..f303f0ce 100644 --- a/Tests/XMLCoderTests/AttributedIntrinsicTest.swift +++ b/Tests/XMLCoderTests/AttributedIntrinsicTest.swift @@ -300,10 +300,4 @@ final class AttributedIntrinsicTest: XCTestCase { XCTAssertEqual(foo.valueElement, "blah") XCTAssertNil(foo.value) } - - static var allTests = [ - ("testEncode", testEncode), - ("testDecode", testDecode), - ("testDecodePreview", testDecodePreview), - ] } diff --git a/Tests/XMLCoderTests/BenchmarkTests.swift b/Tests/XMLCoderTests/BenchmarkTests.swift index ec9cd75f..fb72a3c6 100644 --- a/Tests/XMLCoderTests/BenchmarkTests.swift +++ b/Tests/XMLCoderTests/BenchmarkTests.swift @@ -221,23 +221,4 @@ class BenchmarkTests: XCTestCase { self.measure { closure() } } } - - static var allTests = [ - ("testEncodeNulls", testEncodeNulls), - ("testDecodeNulls", testDecodeNulls), - ("testEncodeBools", testEncodeBools), - ("testDecodeBools", testDecodeBools), - ("testEncodeInts", testEncodeInts), - ("testDecodeInts", testDecodeInts), - ("testEncodeUInts", testEncodeUInts), - ("testDecodeUInts", testDecodeUInts), - ("testEncodeFloats", testEncodeFloats), - ("testDecodeFloats", testDecodeFloats), - ("testEncodeDecimals", testEncodeDecimals), - ("testDecodeDecimals", testDecodeDecimals), - ("testEncodeArrays", testEncodeArrays), - ("testDecodeArrays", testDecodeArrays), - ("testEncodeDictionaries", testEncodeDictionaries), - ("testDecodeDictionaries", testDecodeDictionaries), - ] } diff --git a/Tests/XMLCoderTests/BooksTest.swift b/Tests/XMLCoderTests/BooksTest.swift index ba82330a..bb927291 100644 --- a/Tests/XMLCoderTests/BooksTest.swift +++ b/Tests/XMLCoderTests/BooksTest.swift @@ -242,8 +242,4 @@ final class BooksTest: XCTestCase { let catalog2 = try decoder.decode(Catalog.self, from: data) XCTAssertEqual(catalog1, catalog2) } - - static var allTests = [ - ("testBookXML", testBookXML), - ] } diff --git a/Tests/XMLCoderTests/BreakfastTest.swift b/Tests/XMLCoderTests/BreakfastTest.swift index dba56019..5b5b5cb6 100644 --- a/Tests/XMLCoderTests/BreakfastTest.swift +++ b/Tests/XMLCoderTests/BreakfastTest.swift @@ -70,8 +70,4 @@ final class BreakfastTest: XCTestCase { let menu2 = try decoder.decode(Menu.self, from: data) XCTAssertEqual(menu1, menu2) } - - static var allTests = [ - ("testXML", testXML), - ] } diff --git a/Tests/XMLCoderTests/CDTest.swift b/Tests/XMLCoderTests/CDTest.swift index 8734ce8c..3e81bd52 100644 --- a/Tests/XMLCoderTests/CDTest.swift +++ b/Tests/XMLCoderTests/CDTest.swift @@ -60,8 +60,4 @@ final class CDTest: XCTestCase { XCTAssertEqual(cdCatalog1, cdCatalog2) } - - static var allTests = [ - ("testXML", testXML), - ] } diff --git a/Tests/XMLCoderTests/ClassTests.swift b/Tests/XMLCoderTests/ClassTests.swift index d2df63fe..23d23a0b 100644 --- a/Tests/XMLCoderTests/ClassTests.swift +++ b/Tests/XMLCoderTests/ClassTests.swift @@ -108,8 +108,4 @@ class ClassTests: XCTestCase { XCTAssertEqual(encoded, xmlData) } - - static var allTests = [ - ("testEmpty", testEmpty), - ] } diff --git a/Tests/XMLCoderTests/DynamicNodeDecodingTest.swift b/Tests/XMLCoderTests/DynamicNodeDecodingTest.swift index 86e7ce7d..59e8f7f6 100644 --- a/Tests/XMLCoderTests/DynamicNodeDecodingTest.swift +++ b/Tests/XMLCoderTests/DynamicNodeDecodingTest.swift @@ -217,10 +217,4 @@ final class DynamicNodeDecodingTest: XCTestCase { let test = try decoder.decode(TestStruct.self, from: overlappingKeys) XCTAssertEqual(test, TestStruct(attribute: 123, element: "StringValue")) } - - static var allTests = [ - ("testDecode", testDecode), - ("testStrategyPriority", testStrategyPriority), - ("testOverlappingKeys", testOverlappingKeys), - ] } diff --git a/Tests/XMLCoderTests/DynamicNodeEncodingTest.swift b/Tests/XMLCoderTests/DynamicNodeEncodingTest.swift index bf7d4b9e..4bdf95c5 100644 --- a/Tests/XMLCoderTests/DynamicNodeEncodingTest.swift +++ b/Tests/XMLCoderTests/DynamicNodeEncodingTest.swift @@ -277,10 +277,4 @@ final class DynamicNodeEncodingTest: XCTestCase { encoding: "UTF-8")) XCTAssertEqual(String(data: data, encoding: .utf8)!, libraryXMLYNStrategy) } - - static var allTests = [ - ("testEncode", testEncode), - ("testDecode", testDecode), - ("testEncodeDecode", testEncodeDecode), - ] } diff --git a/Tests/XMLCoderTests/ErrorContextTest.swift b/Tests/XMLCoderTests/ErrorContextTest.swift index a401bebb..d23bbe64 100644 --- a/Tests/XMLCoderTests/ErrorContextTest.swift +++ b/Tests/XMLCoderTests/ErrorContextTest.swift @@ -29,11 +29,21 @@ final class ErrorContextTest: XCTestCase { return } + #if os(Linux) + // XML Parser returns a different column on Linux + // https://bugs.swift.org/browse/SR-11192 + XCTAssertEqual(ctx.debugDescription, """ + \(underlying.localizedDescription) \ + at line 1, column 7: + `ah //>` + """) + #else XCTAssertEqual(ctx.debugDescription, """ \(underlying.localizedDescription) \ at line 1, column 2: ` + ") } - - static var allTests = [ - ("testAttribute", testAttribute), - ("testElement", testElement), - ] } diff --git a/Tests/XMLCoderTests/Minimal/FloatTests.swift b/Tests/XMLCoderTests/Minimal/FloatTests.swift index 31b2aff5..6ae82617 100644 --- a/Tests/XMLCoderTests/Minimal/FloatTests.swift +++ b/Tests/XMLCoderTests/Minimal/FloatTests.swift @@ -75,10 +75,4 @@ class FloatTests: XCTestCase { XCTAssertEqual(String(data: encoded, encoding: .utf8)!, xmlString) } } - - static var allTests = [ - ("testMissing", testMissing), - ("testAttribute", testAttribute), - ("testElement", testElement), - ] } diff --git a/Tests/XMLCoderTests/Minimal/IntTests.swift b/Tests/XMLCoderTests/Minimal/IntTests.swift index 82c84adc..f3d28a85 100644 --- a/Tests/XMLCoderTests/Minimal/IntTests.swift +++ b/Tests/XMLCoderTests/Minimal/IntTests.swift @@ -74,10 +74,4 @@ class IntTests: XCTestCase { XCTAssertEqual(String(data: encoded, encoding: .utf8)!, xmlString) } } - - static var allTests = [ - ("testMissing", testMissing), - ("testAttribute", testAttribute), - ("testElement", testElement), - ] } diff --git a/Tests/XMLCoderTests/Minimal/KeyedIntTests.swift b/Tests/XMLCoderTests/Minimal/KeyedIntTests.swift index 05703fd2..b3bdd9e0 100644 --- a/Tests/XMLCoderTests/Minimal/KeyedIntTests.swift +++ b/Tests/XMLCoderTests/Minimal/KeyedIntTests.swift @@ -193,10 +193,4 @@ class KeyedIntTests: XCTestCase { try testElement(ContainerUInt32.self) try testElement(ContainerUInt64.self) } - - static var allTests = [ - ("testIntegerTypeMissing", testIntegerTypeMissing), - ("testIntegerTypeAttribute", testIntegerTypeAttribute), - ("testIntegerTypeElement", testIntegerTypeElement), - ] } diff --git a/Tests/XMLCoderTests/Minimal/KeyedTests.swift b/Tests/XMLCoderTests/Minimal/KeyedTests.swift index 9fd9e1e0..7177ebca 100644 --- a/Tests/XMLCoderTests/Minimal/KeyedTests.swift +++ b/Tests/XMLCoderTests/Minimal/KeyedTests.swift @@ -149,12 +149,4 @@ class KeyedTests: XCTestCase { XCTAssertEqual(decoded.valUe, ["foo": 12]) } - - static var allTests = [ - ("testEmpty", testEmpty), - ("testSingleElement", testSingleElement), - ("testMultiElement", testMultiElement), - ("testAttribute", testAttribute), - ("testConvertFromSnakeCase", testConvertFromSnakeCase), - ] } diff --git a/Tests/XMLCoderTests/Minimal/NullTests.swift b/Tests/XMLCoderTests/Minimal/NullTests.swift index b4d5efef..8cb84308 100644 --- a/Tests/XMLCoderTests/Minimal/NullTests.swift +++ b/Tests/XMLCoderTests/Minimal/NullTests.swift @@ -52,9 +52,4 @@ class NullTests: XCTestCase { let encoded = try encoder.encode(decoded, withRootKey: "container") XCTAssertEqual(String(data: encoded, encoding: .utf8)!, xmlString) } - - static var allTests = [ - ("testAttribute", testAttribute), - ("testElement", testElement), - ] } diff --git a/Tests/XMLCoderTests/Minimal/OptionalTests.swift b/Tests/XMLCoderTests/Minimal/OptionalTests.swift index a661fe33..d16af2c7 100644 --- a/Tests/XMLCoderTests/Minimal/OptionalTests.swift +++ b/Tests/XMLCoderTests/Minimal/OptionalTests.swift @@ -73,8 +73,4 @@ class OptionalTests: XCTestCase { let decoded2 = try decoder.decode(DecodeIfPresent.self, from: xml) XCTAssertEqual(decoded2, DecodeIfPresent()) } - - static var allTests = [ - ("testMissing", testMissing), - ] } diff --git a/Tests/XMLCoderTests/Minimal/StringTests.swift b/Tests/XMLCoderTests/Minimal/StringTests.swift index 50bbe93b..ea5d6981 100644 --- a/Tests/XMLCoderTests/Minimal/StringTests.swift +++ b/Tests/XMLCoderTests/Minimal/StringTests.swift @@ -79,10 +79,4 @@ class StringTests: XCTestCase { XCTAssertEqual(String(data: encoded, encoding: .utf8)!, xmlString) } } - - static var allTests = [ - ("testMissing", testMissing), - ("testAttribute", testAttribute), - ("testElement", testElement), - ] } diff --git a/Tests/XMLCoderTests/Minimal/UIntTests.swift b/Tests/XMLCoderTests/Minimal/UIntTests.swift index e3010a0a..9a60bbac 100644 --- a/Tests/XMLCoderTests/Minimal/UIntTests.swift +++ b/Tests/XMLCoderTests/Minimal/UIntTests.swift @@ -74,10 +74,4 @@ class UIntTests: XCTestCase { XCTAssertEqual(String(data: encoded, encoding: .utf8)!, xmlString) } } - - static var allTests = [ - ("testMissing", testMissing), - ("testAttribute", testAttribute), - ("testElement", testElement), - ] } diff --git a/Tests/XMLCoderTests/Minimal/URLTests.swift b/Tests/XMLCoderTests/Minimal/URLTests.swift index 2e7a9c0f..3aece69a 100644 --- a/Tests/XMLCoderTests/Minimal/URLTests.swift +++ b/Tests/XMLCoderTests/Minimal/URLTests.swift @@ -74,10 +74,4 @@ class URLTests: XCTestCase { XCTAssertEqual(String(data: encoded, encoding: .utf8)!, xmlString) } } - - static var allTests = [ - ("testMissing", testMissing), - ("testAttribute", testAttribute), - ("testElement", testElement), - ] } diff --git a/Tests/XMLCoderTests/Minimal/UnkeyedIntTests.swift b/Tests/XMLCoderTests/Minimal/UnkeyedIntTests.swift index ba2bc209..148d8a53 100644 --- a/Tests/XMLCoderTests/Minimal/UnkeyedIntTests.swift +++ b/Tests/XMLCoderTests/Minimal/UnkeyedIntTests.swift @@ -178,8 +178,4 @@ class UnkeyedIntTests: XCTestCase { try testInt(UnkeyedContainerUInt32.self) try testInt(UnkeyedContainerUInt64.self) } - - static var allTests = [ - ("testInts", testInts), - ] } diff --git a/Tests/XMLCoderTests/Minimal/UnkeyedTests.swift b/Tests/XMLCoderTests/Minimal/UnkeyedTests.swift index 203acd2b..7033f1ab 100644 --- a/Tests/XMLCoderTests/Minimal/UnkeyedTests.swift +++ b/Tests/XMLCoderTests/Minimal/UnkeyedTests.swift @@ -128,11 +128,4 @@ class UnkeyedTests: XCTestCase { try encoder.encode(container, withRootKey: "container") ) } - - static var allTests = [ - ("testEmpty", testEmpty), - ("testSingleElement", testSingleElement), - ("testMultiElement", testMultiElement), - ("testAttribute", testAttribute), - ] } diff --git a/Tests/XMLCoderTests/NamespaceTest.swift b/Tests/XMLCoderTests/NamespaceTest.swift index 2a193786..eb3ee9af 100644 --- a/Tests/XMLCoderTests/NamespaceTest.swift +++ b/Tests/XMLCoderTests/NamespaceTest.swift @@ -26,6 +26,22 @@ private struct Table: Codable, Equatable { let tr: [TR] } +private struct NamespacedTable: Codable, Equatable { + struct TR: Codable, Equatable { + enum CodingKeys: String, CodingKey { + case td = "h:td" + } + + let td: [String] + } + + enum CodingKeys: String, CodingKey { + case tr = "h:tr" + } + + let tr: [TR] +} + private let worksheetXML = """ [XCTestCaseEntry] { + return [ + testCase(AttributedEnumIntrinsicTest.__allTests__AttributedEnumIntrinsicTest), + testCase(AttributedIntrinsicTest.__allTests__AttributedIntrinsicTest), + testCase(BenchmarkTests.__allTests__BenchmarkTests), + testCase(BooksTest.__allTests__BooksTest), + testCase(BoolBoxTests.__allTests__BoolBoxTests), + testCase(BoolTests.__allTests__BoolTests), + testCase(BorderTest.__allTests__BorderTest), + testCase(BoxTreeTests.__allTests__BoxTreeTests), + testCase(BreakfastTest.__allTests__BreakfastTest), + testCase(CDTest.__allTests__CDTest), + testCase(ClassTests.__allTests__ClassTests), + testCase(DataBoxTests.__allTests__DataBoxTests), + testCase(DataTests.__allTests__DataTests), + testCase(DateBoxTests.__allTests__DateBoxTests), + testCase(DateTests.__allTests__DateTests), + testCase(DecimalBoxTests.__allTests__DecimalBoxTests), + testCase(DecimalTests.__allTests__DecimalTests), + testCase(DecodingContainerTests.__allTests__DecodingContainerTests), + testCase(DynamicNodeDecodingTest.__allTests__DynamicNodeDecodingTest), + testCase(DynamicNodeEncodingTest.__allTests__DynamicNodeEncodingTest), + testCase(EmptyTests.__allTests__EmptyTests), + testCase(ErrorContextTest.__allTests__ErrorContextTest), + testCase(FloatBoxTests.__allTests__FloatBoxTests), + testCase(FloatTests.__allTests__FloatTests), + testCase(IntBoxTests.__allTests__IntBoxTests), + testCase(IntTests.__allTests__IntTests), + testCase(KeyDecodingAndEncodingStrategyTests.__allTests__KeyDecodingAndEncodingStrategyTests), + testCase(KeyedBoxTests.__allTests__KeyedBoxTests), + testCase(KeyedIntTests.__allTests__KeyedIntTests), + testCase(KeyedTests.__allTests__KeyedTests), + testCase(MixedContainerTest.__allTests__MixedContainerTest), + testCase(NameSpaceTest.__allTests__NameSpaceTest), + testCase(NestingTests.__allTests__NestingTests), + testCase(NodeEncodingStrategyTests.__allTests__NodeEncodingStrategyTests), + testCase(NoteTest.__allTests__NoteTest), + testCase(NullBoxTests.__allTests__NullBoxTests), + testCase(NullTests.__allTests__NullTests), + testCase(OptionalTests.__allTests__OptionalTests), + testCase(PlantTest.__allTests__PlantTest), + testCase(RJITest.__allTests__RJITest), + testCase(RelationshipsTest.__allTests__RelationshipsTest), + testCase(SharedBoxTests.__allTests__SharedBoxTests), + testCase(SingleChildTest.__allTests__SingleChildTest), + testCase(SpacePreserveTest.__allTests__SpacePreserveTest), + testCase(StringBoxTests.__allTests__StringBoxTests), + testCase(StringExtensionsTests.__allTests__StringExtensionsTests), + testCase(StringTests.__allTests__StringTests), + testCase(UIntBoxTests.__allTests__UIntBoxTests), + testCase(UIntTests.__allTests__UIntTests), + testCase(URLBoxTests.__allTests__URLBoxTests), + testCase(URLTests.__allTests__URLTests), + testCase(UnkeyedBoxTests.__allTests__UnkeyedBoxTests), + testCase(UnkeyedIntTests.__allTests__UnkeyedIntTests), + testCase(UnkeyedTests.__allTests__UnkeyedTests), + testCase(XMLElementTests.__allTests__XMLElementTests), + testCase(XMLHeaderTests.__allTests__XMLHeaderTests), + testCase(XMLKeyTests.__allTests__XMLKeyTests), + testCase(XMLStackParserTests.__allTests__XMLStackParserTests), + ] +} +#endif diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2723c386..1b090d11 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -43,3 +43,9 @@ jobs: vmImage: 'macos-latest' steps: - script: ./test_swiftpm.sh +- job: test_linux + pool: + vmImage: 'Ubuntu 16.04' + container: norionomura/swift:501 + steps: + - script: ./test_linux.sh diff --git a/test_linux.sh b/test_linux.sh new file mode 100755 index 00000000..93b39628 --- /dev/null +++ b/test_linux.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e +set -o pipefail + +swift test