@@ -24,6 +24,8 @@ tests = [
24
24
# ("Fault Tolerance", "fault-tolerance.jl"),
25
25
]
26
26
all_test_names = map (test -> replace (last (test), " .jl" => " " ), tests)
27
+ additional_workers:: Int = 3
28
+
27
29
if PROGRAM_FILE != " " && realpath (PROGRAM_FILE ) == @__FILE__
28
30
pushfirst! (LOAD_PATH , @__DIR__ )
29
31
pushfirst! (LOAD_PATH , joinpath (@__DIR__ , " .." ))
@@ -41,8 +43,13 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
41
43
" -s" , " --simulate"
42
44
action = :store_true
43
45
help = " Don't actually run the tests"
46
+ " -p" , " --procs"
47
+ arg_type = Int
48
+ default = additional_workers
49
+ help = " How many additional workers to launch"
44
50
end
45
51
end
52
+
46
53
parsed_args = parse_args (s)
47
54
to_test = String[]
48
55
for test in parsed_args[" test" ]
@@ -64,16 +71,23 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
64
71
exit (1 )
65
72
end
66
73
end
74
+
67
75
@info " Running tests: $(join (to_test, " , " )) "
68
76
parsed_args[" simulate" ] && exit (0 )
77
+
78
+ additional_workers = parsed_args[" procs" ]
69
79
else
70
80
to_test = all_test_names
71
81
@info " Running all tests"
72
82
end
73
83
74
84
75
85
using Distributed
76
- addprocs (3 ; exeflags= " --project=$(joinpath (@__DIR__ , " .." )) " )
86
+ if additional_workers > 0
87
+ # We put this inside a branch because addprocs() takes a minimum of 1s to
88
+ # complete even if doing nothing, which is annoying.
89
+ addprocs (additional_workers; exeflags= " --project=$(joinpath (@__DIR__ , " .." )) " )
90
+ end
77
91
78
92
include (" imports.jl" )
79
93
include (" util.jl" )
0 commit comments