Revision 4aeb2d499686beab0e66978e8719357387dc1b25 authored by Fabian R Lischka on 26 April 2017, 16:28:44 UTC, committed by Tony Kelman on 26 April 2017, 16:28:44 UTC
* add docstring to base/Dates, base/Pkg * use jldoctest, backticks, clean up, typos * add module name on first line of docstring * add space after comma in tuples (as in 0.6) * add link to ISO 8601 wikipedia
1 parent 53161af
testdefs.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license
function runtests(name, isolate=true)
old_print_setting = Base.Test.TESTSET_PRINT_ENABLE[]
Base.Test.TESTSET_PRINT_ENABLE[] = false
try
if isolate
# Simple enough to type and random enough so that no one will hard
# code it in the test
mod_name = Symbol("Test", rand(1:100), "Main_", replace(name, '/', '_'))
m = @eval(Main, module $mod_name end)
else
m = Main
end
@eval(m, using Base.Test)
ex = quote
@timed @testset $"$name" begin
include($"$name.jl")
end
end
res_and_time_data = eval(m, ex)
rss = Sys.maxrss()
#res_and_time_data[1] is the testset
passes,fails,error,broken,c_passes,c_fails,c_errors,c_broken = Base.Test.get_test_counts(res_and_time_data[1])
if res_and_time_data[1].anynonpass == false
res_and_time_data = (
(passes+c_passes,broken+c_broken),
res_and_time_data[2],
res_and_time_data[3],
res_and_time_data[4],
res_and_time_data[5])
end
vcat(collect(res_and_time_data), rss)
finally
Base.Test.TESTSET_PRINT_ENABLE[] = old_print_setting
end
end
# looking in . messes things up badly
filter!(x->x!=".", LOAD_PATH)
nothing
Computing file changes ...