diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dd74479 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + build: + name: Tests + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # 2.3.4 + + - name: Run Tests in Docker + run: bin/run-tests-in-docker.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 9599840..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: CI - -on: - pull_request: - branches: - - master - paths-ignore: - - '.gitignore' - - 'LICENSE' - - '**.md' - push: - branches: - - master - paths-ignore: - - '.gitignore' - - 'LICENSE' - - '**.md' - -jobs: - build: - name: Test Runner - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - - name: Build Docker Image - run: docker build -f Dockerfile -t generic-test-runner . - - - name: Run Tests - run: docker run -w "/opt/test-runner" --entrypoint "bin/run-all.sh" generic-test-runner diff --git a/.gitignore b/.gitignore index a948af2..0300688 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ -test/output/ .DS_Store **/.build **/Packages **/Package.resolved **/*.xcodeproj + +tests/*/results.json +tests/*/.swiftpm/ diff --git a/Dockerfile b/Dockerfile index 8c0f8de..eac3673 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,13 @@ -FROM swift:latest AS builder -# WORKDIR /opt/testrunner +FROM swift:5.3.3-bionic AS builder + COPY src/testrunner ./ -# Print Installed Swift Version RUN swift --version -#RUN swift package clean RUN swift build --configuration release -FROM swift:latest +FROM swift:5.3.3-bionic WORKDIR /opt/test-runner/ COPY bin/ bin/ COPY --from=builder /.build/release/TestRunner bin/ -ENV NAME RUNALL - -ENTRYPOINT ["./bin/run.sh"] -# ENTRYPOINT ["bin/TestRunner", "--help"] +ENTRYPOINT ["/opt/test-runner/bin/run.sh"] diff --git a/bin/run-all-in-docker.sh b/bin/run-all-in-docker.sh deleted file mode 100755 index b1f5bbe..0000000 --- a/bin/run-all-in-docker.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/bash -e - -SOLUTION_DIR="${1:-dockerTest}" - -# build docker image -docker build --rm --no-cache -t swift-test-runner . - -docker run \ - --mount type=bind,src=$PWD/$SOLUTION_DIR/,dst=/solution \ - --mount type=bind,src=$PWD/$SOLUTION_DIR/output/,dst=/output \ - --entrypoint './bin/run-all.sh' swift-test-runner diff --git a/bin/run-all.sh b/bin/run-all.sh deleted file mode 100755 index 80e238a..0000000 --- a/bin/run-all.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/sh -set -e - -test_root="${1:-/solution}" -output_dir="${2:-/output/}" - -# echo "Output:" -# echo "${output_dir}" -# echo "Test root:" -# echo "${test_root}" - -for testdir in "${test_root}"/*; do - testname="$(basename $testdir)" - # echo "testdir" - # echo "${testdir}" - # echo "testname" - # echo "${testname}" - # echo "-----------" - if [ "$testname" != output ] && [ -f "${testdir}/results.json" ]; then - bin/run.sh "$testname" "$test_root" "$output_dir" - fi -done diff --git a/bin/run-in-docker.sh b/bin/run-in-docker.sh index 99775cb..564d452 100755 --- a/bin/run-in-docker.sh +++ b/bin/run-in-docker.sh @@ -1,39 +1,43 @@ -#!/usr/bin/env bash -set -e +#!/usr/bin/env sh # Synopsis: -# Test runner for run.sh in a docker container -# Takes the same arguments as run.sh (EXCEPT THAT SOLUTION AND OUTPUT PATH ARE RELATIVE) -# Builds the Dockerfile -# Runs the docker image passing along the initial arguments +# Run the test runner on a solution using the test runner Docker image. +# The test runner Docker image is built automatically. # Arguments: # $1: exercise slug -# $2: **RELATIVE** path to solution folder (with trailing slash) -# $3: **RELATIVE** path to output directory (with trailing slash) +# $2: absolute path to solution folder +# $3: absolute path to output directory # Output: # Writes the test results to a results.json file in the passed-in output directory. -# The test results are formatted according to the specifications at https://github.com/exercism/automated-tests/blob/master/docs/interface.md +# The test results are formatted according to the specifications at https://github.com/exercism/docs/blob/main/building/tooling/test-runners/interface.md # Example: -# ./run-in-docker.sh two-fer ./relative/path/to/two-fer/solution/folder/ ./relative/path/to/output/directory/ +# ./bin/run-in-docker.sh two-fer /absolute/path/to/two-fer/solution/folder/ /absolute/path/to/output/directory/ -# If arguments not provided, print usage and exit +# If any required arguments is missing, print the usage and exit if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then - echo "usage: run-in-docker.sh exercise-slug ./relative/path/to/solution/folder/ ./relative/path/to/output/directory/" + echo "usage: ./bin/run-in-docker.sh exercise-slug /absolute/path/to/solution/folder/ /absolute/path/to/output/directory/" exit 1 fi -# build docker image -docker build --rm --no-cache -t swift-test-runner . +slug="$1" +input_dir="${2%/}" +output_dir="${3%/}" -# Create output directory if it doesn't exist -output_dir="$3" -mkdir -p "$output_dir" +# Create the output directory if it doesn't exist +mkdir -p "${output_dir}" -# run image passing the arguments +# Build the Docker image +docker build --rm -t exercism/test-runner . + +# Run the Docker image using the settings mimicking the production environment docker run \ - --mount type=bind,src=$PWD/$2,dst=/solution \ - --mount type=bind,src=$PWD/$output_dir,dst=/output \ - swift-test-runner $1 /solution/ /output/ + --rm \ + --network none \ + --read-only \ + --mount type=bind,src="${input_dir}",dst=/solution \ + --mount type=bind,src="${output_dir}",dst=/output \ + --mount type=tmpfs,dst=/tmp \ + exercism/test-runner "${slug}" /solution /output diff --git a/bin/run-tests-in-docker.sh b/bin/run-tests-in-docker.sh new file mode 100755 index 0000000..7c45972 --- /dev/null +++ b/bin/run-tests-in-docker.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env sh + +# Synopsis: +# Test the test runner Docker image by running it against a predefined set of +# solutions with an expected output. +# The test runner Docker image is built automatically. + +# Output: +# Outputs the diff of the expected test results against the actual test results +# generated by the test runner Docker image. + +# Example: +# ./bin/run-tests-in-docker.sh + +# Build the Docker image +docker build --rm -t exercism/test-runner . + +# Run the Docker image using the settings mimicking the production environment +docker run \ + --rm \ + --network none \ + --read-only \ + --mount type=bind,src="${PWD}/tests",dst=/opt/test-runner/tests \ + --mount type=tmpfs,dst=/tmp \ + --workdir /opt/test-runner \ + --entrypoint /opt/test-runner/bin/run-tests.sh \ + exercism/test-runner diff --git a/bin/run-tests.sh b/bin/run-tests.sh new file mode 100755 index 0000000..4184021 --- /dev/null +++ b/bin/run-tests.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env sh + +# Synopsis: +# Test the test runner by running it against a predefined set of solutions +# with an expected output. + +# Output: +# Outputs the diff of the expected test results against the actual test results +# generated by the test runner. + +# Example: +# ./bin/run-tests.sh + +exit_code=0 + +# Iterate over all test directories +for test_dir in tests/*; do + test_dir_name=$(basename "${test_dir}") + test_dir_path=$(realpath "${test_dir}") + results_file_path="${test_dir_path}/results.json" + expected_results_file_path="${test_dir_path}/expected_results.json" + + bin/run.sh "${test_dir_name}" "${test_dir_path}" "${test_dir_path}" + + echo "${test_dir_name}: comparing results.json to expected_results.json" + diff "${results_file_path}" "${expected_results_file_path}" + + if [ $? -ne 0 ]; then + exit_code=1 + fi +done + +exit ${exit_code} diff --git a/bin/run.sh b/bin/run.sh index c09ece4..aa543d2 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -1,40 +1,36 @@ -#! /bin/sh -set -e +#!/usr/bin/env sh -# If arguments not provided, print usage and exit -if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then - echo "usage: run.sh exercise-slug ./relative/path/to/solution/folder/ ./relative/path/to/output/directory/" - exit 1 -fi +# Synopsis: +# Run the test runner on a solution. + +# Arguments: +# $1: exercise slug +# $2: absolute path to solution folder +# $3: absolute path to output directory -SLUG="$1" -INPUT_DIR="$2" -OUTPUT_DIR="$3" +# Output: +# Writes the test results to a results.json file in the passed-in output directory. +# The test results are formatted according to the specifications at https://github.com/exercism/docs/blob/main/building/tooling/test-runners/interface.md -BASEDIR=$(dirname "$0") +# Example: +# ./bin/run.sh two-fer /absolute/path/to/two-fer/solution/folder/ /absolute/path/to/output/directory/ -# echo "$SLUG: testing..." -# echo "$1" -# echo "$2" -# echo "$3" -# echo "-------------" -RUNALL=true "${BASEDIR}"/TestRunner --slug "${SLUG}" --solution-directory "${INPUT_DIR}/${SLUG}" --output-directory "${OUTPUT_DIR}" --swift-location $(which swift) --build-directory "/tmp/" +# If any required arguments is missing, print the usage and exit +if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then + echo "usage: ./bin/run.sh exercise-slug /absolute/path/to/two-fer/solution/folder/ /absolute/path/to/output/directory/" + exit 1 +fi -#echo "$SLUG: processing test output in $INPUT_DIR..." -## PLACEHOLDER - OPTIONAL: Your language may support outputting results -## in the correct format -# -# Create $OUTPUT_DIR if it doesn't exist -[ -d "$OUTPUT_DIR" ] || mkdir -p "$OUTPUT_DIR" -# -#echo "$SLUG: copying processed results to $OUTPUT_DIR..." -## PLACEHOLDER - OPTIONAL: Your language may support placing results -## directly in $OUTPUT_DIR -#cp "${INPUT_DIR}/results.json" "$OUTPUT_DIR" +slug="$1" +input_dir="${2%/}" +output_dir="${3%/}" -echo "$SLUG: comparing ${OUTPUT_DIR}/results" -diff "${INPUT_DIR}/${SLUG}/results.json" "${OUTPUT_DIR}/results.json" +# Create the output directory if it doesn't exist +mkdir -p "${output_dir}" -echo "$SLUG: OK\n-------------\n" +echo "${slug}: testing..." +# Run the tests for the provided implementation file +RUNALL=true ./bin/TestRunner --slug "${slug}" --solution-directory "${input_dir}" --output-directory "${output_dir}" --swift-location $(which swift) --build-directory "/tmp" +echo "${slug}: done" diff --git a/dockerTest/compile-error/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/dockerTest/compile-error/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/dockerTest/compile-error/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/dockerTest/compile-error/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate b/dockerTest/compile-error/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index efe15df..0000000 Binary files a/dockerTest/compile-error/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/dockerTest/compile-error/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist b/dockerTest/compile-error/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 063c567..0000000 --- a/dockerTest/compile-error/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - CompileError.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/dockerTest/compile-error/README.md b/dockerTest/compile-error/README.md deleted file mode 100644 index 29bf5fd..0000000 --- a/dockerTest/compile-error/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# CompileError - -A description of this package. diff --git a/dockerTest/compile-error/results.json b/dockerTest/compile-error/results.json deleted file mode 100644 index 7223336..0000000 --- a/dockerTest/compile-error/results.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "message" : "\/solution\/compile-error\/Sources\/CompileError\/CompileError.swift:2:12: error: unexpected non-void return value in void function\n return x + y\n ^\n", - "status" : "error", - "tests" : [ - - ] -} \ No newline at end of file diff --git a/dockerTest/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/dockerTest/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/dockerTest/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/dockerTest/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate b/dockerTest/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 0a6e8e7..0000000 Binary files a/dockerTest/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/dockerTest/multiple-tests-all-pass/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist b/dockerTest/multiple-tests-all-pass/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index dc01e4e..0000000 --- a/dockerTest/multiple-tests-all-pass/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - MultipleAllPass.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/dockerTest/multiple-tests-all-pass/README.md b/dockerTest/multiple-tests-all-pass/README.md deleted file mode 100644 index 01a8408..0000000 --- a/dockerTest/multiple-tests-all-pass/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# MultipleAllPass - -A description of this package. diff --git a/dockerTest/multiple-tests-all-pass/Tests/LinuxMain.swift b/dockerTest/multiple-tests-all-pass/Tests/LinuxMain.swift deleted file mode 100644 index 00e0fb4..0000000 --- a/dockerTest/multiple-tests-all-pass/Tests/LinuxMain.swift +++ /dev/null @@ -1,7 +0,0 @@ -import XCTest - -import MultipleAllPassTests - -var tests = [XCTestCaseEntry]() -tests += MultipleAllPassTests.allTests() -XCTMain(tests) diff --git a/dockerTest/multiple-tests-all-pass/Tests/MultipleAllPassTests/MultipleAllPassTests.swift b/dockerTest/multiple-tests-all-pass/Tests/MultipleAllPassTests/MultipleAllPassTests.swift deleted file mode 100644 index ef57fa5..0000000 --- a/dockerTest/multiple-tests-all-pass/Tests/MultipleAllPassTests/MultipleAllPassTests.swift +++ /dev/null @@ -1,43 +0,0 @@ -import XCTest - -@testable import MultipleAllPass - -final class MultipleAllPassTests: XCTestCase { - func testAdd() { - XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") - } - - func testSub() { - XCTAssertEqual(sub(2, 3), -1) - } - - func testMul() { - XCTAssertEqual(mul(2, 3), 6) - } - - static var allTests = [ - ("testAdd", testAdd), - ("testSub", testSub), - ("testMul", testMul), - ] -} - -final class SecondSuite: XCTestCase { - func testAdd() { - XCTAssertEqual(sum(12, 13), 25, "2+3 should equal 5") - } - - func testSub() { - XCTAssertEqual(sub(12, 13), -1) - } - - func testMul() { - XCTAssertEqual(mul(12, 13), 156) - } - - static var allTests = [ - ("testAdd", testAdd), - ("testSub", testSub), - ("testMul", testMul), - ] -} diff --git a/dockerTest/multiple-tests-all-pass/Tests/MultipleAllPassTests/XCTestManifests.swift b/dockerTest/multiple-tests-all-pass/Tests/MultipleAllPassTests/XCTestManifests.swift deleted file mode 100644 index e83b6c1..0000000 --- a/dockerTest/multiple-tests-all-pass/Tests/MultipleAllPassTests/XCTestManifests.swift +++ /dev/null @@ -1,10 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) -public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(MultipleAllPassTests.allTests), - testCase(SecondSuite.allTests), - ] -} -#endif diff --git a/dockerTest/multiple-tests-all-pass/results.json b/dockerTest/multiple-tests-all-pass/results.json deleted file mode 100644 index d814f79..0000000 --- a/dockerTest/multiple-tests-all-pass/results.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "status" : "pass", - "tests" : [ - { - "name" : "MultipleAllPassTests.testAdd", - "status" : "pass" - }, - { - "name" : "MultipleAllPassTests.testSub", - "status" : "pass" - }, - { - "name" : "MultipleAllPassTests.testMul", - "status" : "pass" - }, - { - "name" : "SecondSuite.testAdd", - "status" : "pass" - }, - { - "name" : "SecondSuite.testSub", - "status" : "pass" - }, - { - "name" : "SecondSuite.testMul", - "status" : "pass" - } - ] -} \ No newline at end of file diff --git a/dockerTest/multiple-tests-multiple-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/dockerTest/multiple-tests-multiple-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/dockerTest/multiple-tests-multiple-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/dockerTest/multiple-tests-multiple-fails/README.md b/dockerTest/multiple-tests-multiple-fails/README.md deleted file mode 100644 index d13b138..0000000 --- a/dockerTest/multiple-tests-multiple-fails/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# MultipleMultipleFails - -A description of this package. diff --git a/dockerTest/multiple-tests-multiple-fails/Tests/LinuxMain.swift b/dockerTest/multiple-tests-multiple-fails/Tests/LinuxMain.swift deleted file mode 100644 index 73e684b..0000000 --- a/dockerTest/multiple-tests-multiple-fails/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import MultipleMultipleFailsTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += MultipleMultipleFailsTests.allTests() -XCTMain(tests) diff --git a/dockerTest/multiple-tests-multiple-fails/results.json b/dockerTest/multiple-tests-multiple-fails/results.json deleted file mode 100644 index eb3c60a..0000000 --- a/dockerTest/multiple-tests-multiple-fails/results.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "message" : "\/solution\/multiple-tests-multiple-fails\/Tests\/MultipleMultipleFailsTests\/MultipleMultipleFailsTests.swift:7: error: MultipleMultipleFailsTests.testAdd : XCTAssertEqual failed: (\"-1\") is not equal to (\"5\") - 2+3 should equal 5", - "name" : "MultipleMultipleFailsTests.testAdd", - "status" : "fail" - }, - { - "message" : "\/solution\/multiple-tests-multiple-fails\/Tests\/MultipleMultipleFailsTests\/MultipleMultipleFailsTests.swift:11: error: MultipleMultipleFailsTests.testSub : XCTAssertEqual failed: (\"5\") is not equal to (\"-1\") - ", - "name" : "MultipleMultipleFailsTests.testSub", - "status" : "fail" - }, - { - "name" : "MultipleMultipleFailsTests.testMul", - "status" : "pass" - } - ] -} \ No newline at end of file diff --git a/dockerTest/multiple-tests-single-fail/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/dockerTest/multiple-tests-single-fail/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/dockerTest/multiple-tests-single-fail/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/dockerTest/multiple-tests-single-fail/README.md b/dockerTest/multiple-tests-single-fail/README.md deleted file mode 100644 index 025797a..0000000 --- a/dockerTest/multiple-tests-single-fail/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# MultipleSingleFail - -A description of this package. diff --git a/dockerTest/multiple-tests-single-fail/Tests/LinuxMain.swift b/dockerTest/multiple-tests-single-fail/Tests/LinuxMain.swift deleted file mode 100644 index 5380f37..0000000 --- a/dockerTest/multiple-tests-single-fail/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import MultipleSingleFailTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += MultipleSingleFailTests.allTests() -XCTMain(tests) diff --git a/dockerTest/multiple-tests-single-fail/results.json b/dockerTest/multiple-tests-single-fail/results.json deleted file mode 100644 index 3b00124..0000000 --- a/dockerTest/multiple-tests-single-fail/results.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "message" : "\/solution\/multiple-tests-single-fail\/Tests\/MultipleSingleFailTests\/MultipleSingleFailTests.swift:9: error: MultipleSingleFailTests.testAdd : XCTAssertEqual failed: (\"0\") is not equal to (\"5\") - 2+3 should equal 5", - "name" : "MultipleSingleFailTests.testAdd", - "output" : "yabba…", - "status" : "fail" - }, - { - "name" : "MultipleSingleFailTests.testSub", - "output" : "dabba…", - "status" : "pass" - }, - { - "name" : "MultipleSingleFailTests.testMul", - "output" : "Benedick's speech is 674 character's long.\nI will not be sworn but love may transform me to an oyster,\nbut I’ll take my oath on it, till he have made an oyster of me,\nhe shall never make me such a fool. One woman is fair, yet\nI am well; another is wise, yet I am well; another virtuous,\n25yet I am well; but till all graces be in one woman, one\nwoman shall not come in my grace. Rich she shall be, that’s\ncertain; wise, or I’ll none; virtuous, or I’ll never cheapen\nher; fair, or I’ll ever look on h…", - "status" : "pass" - }, - { - "message" : "\/solution\/multiple-tests-single-fail\/Tests\/MultipleSingleFailTests\/MultipleSingleFailTests.swift:34: error: SecondSuite.testAdd : XCTAssertEqual failed: (\"0\") is not equal to (\"25\") - 12+13 should equal 25", - "name" : "SecondSuite.testAdd", - "output" : "yabba…", - "status" : "fail" - }, - { - "name" : "SecondSuite.testSub", - "output" : "dabba…", - "status" : "pass" - }, - { - "name" : "SecondSuite.testMul", - "output" : "Benedick's speech is 674 character's long.\nI will not be sworn but love may transform me to an oyster,\nbut I’ll take my oath on it, till he have made an oyster of me,\nhe shall never make me such a fool. One woman is fair, yet\nI am well; another is wise, yet I am well; another virtuous,\n25yet I am well; but till all graces be in one woman, one\nwoman shall not come in my grace. Rich she shall be, that’s\ncertain; wise, or I’ll none; virtuous, or I’ll never cheapen\nher; fair, or I’ll ever look on h…", - "status" : "pass" - } - ] -} \ No newline at end of file diff --git a/dockerTest/multiple-tests-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/dockerTest/multiple-tests-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/dockerTest/multiple-tests-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/dockerTest/multiple-tests-with-exception/README.md b/dockerTest/multiple-tests-with-exception/README.md deleted file mode 100644 index 103fb4b..0000000 --- a/dockerTest/multiple-tests-with-exception/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# MultipleWithException - -A description of this package. diff --git a/dockerTest/multiple-tests-with-exception/Tests/LinuxMain.swift b/dockerTest/multiple-tests-with-exception/Tests/LinuxMain.swift deleted file mode 100644 index 23dbd17..0000000 --- a/dockerTest/multiple-tests-with-exception/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import MultipleWithExceptionTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += MultipleWithExceptionTests.allTests() -XCTMain(tests) diff --git a/dockerTest/multiple-tests-with-exception/results.json b/dockerTest/multiple-tests-with-exception/results.json deleted file mode 100644 index 46b33d4..0000000 --- a/dockerTest/multiple-tests-with-exception/results.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "name" : "MultipleWithExceptionTests.testAdd", - "status" : "pass" - }, - { - "name" : "MultipleWithExceptionTests.testSub", - "status" : "pass" - }, - { - "name" : "MultipleWithExceptionTests.testMul", - "status" : "pass" - }, - { - "message" : "\/solution\/multiple-tests-with-exception\/Tests\/MultipleWithExceptionTests\/MultipleWithExceptionTests.swift:19: error: MultipleWithExceptionTests.testThrow : XCTAssertEqual threw error \"testError(\"Oh noes! Div by zeroes!!!\")\" - ", - "name" : "MultipleWithExceptionTests.testThrow", - "status" : "fail" - } - ] -} \ No newline at end of file diff --git a/dockerTest/output/results.json b/dockerTest/output/results.json deleted file mode 100644 index 3b00124..0000000 --- a/dockerTest/output/results.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "message" : "\/solution\/multiple-tests-single-fail\/Tests\/MultipleSingleFailTests\/MultipleSingleFailTests.swift:9: error: MultipleSingleFailTests.testAdd : XCTAssertEqual failed: (\"0\") is not equal to (\"5\") - 2+3 should equal 5", - "name" : "MultipleSingleFailTests.testAdd", - "output" : "yabba…", - "status" : "fail" - }, - { - "name" : "MultipleSingleFailTests.testSub", - "output" : "dabba…", - "status" : "pass" - }, - { - "name" : "MultipleSingleFailTests.testMul", - "output" : "Benedick's speech is 674 character's long.\nI will not be sworn but love may transform me to an oyster,\nbut I’ll take my oath on it, till he have made an oyster of me,\nhe shall never make me such a fool. One woman is fair, yet\nI am well; another is wise, yet I am well; another virtuous,\n25yet I am well; but till all graces be in one woman, one\nwoman shall not come in my grace. Rich she shall be, that’s\ncertain; wise, or I’ll none; virtuous, or I’ll never cheapen\nher; fair, or I’ll ever look on h…", - "status" : "pass" - }, - { - "message" : "\/solution\/multiple-tests-single-fail\/Tests\/MultipleSingleFailTests\/MultipleSingleFailTests.swift:34: error: SecondSuite.testAdd : XCTAssertEqual failed: (\"0\") is not equal to (\"25\") - 12+13 should equal 25", - "name" : "SecondSuite.testAdd", - "output" : "yabba…", - "status" : "fail" - }, - { - "name" : "SecondSuite.testSub", - "output" : "dabba…", - "status" : "pass" - }, - { - "name" : "SecondSuite.testMul", - "output" : "Benedick's speech is 674 character's long.\nI will not be sworn but love may transform me to an oyster,\nbut I’ll take my oath on it, till he have made an oyster of me,\nhe shall never make me such a fool. One woman is fair, yet\nI am well; another is wise, yet I am well; another virtuous,\n25yet I am well; but till all graces be in one woman, one\nwoman shall not come in my grace. Rich she shall be, that’s\ncertain; wise, or I’ll none; virtuous, or I’ll never cheapen\nher; fair, or I’ll ever look on h…", - "status" : "pass" - } - ] -} \ No newline at end of file diff --git a/dockerTest/single-test-that-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/dockerTest/single-test-that-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/dockerTest/single-test-that-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/dockerTest/single-test-that-fails/README.md b/dockerTest/single-test-that-fails/README.md deleted file mode 100644 index f8dd2c3..0000000 --- a/dockerTest/single-test-that-fails/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# SingleThatFails - -A description of this package. diff --git a/dockerTest/single-test-that-fails/Tests/LinuxMain.swift b/dockerTest/single-test-that-fails/Tests/LinuxMain.swift deleted file mode 100644 index cb1beda..0000000 --- a/dockerTest/single-test-that-fails/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import SingleThatFailsTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += SingleThatFailsTests.allTests() -XCTMain(tests) diff --git a/dockerTest/single-test-that-fails/results.json b/dockerTest/single-test-that-fails/results.json deleted file mode 100644 index 7918c5f..0000000 --- a/dockerTest/single-test-that-fails/results.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "message" : "\/solution\/single-test-that-fails\/Tests\/SingleThatFailsTests\/SingleThatFailsTests.swift:7: error: SingleThatFailsTests.testAdd : XCTAssertEqual failed: (\"-1\") is not equal to (\"5\") - 2+3 should equal 5", - "name" : "SingleThatFailsTests.testAdd", - "status" : "fail" - } - ] -} \ No newline at end of file diff --git a/dockerTest/single-test-that-passes/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/dockerTest/single-test-that-passes/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/dockerTest/single-test-that-passes/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/dockerTest/single-test-that-passes/Package.swift b/dockerTest/single-test-that-passes/Package.swift deleted file mode 100644 index 6c54388..0000000 --- a/dockerTest/single-test-that-passes/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "SingleThatPasses", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "SingleThatPasses", - targets: ["SingleThatPasses"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "SingleThatPasses", - dependencies: []), - .testTarget( - name: "SingleThatPassesTests", - dependencies: ["SingleThatPasses"]), - ] -) diff --git a/dockerTest/single-test-that-passes/README.md b/dockerTest/single-test-that-passes/README.md deleted file mode 100644 index 44a922c..0000000 --- a/dockerTest/single-test-that-passes/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# SingleThatPasses - -A description of this package. diff --git a/dockerTest/single-test-that-passes/Tests/LinuxMain.swift b/dockerTest/single-test-that-passes/Tests/LinuxMain.swift deleted file mode 100644 index c2aee5c..0000000 --- a/dockerTest/single-test-that-passes/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import SingleThatPassesTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += SingleThatPassesTests.allTests() -XCTMain(tests) diff --git a/dockerTest/single-test-that-passes/Tests/SingleThatPassesTests/SingleThatPassesTests.swift b/dockerTest/single-test-that-passes/Tests/SingleThatPassesTests/SingleThatPassesTests.swift deleted file mode 100644 index 8a8d431..0000000 --- a/dockerTest/single-test-that-passes/Tests/SingleThatPassesTests/SingleThatPassesTests.swift +++ /dev/null @@ -1,13 +0,0 @@ -import XCTest - -@testable import SingleThatPasses - -final class SingleThatPassesTests: XCTestCase { - func testAdd() { - XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") - } - - static var allTests = [ - ("testAdd", testAdd) - ] -} diff --git a/dockerTest/single-test-that-passes/results.json b/dockerTest/single-test-that-passes/results.json deleted file mode 100644 index 4472e04..0000000 --- a/dockerTest/single-test-that-passes/results.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "status" : "pass", - "tests" : [ - { - "name" : "SingleThatPassesTests.testAdd", - "status" : "pass" - } - ] -} \ No newline at end of file diff --git a/dockerTest/single-test-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/dockerTest/single-test-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/dockerTest/single-test-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/dockerTest/single-test-with-exception/Package.swift b/dockerTest/single-test-with-exception/Package.swift deleted file mode 100644 index bfe3bc9..0000000 --- a/dockerTest/single-test-with-exception/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "SingleWithException", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "SingleWithException", - targets: ["SingleWithException"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "SingleWithException", - dependencies: []), - .testTarget( - name: "SingleWithExceptionTests", - dependencies: ["SingleWithException"]), - ] -) diff --git a/dockerTest/single-test-with-exception/README.md b/dockerTest/single-test-with-exception/README.md deleted file mode 100644 index 3cd118b..0000000 --- a/dockerTest/single-test-with-exception/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# SingleWithException - -A description of this package. diff --git a/dockerTest/single-test-with-exception/Tests/LinuxMain.swift b/dockerTest/single-test-with-exception/Tests/LinuxMain.swift deleted file mode 100644 index 778ae21..0000000 --- a/dockerTest/single-test-with-exception/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import SingleWithExceptionTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += SingleWithExceptionTests.allTests() -XCTMain(tests) diff --git a/dockerTest/single-test-with-exception/Tests/SingleWithExceptionTests/SingleWithExceptionTests.swift b/dockerTest/single-test-with-exception/Tests/SingleWithExceptionTests/SingleWithExceptionTests.swift deleted file mode 100644 index 376a9c2..0000000 --- a/dockerTest/single-test-with-exception/Tests/SingleWithExceptionTests/SingleWithExceptionTests.swift +++ /dev/null @@ -1,13 +0,0 @@ -import XCTest - -@testable import SingleWithException - -final class SingleWithExceptionTests: XCTestCase { - func testAdd() { - XCTAssertEqual(try sum(2, 3), 5, "2+3 should equal 5") - } - - static var allTests = [ - ("testAdd", testAdd) - ] -} diff --git a/dockerTest/single-test-with-exception/results.json b/dockerTest/single-test-with-exception/results.json deleted file mode 100644 index 7588313..0000000 --- a/dockerTest/single-test-with-exception/results.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "message" : "\/solution\/single-test-with-exception\/Tests\/SingleWithExceptionTests\/SingleWithExceptionTests.swift:7: error: SingleWithExceptionTests.testAdd : XCTAssertEqual threw error \"testError(\"Kaboomtown!\")\" - 2+3 should equal 5", - "name" : "SingleWithExceptionTests.testAdd", - "status" : "fail" - } - ] -} \ No newline at end of file diff --git a/src/testrunner/Package.swift b/src/testrunner/Package.swift index f7953b4..800d733 100644 --- a/src/testrunner/Package.swift +++ b/src/testrunner/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/src/testrunner/README.md b/src/testrunner/README.md deleted file mode 100644 index 4d273f9..0000000 --- a/src/testrunner/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# TestRunner - -The source code for the test-runner executable for the Exercism v3 Swift track. \ No newline at end of file diff --git a/src/testrunner/Sources/TestRunner/main.swift b/src/testrunner/Sources/TestRunner/main.swift index e2f615f..5003ad2 100644 --- a/src/testrunner/Sources/TestRunner/main.swift +++ b/src/testrunner/Sources/TestRunner/main.swift @@ -18,7 +18,7 @@ struct RunnerOptions: ParsableArguments { var buildDirectory: String @Flag() - var showSkipped: Bool + var showSkipped: Bool = true } // macOS test options @@ -67,11 +67,11 @@ let process = Process() #if os(macOS) var testFileRoot = options.solutionDirectory process.launchPath = options.swiftLocation - process.currentDirectoryPath = testFileRoot// + options.slug + process.currentDirectoryPath = testFileRoot #else var testFileRoot = URL(fileURLWithPath: options.solutionDirectory) process.executableURL = URL(fileURLWithPath: options.swiftLocation) - process.currentDirectoryURL = testFileRoot//.appendingPathComponent(options.slug) + process.currentDirectoryURL = testFileRoot #endif process.arguments = ["test", "--build-path", tempDir.path] diff --git a/test/compile-error/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/test/compile-error/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/test/compile-error/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/test/compile-error/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate b/test/compile-error/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index efe15df..0000000 Binary files a/test/compile-error/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/test/compile-error/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist b/test/compile-error/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 063c567..0000000 --- a/test/compile-error/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - CompileError.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/test/compile-error/Package.swift b/test/compile-error/Package.swift deleted file mode 100644 index b0183f0..0000000 --- a/test/compile-error/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "CompileError", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "CompileError", - targets: ["CompileError"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "CompileError", - dependencies: []), - .testTarget( - name: "CompileErrorTests", - dependencies: ["CompileError"]), - ] -) diff --git a/test/compile-error/README.md b/test/compile-error/README.md deleted file mode 100644 index 29bf5fd..0000000 --- a/test/compile-error/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# CompileError - -A description of this package. diff --git a/test/compile-error/Sources/CompileError/CompileError.swift b/test/compile-error/Sources/CompileError/CompileError.swift deleted file mode 100644 index eb92bd3..0000000 --- a/test/compile-error/Sources/CompileError/CompileError.swift +++ /dev/null @@ -1,3 +0,0 @@ -func sum(_ x: Int, _ y: Int) { - return x + y -} diff --git a/test/compile-error/Tests/CompileErrorTests/CompileErrorTests.swift b/test/compile-error/Tests/CompileErrorTests/CompileErrorTests.swift deleted file mode 100644 index 9bee869..0000000 --- a/test/compile-error/Tests/CompileErrorTests/CompileErrorTests.swift +++ /dev/null @@ -1,13 +0,0 @@ -import XCTest - -@testable import CompileError - -final class CompileErrorTests: XCTestCase { - func testAdd() { - XCTAssertEqual(sum(2, 3), 5) - } - - static var allTests = [ - ("testAdd", testAdd) - ] -} diff --git a/test/compile-error/Tests/CompileErrorTests/XCTestManifests.swift b/test/compile-error/Tests/CompileErrorTests/XCTestManifests.swift deleted file mode 100644 index 9809232..0000000 --- a/test/compile-error/Tests/CompileErrorTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) -public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(CompileErrorTests.allTests), - ] -} -#endif diff --git a/test/compile-error/Tests/LinuxMain.swift b/test/compile-error/Tests/LinuxMain.swift deleted file mode 100644 index 106c822..0000000 --- a/test/compile-error/Tests/LinuxMain.swift +++ /dev/null @@ -1,7 +0,0 @@ -import XCTest - -import CompileErrorTests - -var tests = [XCTestCaseEntry]() -tests += CompileErrorTests.allTests() -XCTMain(tests) diff --git a/test/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/test/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/test/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/test/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate b/test/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 0a6e8e7..0000000 Binary files a/test/multiple-tests-all-pass/.swiftpm/xcode/package.xcworkspace/xcuserdata/wdn.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/test/multiple-tests-all-pass/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist b/test/multiple-tests-all-pass/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index dc01e4e..0000000 --- a/test/multiple-tests-all-pass/.swiftpm/xcode/xcuserdata/wdn.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - MultipleAllPass.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/test/multiple-tests-all-pass/Package.swift b/test/multiple-tests-all-pass/Package.swift deleted file mode 100644 index 8fdada5..0000000 --- a/test/multiple-tests-all-pass/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "MultipleAllPass", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "MultipleAllPass", - targets: ["MultipleAllPass"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "MultipleAllPass", - dependencies: []), - .testTarget( - name: "MultipleAllPassTests", - dependencies: ["MultipleAllPass"]), - ] -) diff --git a/test/multiple-tests-all-pass/README.md b/test/multiple-tests-all-pass/README.md deleted file mode 100644 index 01a8408..0000000 --- a/test/multiple-tests-all-pass/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# MultipleAllPass - -A description of this package. diff --git a/test/multiple-tests-all-pass/Sources/MultipleAllPass/MultipleAllPass.swift b/test/multiple-tests-all-pass/Sources/MultipleAllPass/MultipleAllPass.swift deleted file mode 100644 index ffe4949..0000000 --- a/test/multiple-tests-all-pass/Sources/MultipleAllPass/MultipleAllPass.swift +++ /dev/null @@ -1,11 +0,0 @@ -func sum(_ x: Int, _ y: Int) -> Int { - return x + y -} - -func sub(_ x: Int, _ y: Int) -> Int { - return x - y -} - -func mul(_ x: Int, _ y: Int) -> Int { - return x * y -} diff --git a/test/multiple-tests-all-pass/Tests/LinuxMain.swift b/test/multiple-tests-all-pass/Tests/LinuxMain.swift deleted file mode 100644 index 00e0fb4..0000000 --- a/test/multiple-tests-all-pass/Tests/LinuxMain.swift +++ /dev/null @@ -1,7 +0,0 @@ -import XCTest - -import MultipleAllPassTests - -var tests = [XCTestCaseEntry]() -tests += MultipleAllPassTests.allTests() -XCTMain(tests) diff --git a/test/multiple-tests-all-pass/results.json b/test/multiple-tests-all-pass/results.json deleted file mode 100644 index d814f79..0000000 --- a/test/multiple-tests-all-pass/results.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "status" : "pass", - "tests" : [ - { - "name" : "MultipleAllPassTests.testAdd", - "status" : "pass" - }, - { - "name" : "MultipleAllPassTests.testSub", - "status" : "pass" - }, - { - "name" : "MultipleAllPassTests.testMul", - "status" : "pass" - }, - { - "name" : "SecondSuite.testAdd", - "status" : "pass" - }, - { - "name" : "SecondSuite.testSub", - "status" : "pass" - }, - { - "name" : "SecondSuite.testMul", - "status" : "pass" - } - ] -} \ No newline at end of file diff --git a/test/multiple-tests-multiple-fails/.gitignore b/test/multiple-tests-multiple-fails/.gitignore deleted file mode 100644 index 95c4320..0000000 --- a/test/multiple-tests-multiple-fails/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.DS_Store -/.build -/Packages -/*.xcodeproj -xcuserdata/ diff --git a/test/multiple-tests-multiple-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/test/multiple-tests-multiple-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/test/multiple-tests-multiple-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/test/multiple-tests-multiple-fails/Package.swift b/test/multiple-tests-multiple-fails/Package.swift deleted file mode 100644 index c1fe92b..0000000 --- a/test/multiple-tests-multiple-fails/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "MultipleMultipleFails", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "MultipleMultipleFails", - targets: ["MultipleMultipleFails"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "MultipleMultipleFails", - dependencies: []), - .testTarget( - name: "MultipleMultipleFailsTests", - dependencies: ["MultipleMultipleFails"]), - ] -) diff --git a/test/multiple-tests-multiple-fails/README.md b/test/multiple-tests-multiple-fails/README.md deleted file mode 100644 index d13b138..0000000 --- a/test/multiple-tests-multiple-fails/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# MultipleMultipleFails - -A description of this package. diff --git a/test/multiple-tests-multiple-fails/Sources/MultipleMultipleFails/MultipleMultipleFails.swift b/test/multiple-tests-multiple-fails/Sources/MultipleMultipleFails/MultipleMultipleFails.swift deleted file mode 100644 index eda1f40..0000000 --- a/test/multiple-tests-multiple-fails/Sources/MultipleMultipleFails/MultipleMultipleFails.swift +++ /dev/null @@ -1,11 +0,0 @@ -func sum(_ x: Int, _ y: Int) -> Int { - return x - y -} - -func sub(_ x: Int, _ y: Int) -> Int { - return x + y -} - -func mul(_ x: Int, _ y: Int) -> Int { - return x * y -} diff --git a/test/multiple-tests-multiple-fails/Tests/LinuxMain.swift b/test/multiple-tests-multiple-fails/Tests/LinuxMain.swift deleted file mode 100644 index 73e684b..0000000 --- a/test/multiple-tests-multiple-fails/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import MultipleMultipleFailsTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += MultipleMultipleFailsTests.allTests() -XCTMain(tests) diff --git a/test/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/MultipleMultipleFailsTests.swift b/test/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/MultipleMultipleFailsTests.swift deleted file mode 100644 index a737f27..0000000 --- a/test/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/MultipleMultipleFailsTests.swift +++ /dev/null @@ -1,23 +0,0 @@ -import XCTest - -@testable import MultipleMultipleFails - -final class MultipleMultipleFailsTests: XCTestCase { - func testAdd() { - XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") - } - - func testSub() { - XCTAssertEqual(sub(2, 3), -1) - } - - func testMul() { - XCTAssertEqual(mul(2, 3), 6) - } - - static var allTests = [ - ("testAdd", testAdd), - ("testSub", testSub), - ("testMul", testMul), - ] -} diff --git a/test/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/XCTestManifests.swift b/test/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/XCTestManifests.swift deleted file mode 100644 index 1bde348..0000000 --- a/test/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(MultipleMultipleFailsTests.allTests) - ] - } -#endif diff --git a/test/multiple-tests-multiple-fails/results.json b/test/multiple-tests-multiple-fails/results.json deleted file mode 100644 index 1c3d3b9..0000000 --- a/test/multiple-tests-multiple-fails/results.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "message" : "\/home\/wdn\/dev\/exercism\/swift-test-runner\/test\/multiple-tests-multiple-fails\/Tests\/MultipleMultipleFailsTests\/MultipleMultipleFailsTests.swift:7: error: MultipleMultipleFailsTests.testAdd : XCTAssertEqual failed: (\"-1\") is not equal to (\"5\") - 2+3 should equal 5", - "name" : "MultipleMultipleFailsTests.testAdd", - "status" : "fail" - }, - { - "message" : "\/home\/wdn\/dev\/exercism\/swift-test-runner\/test\/multiple-tests-multiple-fails\/Tests\/MultipleMultipleFailsTests\/MultipleMultipleFailsTests.swift:11: error: MultipleMultipleFailsTests.testSub : XCTAssertEqual failed: (\"5\") is not equal to (\"-1\") - ", - "name" : "MultipleMultipleFailsTests.testSub", - "status" : "fail" - }, - { - "name" : "MultipleMultipleFailsTests.testMul", - "status" : "pass" - } - ] -} \ No newline at end of file diff --git a/test/multiple-tests-single-fail/.gitignore b/test/multiple-tests-single-fail/.gitignore deleted file mode 100644 index 95c4320..0000000 --- a/test/multiple-tests-single-fail/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.DS_Store -/.build -/Packages -/*.xcodeproj -xcuserdata/ diff --git a/test/multiple-tests-single-fail/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/test/multiple-tests-single-fail/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/test/multiple-tests-single-fail/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/test/multiple-tests-single-fail/Package.swift b/test/multiple-tests-single-fail/Package.swift deleted file mode 100644 index e310a14..0000000 --- a/test/multiple-tests-single-fail/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "MultipleSingleFail", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "MultipleSingleFail", - targets: ["MultipleSingleFail"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "MultipleSingleFail", - dependencies: []), - .testTarget( - name: "MultipleSingleFailTests", - dependencies: ["MultipleSingleFail"]), - ] -) diff --git a/test/multiple-tests-single-fail/README.md b/test/multiple-tests-single-fail/README.md deleted file mode 100644 index 025797a..0000000 --- a/test/multiple-tests-single-fail/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# MultipleSingleFail - -A description of this package. diff --git a/test/multiple-tests-single-fail/Sources/MultipleSingleFail/MultipleSingleFail.swift b/test/multiple-tests-single-fail/Sources/MultipleSingleFail/MultipleSingleFail.swift deleted file mode 100644 index ee6a85b..0000000 --- a/test/multiple-tests-single-fail/Sources/MultipleSingleFail/MultipleSingleFail.swift +++ /dev/null @@ -1,30 +0,0 @@ -func sum(_ x: Int, _ y: Int) -> Int { - print("yabba") - return x / y -} - -func sub(_ x: Int, _ y: Int) -> Int { - print("dabba") - return x - y -} - -func mul(_ x: Int, _ y: Int) -> Int { - let benedick = - """ - I will not be sworn but love may transform me to an oyster, - but I’ll take my oath on it, till he have made an oyster of me, - he shall never make me such a fool. One woman is fair, yet - I am well; another is wise, yet I am well; another virtuous, - 25yet I am well; but till all graces be in one woman, one - woman shall not come in my grace. Rich she shall be, that’s - certain; wise, or I’ll none; virtuous, or I’ll never cheapen - her; fair, or I’ll ever look on her; mild, or come not near - me; noble, or not I for an angel; of good discourse, an - 30excellent musician, and her hair shall be of what color it - please God. Ha! The Prince and Monsieur Love! I will hide - me in the arbor. - """ - print("Benedick's speech is \(benedick.count) character's long.") - print(benedick) - return x * y -} diff --git a/test/multiple-tests-single-fail/Tests/LinuxMain.swift b/test/multiple-tests-single-fail/Tests/LinuxMain.swift deleted file mode 100644 index 5380f37..0000000 --- a/test/multiple-tests-single-fail/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import MultipleSingleFailTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += MultipleSingleFailTests.allTests() -XCTMain(tests) diff --git a/test/multiple-tests-single-fail/Tests/MultipleSingleFailTests/MultipleSingleFailTests.swift b/test/multiple-tests-single-fail/Tests/MultipleSingleFailTests/MultipleSingleFailTests.swift deleted file mode 100644 index 7895664..0000000 --- a/test/multiple-tests-single-fail/Tests/MultipleSingleFailTests/MultipleSingleFailTests.swift +++ /dev/null @@ -1,52 +0,0 @@ -import XCTest - -@testable import MultipleSingleFail - -final class MultipleSingleFailTests: XCTestCase { - let runAll = Bool(ProcessInfo.processInfo.environment["RUNALL", default: "false"]) ?? false - - func testAdd() { - XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") - } - - func testSub() throws { - try XCTSkipIf(true && !runAll) // change true to false to run this test - XCTAssertEqual(sub(2, 3), -1) - } - - func testMul() throws { - try XCTSkipIf(true && !runAll) // change true to false to run this test - XCTAssertEqual(mul(2, 3), 6) - } - - static var allTests = [ - ("testAdd", testAdd), - ("testSub", testSub), - ("testMul", testMul), - ] -} - -final class SecondSuite: XCTestCase { - let runAll = Bool(ProcessInfo.processInfo.environment["RUNALL", default: "false"]) ?? false - - func testAdd2() throws { - try XCTSkipIf(true && !runAll) // change true to false to run this test - XCTAssertEqual(sum(12, 13), 25, "12+13 should equal 25") - } - - func testSub2() throws { - try XCTSkipIf(true && !runAll) // change true to false to run this test - XCTAssertEqual(sub(12, 13), -1) - } - - func testMul2() throws { - try XCTSkipIf(true && !runAll) // change true to false to run this test - XCTAssertEqual(mul(12, 13), 156) - } - - static var allTests = [ - ("testAdd", testAdd2), - ("testSub", testSub2), - ("testMul", testMul2), - ] -} diff --git a/test/multiple-tests-single-fail/Tests/MultipleSingleFailTests/XCTestManifests.swift b/test/multiple-tests-single-fail/Tests/MultipleSingleFailTests/XCTestManifests.swift deleted file mode 100644 index 4f72e30..0000000 --- a/test/multiple-tests-single-fail/Tests/MultipleSingleFailTests/XCTestManifests.swift +++ /dev/null @@ -1,10 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(MultipleSingleFailTests.allTests), - testCase(SecondSuite.allTests), - ] - } -#endif diff --git a/test/multiple-tests-single-fail/results.json b/test/multiple-tests-single-fail/results.json deleted file mode 100644 index 0055ece..0000000 --- a/test/multiple-tests-single-fail/results.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "message" : "\/home\/wdn\/dev\/exercism\/swift-test-runner\/test\/multiple-tests-single-fail\/Tests\/MultipleSingleFailTests\/MultipleSingleFailTests.swift:9: error: MultipleSingleFailTests.testAdd : XCTAssertEqual failed: (\"0\") is not equal to (\"5\") - 2+3 should equal 5", - "name" : "MultipleSingleFailTests.testAdd", - "output" : "yabba…", - "status" : "fail" - }, - { - "name" : "MultipleSingleFailTests.testSub", - "output" : "dabba…", - "status" : "pass" - }, - { - "name" : "MultipleSingleFailTests.testMul", - "output" : "Benedick's speech is 674 character's long.\nI will not be sworn but love may transform me to an oyster,\nbut I’ll take my oath on it, till he have made an oyster of me,\nhe shall never make me such a fool. One woman is fair, yet\nI am well; another is wise, yet I am well; another virtuous,\n25yet I am well; but till all graces be in one woman, one\nwoman shall not come in my grace. Rich she shall be, that’s\ncertain; wise, or I’ll none; virtuous, or I’ll never cheapen\nher; fair, or I’ll ever look on h…", - "status" : "pass" - }, - { - "message" : "\/home\/wdn\/dev\/exercism\/swift-test-runner\/test\/multiple-tests-single-fail\/Tests\/MultipleSingleFailTests\/MultipleSingleFailTests.swift:34: error: SecondSuite.testAdd : XCTAssertEqual failed: (\"0\") is not equal to (\"25\") - 12+13 should equal 25", - "name" : "SecondSuite.testAdd", - "output" : "yabba…", - "status" : "fail" - }, - { - "name" : "SecondSuite.testSub", - "output" : "dabba…", - "status" : "pass" - }, - { - "name" : "SecondSuite.testMul", - "output" : "Benedick's speech is 674 character's long.\nI will not be sworn but love may transform me to an oyster,\nbut I’ll take my oath on it, till he have made an oyster of me,\nhe shall never make me such a fool. One woman is fair, yet\nI am well; another is wise, yet I am well; another virtuous,\n25yet I am well; but till all graces be in one woman, one\nwoman shall not come in my grace. Rich she shall be, that’s\ncertain; wise, or I’ll none; virtuous, or I’ll never cheapen\nher; fair, or I’ll ever look on h…", - "status" : "pass" - } - ] -} \ No newline at end of file diff --git a/test/multiple-tests-with-exception/.gitignore b/test/multiple-tests-with-exception/.gitignore deleted file mode 100644 index 95c4320..0000000 --- a/test/multiple-tests-with-exception/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.DS_Store -/.build -/Packages -/*.xcodeproj -xcuserdata/ diff --git a/test/multiple-tests-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/test/multiple-tests-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/test/multiple-tests-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/test/multiple-tests-with-exception/Package.swift b/test/multiple-tests-with-exception/Package.swift deleted file mode 100644 index 501b2b9..0000000 --- a/test/multiple-tests-with-exception/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "MultipleWithException", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "MultipleWithException", - targets: ["MultipleWithException"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "MultipleWithException", - dependencies: []), - .testTarget( - name: "MultipleWithExceptionTests", - dependencies: ["MultipleWithException"]), - ] -) diff --git a/test/multiple-tests-with-exception/README.md b/test/multiple-tests-with-exception/README.md deleted file mode 100644 index 103fb4b..0000000 --- a/test/multiple-tests-with-exception/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# MultipleWithException - -A description of this package. diff --git a/test/multiple-tests-with-exception/Sources/MultipleWithException/MultipleWithException.swift b/test/multiple-tests-with-exception/Sources/MultipleWithException/MultipleWithException.swift deleted file mode 100644 index f4cb7cc..0000000 --- a/test/multiple-tests-with-exception/Sources/MultipleWithException/MultipleWithException.swift +++ /dev/null @@ -1,27 +0,0 @@ -enum TestError: Error { - case testError(String) -} - -func sum(_ x: Int, _ y: Int) -> Int { - return x + y -} - -func sub(_ x: Int, _ y: Int) -> Int { - // fatalError("Oh noes!") - return x - y -} - -func mul(_ x: Int, _ y: Int) -> Int { - if x < y { - fatalError("Oh noes!") - } else { - return x * y - // let z = Int.max / y - // return x * z - } -} - -func throwErr(_ x: Int, _ y: Int) throws -> Int { - guard y != 0 else { throw TestError.testError("Oh noes! Div by zeroes!!!") } - return x / y -} diff --git a/test/multiple-tests-with-exception/Tests/LinuxMain.swift b/test/multiple-tests-with-exception/Tests/LinuxMain.swift deleted file mode 100644 index 23dbd17..0000000 --- a/test/multiple-tests-with-exception/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import MultipleWithExceptionTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += MultipleWithExceptionTests.allTests() -XCTMain(tests) diff --git a/test/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/MultipleWithExceptionTests.swift b/test/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/MultipleWithExceptionTests.swift deleted file mode 100644 index 98a6b84..0000000 --- a/test/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/MultipleWithExceptionTests.swift +++ /dev/null @@ -1,28 +0,0 @@ -import XCTest - -@testable import MultipleWithException - -final class MultipleWithExceptionTests: XCTestCase { - func testAdd() { - XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") - } - - func testSub() { - XCTAssertEqual(sub(2, 3), -1) - } - - func testMul() { - XCTAssertEqual(mul(3, 2), 6) - } - - func testThrow() { - XCTAssertEqual(try throwErr(2, 0), 6) - } - - static var allTests = [ - ("testAdd", testAdd), - ("testSub", testSub), - ("testMul", testMul), - ("testThrow", testThrow), - ] -} diff --git a/test/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/XCTestManifests.swift b/test/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/XCTestManifests.swift deleted file mode 100644 index cbab108..0000000 --- a/test/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(MultipleWithExceptionTests.allTests) - ] - } -#endif diff --git a/test/multiple-tests-with-exception/results.json b/test/multiple-tests-with-exception/results.json deleted file mode 100644 index 5c61440..0000000 --- a/test/multiple-tests-with-exception/results.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "name" : "MultipleWithExceptionTests.testAdd", - "status" : "pass" - }, - { - "name" : "MultipleWithExceptionTests.testSub", - "status" : "pass" - }, - { - "name" : "MultipleWithExceptionTests.testMul", - "status" : "pass" - }, - { - "message" : "\/home\/wdn\/dev\/exercism\/swift-test-runner\/test\/multiple-tests-with-exception\/Tests\/MultipleWithExceptionTests\/MultipleWithExceptionTests.swift:19: error: MultipleWithExceptionTests.testThrow : XCTAssertEqual threw error \"testError(\"Oh noes! Div by zeroes!!!\")\" - ", - "name" : "MultipleWithExceptionTests.testThrow", - "status" : "fail" - } - ] -} \ No newline at end of file diff --git a/test/single-test-that-fails/.gitignore b/test/single-test-that-fails/.gitignore deleted file mode 100644 index 95c4320..0000000 --- a/test/single-test-that-fails/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.DS_Store -/.build -/Packages -/*.xcodeproj -xcuserdata/ diff --git a/test/single-test-that-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/test/single-test-that-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/test/single-test-that-fails/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/test/single-test-that-fails/Package.swift b/test/single-test-that-fails/Package.swift deleted file mode 100644 index ec316d6..0000000 --- a/test/single-test-that-fails/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "SingleThatFails", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "SingleThatFails", - targets: ["SingleThatFails"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "SingleThatFails", - dependencies: []), - .testTarget( - name: "SingleThatFailsTests", - dependencies: ["SingleThatFails"]), - ] -) diff --git a/test/single-test-that-fails/README.md b/test/single-test-that-fails/README.md deleted file mode 100644 index f8dd2c3..0000000 --- a/test/single-test-that-fails/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# SingleThatFails - -A description of this package. diff --git a/test/single-test-that-fails/Sources/SingleThatFails/SingleThatFails.swift b/test/single-test-that-fails/Sources/SingleThatFails/SingleThatFails.swift deleted file mode 100644 index bbb07a6..0000000 --- a/test/single-test-that-fails/Sources/SingleThatFails/SingleThatFails.swift +++ /dev/null @@ -1,7 +0,0 @@ -enum TestError: Error { - case testError(String) -} - -func sum(_ x: Int, _ y: Int) -> Int { - return x - y -} diff --git a/test/single-test-that-fails/Tests/LinuxMain.swift b/test/single-test-that-fails/Tests/LinuxMain.swift deleted file mode 100644 index cb1beda..0000000 --- a/test/single-test-that-fails/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import SingleThatFailsTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += SingleThatFailsTests.allTests() -XCTMain(tests) diff --git a/test/single-test-that-fails/Tests/SingleThatFailsTests/SingleThatFailsTests.swift b/test/single-test-that-fails/Tests/SingleThatFailsTests/SingleThatFailsTests.swift deleted file mode 100644 index d456db7..0000000 --- a/test/single-test-that-fails/Tests/SingleThatFailsTests/SingleThatFailsTests.swift +++ /dev/null @@ -1,13 +0,0 @@ -import XCTest - -@testable import SingleThatFails - -final class SingleThatFailsTests: XCTestCase { - func testAdd() { - XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") - } - - static var allTests = [ - ("testAdd", testAdd) - ] -} diff --git a/test/single-test-that-fails/Tests/SingleThatFailsTests/XCTestManifests.swift b/test/single-test-that-fails/Tests/SingleThatFailsTests/XCTestManifests.swift deleted file mode 100644 index d35899b..0000000 --- a/test/single-test-that-fails/Tests/SingleThatFailsTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(SingleThatFailsTests.allTests) - ] - } -#endif diff --git a/test/single-test-that-fails/results.json b/test/single-test-that-fails/results.json deleted file mode 100644 index 939bd57..0000000 --- a/test/single-test-that-fails/results.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "message" : "\/home\/wdn\/dev\/exercism\/swift-test-runner\/test\/single-test-that-fails\/Tests\/SingleThatFailsTests\/SingleThatFailsTests.swift:7: error: SingleThatFailsTests.testAdd : XCTAssertEqual failed: (\"-1\") is not equal to (\"5\") - 2+3 should equal 5", - "name" : "SingleThatFailsTests.testAdd", - "status" : "fail" - } - ] -} \ No newline at end of file diff --git a/test/single-test-that-passes/.gitignore b/test/single-test-that-passes/.gitignore deleted file mode 100644 index 95c4320..0000000 --- a/test/single-test-that-passes/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.DS_Store -/.build -/Packages -/*.xcodeproj -xcuserdata/ diff --git a/test/single-test-that-passes/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/test/single-test-that-passes/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/test/single-test-that-passes/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/test/single-test-that-passes/Package.swift b/test/single-test-that-passes/Package.swift deleted file mode 100644 index 6c54388..0000000 --- a/test/single-test-that-passes/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "SingleThatPasses", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "SingleThatPasses", - targets: ["SingleThatPasses"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "SingleThatPasses", - dependencies: []), - .testTarget( - name: "SingleThatPassesTests", - dependencies: ["SingleThatPasses"]), - ] -) diff --git a/test/single-test-that-passes/README.md b/test/single-test-that-passes/README.md deleted file mode 100644 index 44a922c..0000000 --- a/test/single-test-that-passes/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# SingleThatPasses - -A description of this package. diff --git a/test/single-test-that-passes/Sources/SingleThatPasses/SingleThatPasses.swift b/test/single-test-that-passes/Sources/SingleThatPasses/SingleThatPasses.swift deleted file mode 100644 index 8015268..0000000 --- a/test/single-test-that-passes/Sources/SingleThatPasses/SingleThatPasses.swift +++ /dev/null @@ -1,7 +0,0 @@ -enum TestError: Error { - case testError(String) -} - -func sum(_ x: Int, _ y: Int) -> Int { - return x + y -} diff --git a/test/single-test-that-passes/Tests/LinuxMain.swift b/test/single-test-that-passes/Tests/LinuxMain.swift deleted file mode 100644 index c2aee5c..0000000 --- a/test/single-test-that-passes/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import SingleThatPassesTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += SingleThatPassesTests.allTests() -XCTMain(tests) diff --git a/test/single-test-that-passes/Tests/SingleThatPassesTests/XCTestManifests.swift b/test/single-test-that-passes/Tests/SingleThatPassesTests/XCTestManifests.swift deleted file mode 100644 index 76f6b7a..0000000 --- a/test/single-test-that-passes/Tests/SingleThatPassesTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(SingleThatPassesTests.allTests) - ] - } -#endif diff --git a/test/single-test-that-passes/results.json b/test/single-test-that-passes/results.json deleted file mode 100644 index 4472e04..0000000 --- a/test/single-test-that-passes/results.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "status" : "pass", - "tests" : [ - { - "name" : "SingleThatPassesTests.testAdd", - "status" : "pass" - } - ] -} \ No newline at end of file diff --git a/test/single-test-with-exception/.gitignore b/test/single-test-with-exception/.gitignore deleted file mode 100644 index 95c4320..0000000 --- a/test/single-test-with-exception/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.DS_Store -/.build -/Packages -/*.xcodeproj -xcuserdata/ diff --git a/test/single-test-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/test/single-test-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/test/single-test-with-exception/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/test/single-test-with-exception/Package.swift b/test/single-test-with-exception/Package.swift deleted file mode 100644 index bfe3bc9..0000000 --- a/test/single-test-with-exception/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "SingleWithException", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "SingleWithException", - targets: ["SingleWithException"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "SingleWithException", - dependencies: []), - .testTarget( - name: "SingleWithExceptionTests", - dependencies: ["SingleWithException"]), - ] -) diff --git a/test/single-test-with-exception/README.md b/test/single-test-with-exception/README.md deleted file mode 100644 index 3cd118b..0000000 --- a/test/single-test-with-exception/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# SingleWithException - -A description of this package. diff --git a/test/single-test-with-exception/Sources/SingleWithException/SingleWithException.swift b/test/single-test-with-exception/Sources/SingleWithException/SingleWithException.swift deleted file mode 100644 index cb8eaaa..0000000 --- a/test/single-test-with-exception/Sources/SingleWithException/SingleWithException.swift +++ /dev/null @@ -1,7 +0,0 @@ -enum TestError: Error { - case testError(String) -} - -func sum(_ x: Int, _ y: Int) throws -> Int { - throw TestError.testError("Kaboomtown!") -} diff --git a/test/single-test-with-exception/Tests/LinuxMain.swift b/test/single-test-with-exception/Tests/LinuxMain.swift deleted file mode 100644 index 778ae21..0000000 --- a/test/single-test-with-exception/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import SingleWithExceptionTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += SingleWithExceptionTests.allTests() -XCTMain(tests) diff --git a/test/single-test-with-exception/Tests/SingleWithExceptionTests/XCTestManifests.swift b/test/single-test-with-exception/Tests/SingleWithExceptionTests/XCTestManifests.swift deleted file mode 100644 index 61fb57b..0000000 --- a/test/single-test-with-exception/Tests/SingleWithExceptionTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(SingleWithExceptionTests.allTests) - ] - } -#endif diff --git a/test/single-test-with-exception/results.json b/test/single-test-with-exception/results.json deleted file mode 100644 index 3200ae4..0000000 --- a/test/single-test-with-exception/results.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "status" : "fail", - "tests" : [ - { - "message" : "\/home\/wdn\/dev\/exercism\/swift-test-runner\/test\/single-test-with-exception\/Tests\/SingleWithExceptionTests\/SingleWithExceptionTests.swift:7: error: SingleWithExceptionTests.testAdd : XCTAssertEqual threw error \"testError(\"Kaboomtown!\")\" - 2+3 should equal 5", - "name" : "SingleWithExceptionTests.testAdd", - "status" : "fail" - } - ] -} \ No newline at end of file diff --git a/dockerTest/compile-error/Package.swift b/tests/compile-error/Package.swift similarity index 97% rename from dockerTest/compile-error/Package.swift rename to tests/compile-error/Package.swift index b0183f0..1a275ee 100644 --- a/dockerTest/compile-error/Package.swift +++ b/tests/compile-error/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/dockerTest/compile-error/Sources/CompileError/CompileError.swift b/tests/compile-error/Sources/CompileError/CompileError.swift similarity index 100% rename from dockerTest/compile-error/Sources/CompileError/CompileError.swift rename to tests/compile-error/Sources/CompileError/CompileError.swift diff --git a/dockerTest/compile-error/Tests/CompileErrorTests/CompileErrorTests.swift b/tests/compile-error/Tests/CompileErrorTests/CompileErrorTests.swift similarity index 100% rename from dockerTest/compile-error/Tests/CompileErrorTests/CompileErrorTests.swift rename to tests/compile-error/Tests/CompileErrorTests/CompileErrorTests.swift diff --git a/dockerTest/compile-error/Tests/CompileErrorTests/XCTestManifests.swift b/tests/compile-error/Tests/CompileErrorTests/XCTestManifests.swift similarity index 100% rename from dockerTest/compile-error/Tests/CompileErrorTests/XCTestManifests.swift rename to tests/compile-error/Tests/CompileErrorTests/XCTestManifests.swift diff --git a/dockerTest/compile-error/Tests/LinuxMain.swift b/tests/compile-error/Tests/LinuxMain.swift similarity index 100% rename from dockerTest/compile-error/Tests/LinuxMain.swift rename to tests/compile-error/Tests/LinuxMain.swift diff --git a/test/compile-error/results.json b/tests/compile-error/expected_results.json similarity index 100% rename from test/compile-error/results.json rename to tests/compile-error/expected_results.json diff --git a/dockerTest/multiple-tests-all-pass/Package.swift b/tests/multiple-tests-all-pass/Package.swift similarity index 73% rename from dockerTest/multiple-tests-all-pass/Package.swift rename to tests/multiple-tests-all-pass/Package.swift index 8fdada5..d219472 100644 --- a/dockerTest/multiple-tests-all-pass/Package.swift +++ b/tests/multiple-tests-all-pass/Package.swift @@ -1,15 +1,15 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( - name: "MultipleAllPass", + name: "MultipleTestsAllPass", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "MultipleAllPass", - targets: ["MultipleAllPass"]), + name: "MultipleTestsAllPass", + targets: ["MultipleTestsAllPass"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -19,10 +19,10 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "MultipleAllPass", + name: "MultipleTestsAllPass", dependencies: []), .testTarget( - name: "MultipleAllPassTests", - dependencies: ["MultipleAllPass"]), + name: "MultipleTestsAllPassTests", + dependencies: ["MultipleTestsAllPass"]), ] ) diff --git a/dockerTest/multiple-tests-all-pass/Sources/MultipleAllPass/MultipleAllPass.swift b/tests/multiple-tests-all-pass/Sources/MultipleTestsAllPass/MultipleTestsAllPass.swift similarity index 100% rename from dockerTest/multiple-tests-all-pass/Sources/MultipleAllPass/MultipleAllPass.swift rename to tests/multiple-tests-all-pass/Sources/MultipleTestsAllPass/MultipleTestsAllPass.swift diff --git a/tests/multiple-tests-all-pass/Tests/LinuxMain.swift b/tests/multiple-tests-all-pass/Tests/LinuxMain.swift new file mode 100644 index 0000000..e6d9117 --- /dev/null +++ b/tests/multiple-tests-all-pass/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import MultipleTestsAllPassTests + +var tests = [XCTestCaseEntry]() +tests += MultipleTestsAllPassTests.allTests() +XCTMain(tests) diff --git a/test/multiple-tests-all-pass/Tests/MultipleAllPassTests/MultipleAllPassTests.swift b/tests/multiple-tests-all-pass/Tests/MultipleTestsAllPassTests/MultipleTestsAllPassTests.swift similarity index 88% rename from test/multiple-tests-all-pass/Tests/MultipleAllPassTests/MultipleAllPassTests.swift rename to tests/multiple-tests-all-pass/Tests/MultipleTestsAllPassTests/MultipleTestsAllPassTests.swift index ef57fa5..c9e8047 100644 --- a/test/multiple-tests-all-pass/Tests/MultipleAllPassTests/MultipleAllPassTests.swift +++ b/tests/multiple-tests-all-pass/Tests/MultipleTestsAllPassTests/MultipleTestsAllPassTests.swift @@ -1,8 +1,8 @@ import XCTest -@testable import MultipleAllPass +@testable import MultipleTestsAllPass -final class MultipleAllPassTests: XCTestCase { +final class MultipleTestsAllPassTests: XCTestCase { func testAdd() { XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") } diff --git a/test/multiple-tests-all-pass/Tests/MultipleAllPassTests/XCTestManifests.swift b/tests/multiple-tests-all-pass/Tests/MultipleTestsAllPassTests/XCTestManifests.swift similarity index 74% rename from test/multiple-tests-all-pass/Tests/MultipleAllPassTests/XCTestManifests.swift rename to tests/multiple-tests-all-pass/Tests/MultipleTestsAllPassTests/XCTestManifests.swift index e83b6c1..cb3998c 100644 --- a/test/multiple-tests-all-pass/Tests/MultipleAllPassTests/XCTestManifests.swift +++ b/tests/multiple-tests-all-pass/Tests/MultipleTestsAllPassTests/XCTestManifests.swift @@ -3,7 +3,7 @@ import XCTest #if !canImport(ObjectiveC) public func allTests() -> [XCTestCaseEntry] { return [ - testCase(MultipleAllPassTests.allTests), + testCase(MultipleTestsAllPassTests.allTests), testCase(SecondSuite.allTests), ] } diff --git a/tests/multiple-tests-all-pass/expected_results.json b/tests/multiple-tests-all-pass/expected_results.json new file mode 100644 index 0000000..e720f6a --- /dev/null +++ b/tests/multiple-tests-all-pass/expected_results.json @@ -0,0 +1,29 @@ +{ + "status": "pass", + "tests": [ + { + "name": "MultipleTestsAllPassTests.testAdd", + "status": "pass" + }, + { + "name": "MultipleTestsAllPassTests.testSub", + "status": "pass" + }, + { + "name": "MultipleTestsAllPassTests.testMul", + "status": "pass" + }, + { + "name": "SecondSuite.testAdd", + "status": "pass" + }, + { + "name": "SecondSuite.testSub", + "status": "pass" + }, + { + "name": "SecondSuite.testMul", + "status": "pass" + } + ] +} diff --git a/dockerTest/multiple-tests-multiple-fails/.gitignore b/tests/multiple-tests-multiple-fails/.gitignore similarity index 100% rename from dockerTest/multiple-tests-multiple-fails/.gitignore rename to tests/multiple-tests-multiple-fails/.gitignore diff --git a/tests/multiple-tests-multiple-fails/Package.swift b/tests/multiple-tests-multiple-fails/Package.swift new file mode 100644 index 0000000..6636eca --- /dev/null +++ b/tests/multiple-tests-multiple-fails/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "MultipleTestsMultipleFails", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "MultipleTestsMultipleFails", + targets: ["MultipleTestsMultipleFails"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "MultipleTestsMultipleFails", + dependencies: []), + .testTarget( + name: "MultipleTestsMultipleFailsTests", + dependencies: ["MultipleTestsMultipleFails"]), + ] +) diff --git a/dockerTest/multiple-tests-multiple-fails/Sources/MultipleMultipleFails/MultipleMultipleFails.swift b/tests/multiple-tests-multiple-fails/Sources/MultipleTestsMultipleFails/MultipleTestsMultipleFails.swift similarity index 100% rename from dockerTest/multiple-tests-multiple-fails/Sources/MultipleMultipleFails/MultipleMultipleFails.swift rename to tests/multiple-tests-multiple-fails/Sources/MultipleTestsMultipleFails/MultipleTestsMultipleFails.swift diff --git a/tests/multiple-tests-multiple-fails/Tests/LinuxMain.swift b/tests/multiple-tests-multiple-fails/Tests/LinuxMain.swift new file mode 100644 index 0000000..8ab085a --- /dev/null +++ b/tests/multiple-tests-multiple-fails/Tests/LinuxMain.swift @@ -0,0 +1,6 @@ +import MultipleTestsMultipleFailsTests +import XCTest + +var tests = [XCTestCaseEntry]() +tests += MultipleTestsMultipleFailsTests.allTests() +XCTMain(tests) diff --git a/dockerTest/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/MultipleMultipleFailsTests.swift b/tests/multiple-tests-multiple-fails/Tests/MultipleTestsMultipleFailsTests/MultipleTestsMultipleFailsTests.swift similarity index 75% rename from dockerTest/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/MultipleMultipleFailsTests.swift rename to tests/multiple-tests-multiple-fails/Tests/MultipleTestsMultipleFailsTests/MultipleTestsMultipleFailsTests.swift index a737f27..20bcb2a 100644 --- a/dockerTest/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/MultipleMultipleFailsTests.swift +++ b/tests/multiple-tests-multiple-fails/Tests/MultipleTestsMultipleFailsTests/MultipleTestsMultipleFailsTests.swift @@ -1,8 +1,8 @@ import XCTest -@testable import MultipleMultipleFails +@testable import MultipleTestsMultipleFails -final class MultipleMultipleFailsTests: XCTestCase { +final class MultipleTestsMultipleFailsTests: XCTestCase { func testAdd() { XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") } diff --git a/dockerTest/single-test-that-fails/Tests/SingleThatFailsTests/XCTestManifests.swift b/tests/multiple-tests-multiple-fails/Tests/MultipleTestsMultipleFailsTests/XCTestManifests.swift similarity index 67% rename from dockerTest/single-test-that-fails/Tests/SingleThatFailsTests/XCTestManifests.swift rename to tests/multiple-tests-multiple-fails/Tests/MultipleTestsMultipleFailsTests/XCTestManifests.swift index d35899b..5e0e8d1 100644 --- a/dockerTest/single-test-that-fails/Tests/SingleThatFailsTests/XCTestManifests.swift +++ b/tests/multiple-tests-multiple-fails/Tests/MultipleTestsMultipleFailsTests/XCTestManifests.swift @@ -3,7 +3,7 @@ import XCTest #if !canImport(ObjectiveC) public func allTests() -> [XCTestCaseEntry] { return [ - testCase(SingleThatFailsTests.allTests) + testCase(MultipleTestsMultipleFailsTests.allTests) ] } #endif diff --git a/tests/multiple-tests-multiple-fails/expected_results.json b/tests/multiple-tests-multiple-fails/expected_results.json new file mode 100644 index 0000000..cac6586 --- /dev/null +++ b/tests/multiple-tests-multiple-fails/expected_results.json @@ -0,0 +1,19 @@ +{ + "status": "fail", + "tests": [ + { + "message": "/home/wdn/dev/exercism/swift-test-runner/test/multiple-tests-multiple-fails/Tests/MultipleTestsMultipleFailsTests/MultipleTestsMultipleFailsTests.swift:7: error: MultipleTestsMultipleFailsTests.testAdd : XCTAssertEqual failed: (\"-1\") is not equal to (\"5\") - 2+3 should equal 5", + "name": "MultipleTestsMultipleFailsTests.testAdd", + "status": "fail" + }, + { + "message": "/home/wdn/dev/exercism/swift-test-runner/test/multiple-tests-multiple-fails/Tests/MultipleTestsMultipleFailsTests/MultipleTestsMultipleFailsTests.swift:11: error: MultipleTestsMultipleFailsTests.testSub : XCTAssertEqual failed: (\"5\") is not equal to (\"-1\") - ", + "name": "MultipleTestsMultipleFailsTests.testSub", + "status": "fail" + }, + { + "name": "MultipleTestsMultipleFailsTests.testMul", + "status": "pass" + } + ] +} diff --git a/dockerTest/multiple-tests-single-fail/.gitignore b/tests/multiple-tests-single-fail/.gitignore similarity index 100% rename from dockerTest/multiple-tests-single-fail/.gitignore rename to tests/multiple-tests-single-fail/.gitignore diff --git a/dockerTest/multiple-tests-multiple-fails/Package.swift b/tests/multiple-tests-single-fail/Package.swift similarity index 71% rename from dockerTest/multiple-tests-multiple-fails/Package.swift rename to tests/multiple-tests-single-fail/Package.swift index c1fe92b..2236076 100644 --- a/dockerTest/multiple-tests-multiple-fails/Package.swift +++ b/tests/multiple-tests-single-fail/Package.swift @@ -1,15 +1,15 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( - name: "MultipleMultipleFails", + name: "MultipleTestsSingleFail", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "MultipleMultipleFails", - targets: ["MultipleMultipleFails"]), + name: "MultipleTestsSingleFail", + targets: ["MultipleTestsSingleFail"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -19,10 +19,10 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "MultipleMultipleFails", + name: "MultipleTestsSingleFail", dependencies: []), .testTarget( - name: "MultipleMultipleFailsTests", - dependencies: ["MultipleMultipleFails"]), + name: "MultipleTestsSingleFailTests", + dependencies: ["MultipleTestsSingleFail"]), ] ) diff --git a/dockerTest/multiple-tests-single-fail/Sources/MultipleSingleFail/MultipleSingleFail.swift b/tests/multiple-tests-single-fail/Sources/MultipleTestsSingleFail/MultipleTestsSingleFail.swift similarity index 100% rename from dockerTest/multiple-tests-single-fail/Sources/MultipleSingleFail/MultipleSingleFail.swift rename to tests/multiple-tests-single-fail/Sources/MultipleTestsSingleFail/MultipleTestsSingleFail.swift diff --git a/tests/multiple-tests-single-fail/Tests/LinuxMain.swift b/tests/multiple-tests-single-fail/Tests/LinuxMain.swift new file mode 100644 index 0000000..ce25265 --- /dev/null +++ b/tests/multiple-tests-single-fail/Tests/LinuxMain.swift @@ -0,0 +1,6 @@ +import MultipleTestsSingleFailTests +import XCTest + +var tests = [XCTestCaseEntry]() +tests += MultipleTestsSingleFailTests.allTests() +XCTMain(tests) diff --git a/dockerTest/multiple-tests-single-fail/Tests/MultipleSingleFailTests/MultipleSingleFailTests.swift b/tests/multiple-tests-single-fail/Tests/MultipleTestsSingleFailTests/MultipleTestsSingleFailTests.swift similarity index 93% rename from dockerTest/multiple-tests-single-fail/Tests/MultipleSingleFailTests/MultipleSingleFailTests.swift rename to tests/multiple-tests-single-fail/Tests/MultipleTestsSingleFailTests/MultipleTestsSingleFailTests.swift index 7895664..67071d2 100644 --- a/dockerTest/multiple-tests-single-fail/Tests/MultipleSingleFailTests/MultipleSingleFailTests.swift +++ b/tests/multiple-tests-single-fail/Tests/MultipleTestsSingleFailTests/MultipleTestsSingleFailTests.swift @@ -1,8 +1,8 @@ import XCTest -@testable import MultipleSingleFail +@testable import MultipleTestsSingleFail -final class MultipleSingleFailTests: XCTestCase { +final class MultipleTestsSingleFailTests: XCTestCase { let runAll = Bool(ProcessInfo.processInfo.environment["RUNALL", default: "false"]) ?? false func testAdd() { diff --git a/dockerTest/multiple-tests-single-fail/Tests/MultipleSingleFailTests/XCTestManifests.swift b/tests/multiple-tests-single-fail/Tests/MultipleTestsSingleFailTests/XCTestManifests.swift similarity index 74% rename from dockerTest/multiple-tests-single-fail/Tests/MultipleSingleFailTests/XCTestManifests.swift rename to tests/multiple-tests-single-fail/Tests/MultipleTestsSingleFailTests/XCTestManifests.swift index 4f72e30..4a0b6d6 100644 --- a/dockerTest/multiple-tests-single-fail/Tests/MultipleSingleFailTests/XCTestManifests.swift +++ b/tests/multiple-tests-single-fail/Tests/MultipleTestsSingleFailTests/XCTestManifests.swift @@ -3,7 +3,7 @@ import XCTest #if !canImport(ObjectiveC) public func allTests() -> [XCTestCaseEntry] { return [ - testCase(MultipleSingleFailTests.allTests), + testCase(MultipleTestsSingleFailTests.allTests), testCase(SecondSuite.allTests), ] } diff --git a/tests/multiple-tests-single-fail/expected_results.json b/tests/multiple-tests-single-fail/expected_results.json new file mode 100644 index 0000000..6ab835f --- /dev/null +++ b/tests/multiple-tests-single-fail/expected_results.json @@ -0,0 +1,37 @@ +{ + "status": "fail", + "tests": [ + { + "message": "/home/wdn/dev/exercism/swift-test-runner/test/multiple-tests-single-fail/Tests/MultipleTestsSingleFailTests/MultipleTestsSingleFailTests.swift:9: error: MultipleTestsSingleFailTests.testAdd : XCTAssertEqual failed: (\"0\") is not equal to (\"5\") - 2+3 should equal 5", + "name": "MultipleTestsSingleFailTests.testAdd", + "output": "yabba…", + "status": "fail" + }, + { + "name": "MultipleTestsSingleFailTests.testSub", + "output": "dabba…", + "status": "pass" + }, + { + "name": "MultipleTestsSingleFailTests.testMul", + "output": "Benedick's speech is 674 character's long.\nI will not be sworn but love may transform me to an oyster,\nbut I’ll take my oath on it, till he have made an oyster of me,\nhe shall never make me such a fool. One woman is fair, yet\nI am well; another is wise, yet I am well; another virtuous,\n25yet I am well; but till all graces be in one woman, one\nwoman shall not come in my grace. Rich she shall be, that’s\ncertain; wise, or I’ll none; virtuous, or I’ll never cheapen\nher; fair, or I’ll ever look on h…", + "status": "pass" + }, + { + "message": "/home/wdn/dev/exercism/swift-test-runner/test/multiple-tests-single-fail/Tests/MultipleTestsSingleFailTests/MultipleTestsSingleFailTests.swift:34: error: SecondSuite.testAdd : XCTAssertEqual failed: (\"0\") is not equal to (\"25\") - 12+13 should equal 25", + "name": "SecondSuite.testAdd", + "output": "yabba…", + "status": "fail" + }, + { + "name": "SecondSuite.testSub", + "output": "dabba…", + "status": "pass" + }, + { + "name": "SecondSuite.testMul", + "output": "Benedick's speech is 674 character's long.\nI will not be sworn but love may transform me to an oyster,\nbut I’ll take my oath on it, till he have made an oyster of me,\nhe shall never make me such a fool. One woman is fair, yet\nI am well; another is wise, yet I am well; another virtuous,\n25yet I am well; but till all graces be in one woman, one\nwoman shall not come in my grace. Rich she shall be, that’s\ncertain; wise, or I’ll none; virtuous, or I’ll never cheapen\nher; fair, or I’ll ever look on h…", + "status": "pass" + } + ] +} diff --git a/dockerTest/multiple-tests-with-exception/.gitignore b/tests/multiple-tests-with-exception/.gitignore similarity index 100% rename from dockerTest/multiple-tests-with-exception/.gitignore rename to tests/multiple-tests-with-exception/.gitignore diff --git a/dockerTest/multiple-tests-with-exception/Package.swift b/tests/multiple-tests-with-exception/Package.swift similarity index 71% rename from dockerTest/multiple-tests-with-exception/Package.swift rename to tests/multiple-tests-with-exception/Package.swift index 501b2b9..b18e7e8 100644 --- a/dockerTest/multiple-tests-with-exception/Package.swift +++ b/tests/multiple-tests-with-exception/Package.swift @@ -1,15 +1,15 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( - name: "MultipleWithException", + name: "MultipleTestsWithException", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "MultipleWithException", - targets: ["MultipleWithException"]) + name: "MultipleTestsWithException", + targets: ["MultipleTestsWithException"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -19,10 +19,10 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "MultipleWithException", + name: "MultipleTestsWithException", dependencies: []), .testTarget( - name: "MultipleWithExceptionTests", - dependencies: ["MultipleWithException"]), + name: "MultipleTestsWithExceptionTests", + dependencies: ["MultipleTestsWithException"]), ] ) diff --git a/dockerTest/multiple-tests-with-exception/Sources/MultipleWithException/MultipleWithException.swift b/tests/multiple-tests-with-exception/Sources/MultipleTestsWithException/MultipleTestsWithException.swift similarity index 100% rename from dockerTest/multiple-tests-with-exception/Sources/MultipleWithException/MultipleWithException.swift rename to tests/multiple-tests-with-exception/Sources/MultipleTestsWithException/MultipleTestsWithException.swift diff --git a/tests/multiple-tests-with-exception/Tests/LinuxMain.swift b/tests/multiple-tests-with-exception/Tests/LinuxMain.swift new file mode 100644 index 0000000..a5492f6 --- /dev/null +++ b/tests/multiple-tests-with-exception/Tests/LinuxMain.swift @@ -0,0 +1,6 @@ +import MultipleTestsWithExceptionTests +import XCTest + +var tests = [XCTestCaseEntry]() +tests += MultipleTestsWithExceptionTests.allTests() +XCTMain(tests) diff --git a/dockerTest/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/MultipleWithExceptionTests.swift b/tests/multiple-tests-with-exception/Tests/MultipleTestsWithExceptionTests/MultipleTestsWithExceptionTests.swift similarity index 80% rename from dockerTest/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/MultipleWithExceptionTests.swift rename to tests/multiple-tests-with-exception/Tests/MultipleTestsWithExceptionTests/MultipleTestsWithExceptionTests.swift index 98a6b84..2774166 100644 --- a/dockerTest/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/MultipleWithExceptionTests.swift +++ b/tests/multiple-tests-with-exception/Tests/MultipleTestsWithExceptionTests/MultipleTestsWithExceptionTests.swift @@ -1,8 +1,8 @@ import XCTest -@testable import MultipleWithException +@testable import MultipleTestsWithException -final class MultipleWithExceptionTests: XCTestCase { +final class MultipleTestsWithExceptionTests: XCTestCase { func testAdd() { XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") } diff --git a/dockerTest/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/XCTestManifests.swift b/tests/multiple-tests-with-exception/Tests/MultipleTestsWithExceptionTests/XCTestManifests.swift similarity index 67% rename from dockerTest/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/XCTestManifests.swift rename to tests/multiple-tests-with-exception/Tests/MultipleTestsWithExceptionTests/XCTestManifests.swift index cbab108..9926250 100644 --- a/dockerTest/multiple-tests-with-exception/Tests/MultipleWithExceptionTests/XCTestManifests.swift +++ b/tests/multiple-tests-with-exception/Tests/MultipleTestsWithExceptionTests/XCTestManifests.swift @@ -3,7 +3,7 @@ import XCTest #if !canImport(ObjectiveC) public func allTests() -> [XCTestCaseEntry] { return [ - testCase(MultipleWithExceptionTests.allTests) + testCase(MultipleTestsWithExceptionTests.allTests) ] } #endif diff --git a/tests/multiple-tests-with-exception/expected_results.json b/tests/multiple-tests-with-exception/expected_results.json new file mode 100644 index 0000000..6dd796a --- /dev/null +++ b/tests/multiple-tests-with-exception/expected_results.json @@ -0,0 +1,22 @@ +{ + "status": "fail", + "tests": [ + { + "name": "MultipleTestsWithExceptionTests.testAdd", + "status": "pass" + }, + { + "name": "MultipleTestsWithExceptionTests.testSub", + "status": "pass" + }, + { + "name": "MultipleTestsWithExceptionTests.testMul", + "status": "pass" + }, + { + "message": "/home/wdn/dev/exercism/swift-test-runner/test/multiple-tests-with-exception/Tests/MultipleTestsWithExceptionTests/MultipleTestsWithExceptionTests.swift:19: error: MultipleTestsWithExceptionTests.testThrow : XCTAssertEqual threw error \"testError(\"Oh noes! Div by zeroes!!!\")\" - ", + "name": "MultipleTestsWithExceptionTests.testThrow", + "status": "fail" + } + ] +} diff --git a/dockerTest/single-test-that-fails/.gitignore b/tests/single-test-that-fails/.gitignore similarity index 100% rename from dockerTest/single-test-that-fails/.gitignore rename to tests/single-test-that-fails/.gitignore diff --git a/dockerTest/single-test-that-fails/Package.swift b/tests/single-test-that-fails/Package.swift similarity index 73% rename from dockerTest/single-test-that-fails/Package.swift rename to tests/single-test-that-fails/Package.swift index ec316d6..be97e84 100644 --- a/dockerTest/single-test-that-fails/Package.swift +++ b/tests/single-test-that-fails/Package.swift @@ -1,15 +1,15 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( - name: "SingleThatFails", + name: "SingleTestThatFails", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "SingleThatFails", - targets: ["SingleThatFails"]), + name: "SingleTestThatFails", + targets: ["SingleTestThatFails"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -19,10 +19,10 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "SingleThatFails", + name: "SingleTestThatFails", dependencies: []), .testTarget( - name: "SingleThatFailsTests", - dependencies: ["SingleThatFails"]), + name: "SingleTestThatFailsTests", + dependencies: ["SingleTestThatFails"]), ] ) diff --git a/dockerTest/single-test-that-fails/Sources/SingleThatFails/SingleThatFails.swift b/tests/single-test-that-fails/Sources/SingleTestThatFails/SingleTestThatFails.swift similarity index 100% rename from dockerTest/single-test-that-fails/Sources/SingleThatFails/SingleThatFails.swift rename to tests/single-test-that-fails/Sources/SingleTestThatFails/SingleTestThatFails.swift diff --git a/tests/single-test-that-fails/Tests/LinuxMain.swift b/tests/single-test-that-fails/Tests/LinuxMain.swift new file mode 100644 index 0000000..4d279bc --- /dev/null +++ b/tests/single-test-that-fails/Tests/LinuxMain.swift @@ -0,0 +1,6 @@ +import SingleTestThatFailsTests +import XCTest + +var tests = [XCTestCaseEntry]() +tests += SingleTestThatFailsTests.allTests() +XCTMain(tests) diff --git a/test/single-test-that-passes/Tests/SingleThatPassesTests/SingleThatPassesTests.swift b/tests/single-test-that-fails/Tests/SingleTestThatFailsTests/SingleTestThatFailsTests.swift similarity index 63% rename from test/single-test-that-passes/Tests/SingleThatPassesTests/SingleThatPassesTests.swift rename to tests/single-test-that-fails/Tests/SingleTestThatFailsTests/SingleTestThatFailsTests.swift index 8a8d431..9882958 100644 --- a/test/single-test-that-passes/Tests/SingleThatPassesTests/SingleThatPassesTests.swift +++ b/tests/single-test-that-fails/Tests/SingleTestThatFailsTests/SingleTestThatFailsTests.swift @@ -1,8 +1,8 @@ import XCTest -@testable import SingleThatPasses +@testable import SingleTestThatFails -final class SingleThatPassesTests: XCTestCase { +final class SingleTestThatFailsTests: XCTestCase { func testAdd() { XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") } diff --git a/dockerTest/single-test-that-passes/Tests/SingleThatPassesTests/XCTestManifests.swift b/tests/single-test-that-fails/Tests/SingleTestThatFailsTests/XCTestManifests.swift similarity index 70% rename from dockerTest/single-test-that-passes/Tests/SingleThatPassesTests/XCTestManifests.swift rename to tests/single-test-that-fails/Tests/SingleTestThatFailsTests/XCTestManifests.swift index 76f6b7a..425c116 100644 --- a/dockerTest/single-test-that-passes/Tests/SingleThatPassesTests/XCTestManifests.swift +++ b/tests/single-test-that-fails/Tests/SingleTestThatFailsTests/XCTestManifests.swift @@ -3,7 +3,7 @@ import XCTest #if !canImport(ObjectiveC) public func allTests() -> [XCTestCaseEntry] { return [ - testCase(SingleThatPassesTests.allTests) + testCase(SingleTestThatFailsTests.allTests) ] } #endif diff --git a/tests/single-test-that-fails/expected_results.json b/tests/single-test-that-fails/expected_results.json new file mode 100644 index 0000000..bc016ef --- /dev/null +++ b/tests/single-test-that-fails/expected_results.json @@ -0,0 +1,10 @@ +{ + "status": "fail", + "tests": [ + { + "message": "/home/wdn/dev/exercism/swift-test-runner/test/single-test-that-fails/Tests/SingleTestThatFailsTests/SingleTestThatFailsTests.swift:7: error: SingleTestThatFailsTests.testAdd : XCTAssertEqual failed: (\"-1\") is not equal to (\"5\") - 2+3 should equal 5", + "name": "SingleTestThatFailsTests.testAdd", + "status": "fail" + } + ] +} diff --git a/dockerTest/single-test-that-passes/.gitignore b/tests/single-test-that-passes/.gitignore similarity index 100% rename from dockerTest/single-test-that-passes/.gitignore rename to tests/single-test-that-passes/.gitignore diff --git a/dockerTest/multiple-tests-single-fail/Package.swift b/tests/single-test-that-passes/Package.swift similarity index 73% rename from dockerTest/multiple-tests-single-fail/Package.swift rename to tests/single-test-that-passes/Package.swift index e310a14..8ca6adb 100644 --- a/dockerTest/multiple-tests-single-fail/Package.swift +++ b/tests/single-test-that-passes/Package.swift @@ -1,15 +1,15 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( - name: "MultipleSingleFail", + name: "SingleTestThatPasses", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "MultipleSingleFail", - targets: ["MultipleSingleFail"]), + name: "SingleTestThatPasses", + targets: ["SingleTestThatPasses"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -19,10 +19,10 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "MultipleSingleFail", + name: "SingleTestThatPasses", dependencies: []), .testTarget( - name: "MultipleSingleFailTests", - dependencies: ["MultipleSingleFail"]), + name: "SingleTestThatPassesTests", + dependencies: ["SingleTestThatPasses"]), ] ) diff --git a/dockerTest/single-test-that-passes/Sources/SingleThatPasses/SingleThatPasses.swift b/tests/single-test-that-passes/Sources/SingleTestThatPasses/SingleTestThatPasses.swift similarity index 100% rename from dockerTest/single-test-that-passes/Sources/SingleThatPasses/SingleThatPasses.swift rename to tests/single-test-that-passes/Sources/SingleTestThatPasses/SingleTestThatPasses.swift diff --git a/tests/single-test-that-passes/Tests/LinuxMain.swift b/tests/single-test-that-passes/Tests/LinuxMain.swift new file mode 100644 index 0000000..916e248 --- /dev/null +++ b/tests/single-test-that-passes/Tests/LinuxMain.swift @@ -0,0 +1,6 @@ +import SingleTestThatPassesTests +import XCTest + +var tests = [XCTestCaseEntry]() +tests += SingleTestThatPassesTests.allTests() +XCTMain(tests) diff --git a/dockerTest/single-test-that-fails/Tests/SingleThatFailsTests/SingleThatFailsTests.swift b/tests/single-test-that-passes/Tests/SingleTestThatPassesTests/SingleTestThatPassesTests.swift similarity index 62% rename from dockerTest/single-test-that-fails/Tests/SingleThatFailsTests/SingleThatFailsTests.swift rename to tests/single-test-that-passes/Tests/SingleTestThatPassesTests/SingleTestThatPassesTests.swift index d456db7..13e26eb 100644 --- a/dockerTest/single-test-that-fails/Tests/SingleThatFailsTests/SingleThatFailsTests.swift +++ b/tests/single-test-that-passes/Tests/SingleTestThatPassesTests/SingleTestThatPassesTests.swift @@ -1,8 +1,8 @@ import XCTest -@testable import SingleThatFails +@testable import SingleTestThatPasses -final class SingleThatFailsTests: XCTestCase { +final class SingleTestThatPassesTests: XCTestCase { func testAdd() { XCTAssertEqual(sum(2, 3), 5, "2+3 should equal 5") } diff --git a/dockerTest/single-test-with-exception/Tests/SingleWithExceptionTests/XCTestManifests.swift b/tests/single-test-that-passes/Tests/SingleTestThatPassesTests/XCTestManifests.swift similarity index 70% rename from dockerTest/single-test-with-exception/Tests/SingleWithExceptionTests/XCTestManifests.swift rename to tests/single-test-that-passes/Tests/SingleTestThatPassesTests/XCTestManifests.swift index 61fb57b..09dab25 100644 --- a/dockerTest/single-test-with-exception/Tests/SingleWithExceptionTests/XCTestManifests.swift +++ b/tests/single-test-that-passes/Tests/SingleTestThatPassesTests/XCTestManifests.swift @@ -3,7 +3,7 @@ import XCTest #if !canImport(ObjectiveC) public func allTests() -> [XCTestCaseEntry] { return [ - testCase(SingleWithExceptionTests.allTests) + testCase(SingleTestThatPassesTests.allTests) ] } #endif diff --git a/tests/single-test-that-passes/expected_results.json b/tests/single-test-that-passes/expected_results.json new file mode 100644 index 0000000..2227a83 --- /dev/null +++ b/tests/single-test-that-passes/expected_results.json @@ -0,0 +1,9 @@ +{ + "status": "pass", + "tests": [ + { + "name": "SingleTestThatPassesTests.testAdd", + "status": "pass" + } + ] +} diff --git a/dockerTest/single-test-with-exception/.gitignore b/tests/single-test-with-exception/.gitignore similarity index 100% rename from dockerTest/single-test-with-exception/.gitignore rename to tests/single-test-with-exception/.gitignore diff --git a/tests/single-test-with-exception/Package.swift b/tests/single-test-with-exception/Package.swift new file mode 100644 index 0000000..ce51030 --- /dev/null +++ b/tests/single-test-with-exception/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "SingleTestWithException", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "SingleTestWithException", + targets: ["SingleTestWithException"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "SingleTestWithException", + dependencies: []), + .testTarget( + name: "SingleTestWithExceptionTests", + dependencies: ["SingleTestWithException"]), + ] +) diff --git a/dockerTest/single-test-with-exception/Sources/SingleWithException/SingleWithException.swift b/tests/single-test-with-exception/Sources/SingleTestWithException/SingleTestWithException.swift similarity index 100% rename from dockerTest/single-test-with-exception/Sources/SingleWithException/SingleWithException.swift rename to tests/single-test-with-exception/Sources/SingleTestWithException/SingleTestWithException.swift diff --git a/tests/single-test-with-exception/Tests/LinuxMain.swift b/tests/single-test-with-exception/Tests/LinuxMain.swift new file mode 100644 index 0000000..0ce37a8 --- /dev/null +++ b/tests/single-test-with-exception/Tests/LinuxMain.swift @@ -0,0 +1,6 @@ +import SingleTestWithExceptionTests +import XCTest + +var tests = [XCTestCaseEntry]() +tests += SingleTestWithExceptionTests.allTests() +XCTMain(tests) diff --git a/test/single-test-with-exception/Tests/SingleWithExceptionTests/SingleWithExceptionTests.swift b/tests/single-test-with-exception/Tests/SingleTestWithExceptionTests/SingleTestWithExceptionTests.swift similarity index 61% rename from test/single-test-with-exception/Tests/SingleWithExceptionTests/SingleWithExceptionTests.swift rename to tests/single-test-with-exception/Tests/SingleTestWithExceptionTests/SingleTestWithExceptionTests.swift index 376a9c2..8b19aeb 100644 --- a/test/single-test-with-exception/Tests/SingleWithExceptionTests/SingleWithExceptionTests.swift +++ b/tests/single-test-with-exception/Tests/SingleTestWithExceptionTests/SingleTestWithExceptionTests.swift @@ -1,8 +1,8 @@ import XCTest -@testable import SingleWithException +@testable import SingleTestWithException -final class SingleWithExceptionTests: XCTestCase { +final class SingleTestWithExceptionTests: XCTestCase { func testAdd() { XCTAssertEqual(try sum(2, 3), 5, "2+3 should equal 5") } diff --git a/dockerTest/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/XCTestManifests.swift b/tests/single-test-with-exception/Tests/SingleTestWithExceptionTests/XCTestManifests.swift similarity index 68% rename from dockerTest/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/XCTestManifests.swift rename to tests/single-test-with-exception/Tests/SingleTestWithExceptionTests/XCTestManifests.swift index 1bde348..86df0f1 100644 --- a/dockerTest/multiple-tests-multiple-fails/Tests/MultipleMultipleFailsTests/XCTestManifests.swift +++ b/tests/single-test-with-exception/Tests/SingleTestWithExceptionTests/XCTestManifests.swift @@ -3,7 +3,7 @@ import XCTest #if !canImport(ObjectiveC) public func allTests() -> [XCTestCaseEntry] { return [ - testCase(MultipleMultipleFailsTests.allTests) + testCase(SingleTestWithExceptionTests.allTests) ] } #endif diff --git a/tests/single-test-with-exception/expected_results.json b/tests/single-test-with-exception/expected_results.json new file mode 100644 index 0000000..59cbf62 --- /dev/null +++ b/tests/single-test-with-exception/expected_results.json @@ -0,0 +1,10 @@ +{ + "status": "fail", + "tests": [ + { + "message": "/home/wdn/dev/exercism/swift-test-runner/test/single-test-with-exception/Tests/SingleTestWithExceptionTests/SingleTestWithExceptionTests.swift:7: error: SingleTestWithExceptionTests.testAdd : XCTAssertEqual threw error \"testError(\"Kaboomtown!\")\" - 2+3 should equal 5", + "name": "SingleTestWithExceptionTests.testAdd", + "status": "fail" + } + ] +}