Skip to content

Commit

Permalink
Added simple test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert F. Dickerson committed Apr 15, 2016
1 parent 34db8ee commit 95a91bb
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
58 changes: 58 additions & 0 deletions Tests/HeliumLogger/TestLogger.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Copyright IBM Corporation 2016
*
* 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
import XCTest

@testable import HeliumLogger
@testable import LoggerAPI

#if os(Linux)
import Glibc
#else
import Darwin
#endif

class TestLogger : XCTestCase {

static var allTests : [(String, TestLogger -> () throws -> Void)] {
return [
("testInfo", testInfo),
("testWarning", testWarning),
("testError", testError),
]
}


func testInfo() {
Log.logger = HeliumLogger()
Log.info("This is an error")

}

func testWarning() {
Log.logger = HeliumLogger()
Log.warning("This is an error")

}

func testError() {
Log.logger = HeliumLogger()
Log.error("This is an error")

}

}
23 changes: 23 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright IBM Corporation 2016
*
* 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 XCTest

@testable import KituraTestSuite

XCTMain([
testCase(TestLogger.allTests),
])

0 comments on commit 95a91bb

Please sign in to comment.