-
Notifications
You must be signed in to change notification settings - Fork 367
/
runtests.jl
81 lines (72 loc) · 2.05 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# Correctness Tests
#
fatalerrors = length(ARGS) > 0 && ARGS[1] == "-f"
quiet = length(ARGS) > 0 && ARGS[1] == "-q"
anyerrors = false
using DataFrames, Dates, Test, Random, InlineStrings
if Threads.nthreads() < 2
@warn("Running tests with only one thread: correctness of parallel operations is not checked")
else
@info("Running tests with $(Threads.nthreads()) threads")
end
ambiguities_vec = Test.detect_ambiguities(DataFrames, recursive=true)
if !isempty(ambiguities_vec)
@error "Method ambiguities:"
display(ambiguities_vec)
throw(AssertionError("method dispatch ambiguities found"))
end
unbound_args_vec = Test.detect_unbound_args(DataFrames, recursive=true)
if !isempty(unbound_args_vec)
@error "Unbound type parameters:"
display(unbound_args_vec)
throw(AssertionError("unbound type parameters found"))
end
my_tests = ["utils.jl",
"cat.jl",
"data.jl",
"index.jl",
"dataframe.jl",
"insertion.jl",
"select.jl",
"reshape.jl",
"dataframerow.jl",
"io.jl",
"constructors.jl",
"conversions.jl",
"sort.jl",
"grouping.jl",
"subset.jl",
"join.jl",
"iteration.jl",
"duplicates.jl",
"show.jl",
"subdataframe.jl",
"subdataframe_mutation.jl",
"tables.jl",
"tabletraits.jl",
"indexing.jl",
"broadcasting.jl",
"string.jl",
"multithreading.jl",
"metadata.jl",
"deprecated.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