@@ -24,6 +24,8 @@ tests = [
2424 # ("Fault Tolerance", "fault-tolerance.jl"),
2525]
2626all_test_names = map (test -> replace (last (test), " .jl" => " " ), tests)
27+ additional_workers:: Int = 3
28+
2729if PROGRAM_FILE != " " && realpath (PROGRAM_FILE ) == @__FILE__
2830 pushfirst! (LOAD_PATH , @__DIR__ )
2931 pushfirst! (LOAD_PATH , joinpath (@__DIR__ , " .." ))
@@ -41,8 +43,13 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
4143 " -s" , " --simulate"
4244 action = :store_true
4345 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"
4450 end
4551 end
52+
4653 parsed_args = parse_args (s)
4754 to_test = String[]
4855 for test in parsed_args[" test" ]
@@ -64,16 +71,23 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
6471 exit (1 )
6572 end
6673 end
74+
6775 @info " Running tests: $(join (to_test, " , " )) "
6876 parsed_args[" simulate" ] && exit (0 )
77+
78+ additional_workers = parsed_args[" procs" ]
6979else
7080 to_test = all_test_names
7181 @info " Running all tests"
7282end
7383
7484
7585using 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
7791
7892include (" imports.jl" )
7993include (" util.jl" )
0 commit comments