gucoordinates
tests.swift
Go to the documentation of this file.
1//
2/*
3 * tests.swift
4 * tests
5 *
6 * Created by Callum McColl on 22/6/20.
7 * Copyright © 2020 Callum McColl. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer in the documentation and/or other materials
19 * provided with the distribution.
20 *
21 * 3. All advertising materials mentioning features or use of this
22 * software must display the following acknowledgement:
23 *
24 * This product includes software developed by Callum McColl.
25 *
26 * 4. Neither the name of the author nor the names of contributors
27 * may be used to endorse or promote products derived from this
28 * software without specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
34 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
37 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
38 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
39 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 *
42 * -----------------------------------------------------------------------
43 * This program is free software; you can redistribute it and/or
44 * modify it under the above terms or under the terms of the GNU
45 * General Public License as published by the Free Software Foundation;
46 * either version 2 of the License, or (at your option) any later version.
47 *
48 * This program is distributed in the hope that it will be useful,
49 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 * GNU General Public License for more details.
52 *
53 * You should have received a copy of the GNU General Public License
54 * along with this program; if not, see http://www.gnu.org/licenses/
55 * or write to the Free Software Foundation, Inc., 51 Franklin Street,
56 * Fifth Floor, Boston, MA 02110-1301, USA.
57 *
58 */
59
60import Foundation
61import XCTest
62
63class tests: XCTestCase {
64
65 private func launch(target: String) {
66 guard let srcDir = Bundle.allBundles.compactMap({ $0.object(forInfoDictionaryKey: "SRCROOT") }).first as? String else {
67 XCTFail("Unable to get SRCROOT")
68 return
69 }
70 let p = Process()
71 p.currentDirectoryPath = srcDir
72 p.launchPath = "/usr/local/bin/bmake"
73 p.arguments = [target]
74 p.launch()
75 p.waitUntilExit()
76 XCTAssertEqual(p.terminationStatus, 0)
77 }
78
79 func test_ctests() {
80 self.launch(target: "ctest")
81 }
82
83 func test_cpp98tests() {
84 self.launch(target: "cpp98test")
85 }
86
87 func test_cpp03tests() {
88 self.launch(target: "cpp03test")
89 }
90
91 func test_cpp11tests() {
92 self.launch(target: "cpp11test")
93 }
94
95 func test_cpp14tests() {
96 self.launch(target: "cpp14test")
97 }
98
99 func test_cpp17tests() {
100 self.launch(target: "cpp17test")
101 }
102
103}