Commit a3c85ab6 authored by Drew's avatar Drew

Linux CI

parent c8af58a3
Pipeline #728 passed with stage
FROM drewcrawford/swift:latest
RUN apt-get update && apt-get install --no-install-recommends xz-utils -y
ADD https://github.com/AnarchyTools/atbuild/releases/download/0.3.0/atbuild-0.3.0-linux.tar.xz /atbuild.tar.xz
RUN tar xf atbuild.tar.xz -C /usr/local
ADD . /atpkg
WORKDIR atpkg
RUN atbuild run-tests
// Copyright (c) 2016 Anarchy Tools Contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import Foundation
//SR-138
extension String {
var toNSString: NSString {
#if os(Linux)
return self.bridge()
#elseif os(OSX)
return (self as NSString)
#endif
}
}
extension NSString {
var toString: String {
#if os(Linux)
return self.bridge()
#elseif os(OSX)
return (self as String)
#endif
}
}
\ No newline at end of file
......@@ -15,6 +15,11 @@
// NOTE: This is the crappiest test thing ever... but it works for now.
import Foundation
//SR-567
#if os(Linux)
import Glibc
#endif
extension String : ErrorType {}
enum test {
......@@ -51,7 +56,6 @@ extension Test {
}
}
print()
let tests: [Test] = [
// NOTE: Add your test classes here...
......@@ -67,5 +71,4 @@ for test in tests {
passed = passed && test.runTests()
}
print()
if !passed { exit(1) }
\ No newline at end of file
......@@ -44,7 +44,7 @@ class LexerTests: Test {
static func testBasic() throws {
let filepath = "./tests/collateral/basic.atpkg"
let content: String = try NSString(contentsOfFile: filepath, encoding: NSUTF8StringEncoding) as String
let content: String = try NSString(contentsOfFile: filepath, encoding: NSUTF8StringEncoding).toString
let scanner = Scanner(content: content)
let lexer = Lexer(scanner: scanner)
......
......@@ -46,7 +46,7 @@ class ScannerTests: Test {
static func testBasicClj() throws {
let filepath = "./tests/collateral/basic.atpkg"
let content: String = try NSString(contentsOfFile: filepath, encoding: NSUTF8StringEncoding) as String
let content: String = try NSString(contentsOfFile: filepath, encoding: NSUTF8StringEncoding).toString
let scanner = Scanner(content: content)
try test.assert(scanner.next()?.character == ";")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment