Sha256: 67dd2ab2e3694df69b8d696728c639b33420334e47f22c0b49594c213b7c2e2e

Contents?: true

Size: 1.28 KB

Versions: 83

Compression:

Stored size: 1.28 KB

Contents

using Base.Test

import Base.Test.@test_skip, Base.Test.@test_broken

# When testing the example solution, all tests must pass, even ones marked as skipped or broken.
# The track user will not be affected by this.
# Overwrite @test_skip, @test_broken with @test
macro test_skip(ex)
    @test eval(current_module(), ex)
end

macro test_broken(ex)
    @test eval(current_module(), ex)
end

for exercise in readdir("exercises")
    # Allow only testing specified execises
    if !isempty(ARGS) && !(exercise in ARGS)
        continue
    end

    exercise_path = joinpath("exercises", exercise)
    isdir(exercise_path) || continue

    # Create temporary directory
    temp_path = mktempdir(".")

    # Copy tests & example to the temporary directory
    cp(joinpath(exercise_path, "example.jl"), joinpath(temp_path, "$exercise.jl"))
    cp(joinpath(exercise_path, "runtests.jl"), joinpath(temp_path, "runtests.jl"))

    try
        # Run the tests
        @testset "$exercise example" begin
            # Run the tests within an anonymous module to prevent definitions from
            # one exercise leaking into another.
            eval(Module(), :(include(joinpath($temp_path, "runtests.jl"))))
        end
    finally
        # Delete the temporary directory
        rm(temp_path, recursive=true)
    end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/julia/runtests.jl
trackler-2.2.1.97 tracks/julia/runtests.jl
trackler-2.2.1.96 tracks/julia/runtests.jl