Skip to content

Commit f3f2481

Browse files
author
José Valim
committed
Ensure tracing set default max cases to 1
1 parent d33463d commit f3f2481

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

lib/ex_unit/lib/ex_unit/runner.ex

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,21 @@ defmodule ExUnit.Runner do
2727
end
2828

2929
defp normalize_opts(opts) do
30+
opts =
31+
if opts[:trace] do
32+
Keyword.put_new(opts, :max_cases, 1)
33+
else
34+
Keyword.put(opts, :trace, false)
35+
end
36+
3037
{ include, exclude } = ExUnit.Filters.normalize(opts[:include], opts[:exclude])
3138

32-
opts = opts
33-
|> Keyword.put(:exclude, exclude)
34-
|> Keyword.put(:include, include)
35-
|> Keyword.put_new(:color, IO.ANSI.terminal?)
36-
|> Keyword.put_new(:max_cases, :erlang.system_info(:schedulers_online))
37-
|> Keyword.put_new(:seed, :erlang.now |> elem(2))
38-
39-
if opts[:trace] do
40-
Keyword.put_new(opts, :max_cases, 1)
41-
else
42-
Keyword.put(opts, :trace, false)
43-
end
39+
opts
40+
|> Keyword.put(:exclude, exclude)
41+
|> Keyword.put(:include, include)
42+
|> Keyword.put_new(:color, IO.ANSI.terminal?)
43+
|> Keyword.put_new(:max_cases, :erlang.system_info(:schedulers_online))
44+
|> Keyword.put_new(:seed, :erlang.now |> elem(2))
4445
end
4546

4647
defp loop(Config[] = config) do

0 commit comments

Comments
 (0)