-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathruntests.jl
53 lines (46 loc) · 1.14 KB
/
runtests.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# Correctness Tests
#
fatalerrors = length(ARGS) > 0 && ARGS[1] == "-f"
quiet = length(ARGS) > 0 && ARGS[1] == "-q"
anyerrors = false
using InMemoryDatasets, Test, Random
if VERSION > v"1.3"
if Threads.nthreads() < 2
@warn("Running with only one thread: correctness of parallel operations is not tested")
else
@show Threads.nthreads()
end
end
my_tests = ["constructors.jl",
"characters.jl",
"utils.jl",
"subdataset.jl",
"broadcasting.jl",
"data.jl",
"byrow.jl",
"sort.jl",
"grouping.jl",
"join.jl",
"transpose.jl",
"stats.jl"
]
println("Running tests:")
for my_test in my_tests
try
include(my_test)
println("\t\033[1m\033[32mPASSED\033[0m: $(my_test)")
catch e
global anyerrors = true
println("\t\033[1m\033[31mFAILED\033[0m: $(my_test)")
if fatalerrors
rethrow(e)
elseif !quiet
showerror(stdout, e, backtrace())
println()
end
end
end
if anyerrors
throw("Tests failed")
end