Skip to content

Commit

Permalink
Merge pull request JuliaLang#9 from SaschaMann/tests-rm-dir-fix
Browse files Browse the repository at this point in the history
RFC: Fix removal of temp dir if tests fail
  • Loading branch information
SaschaMann authored Jan 23, 2017
2 parents 159a5cd + 4bfca0a commit d1be1f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"ignored": [
"bin",
"img",
"docs"
"docs",
"juliamnt"
],
"foregone": [

Expand Down
14 changes: 8 additions & 6 deletions runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ for (root, dirs, files) in walkdir("exercises")
cp(joinpath(exercise_path, "example.jl"), joinpath(temp_path, "$exercise.jl"))
cp(joinpath(exercise_path, "runtests.jl"), joinpath(temp_path, "runtests.jl"))

# Run the tests
result = @testset "$exercise example" begin
include(joinpath(temp_path, "runtests.jl"))
try
# Run the tests
result = @testset "$exercise example" begin
include(joinpath(temp_path, "runtests.jl"))
end
finally
# Delete the temporary directory
rm(temp_path, recursive=true)
end

# Delete the temporary directory
rm(temp_path, recursive=true)

# Print test output (this is the default behaviour for older versions of Julia)
if VERSION > v"0.6.0-dev"
Base.Test.print_test_results(result)
Expand Down

0 comments on commit d1be1f0

Please sign in to comment.