       System.at_exit fn
         0 ->
           time = ExUnit.Server.cases_loaded()
-          %{failures: failures} = ExUnit.Runner.run(configuration(), time)
+          %{failures: failures} = ExUnit.Runner.run(config, time)
           System.at_exit fn _ ->
             if failures > 0, do: exit({:shutdown, 1})
           end

  of failures and the number of skipped tests.
  """
  def run do
    ExUnit.Runner.run(configuration(), nil)
  end

  # Configures on demand defaults
  defp configure_defaults(opts) do
    opts
    |> Keyword.put_new(:seed, :os.timestamp |> elem(2))
    |> Keyword.put(:max_cases, max_cases(opts))
  end

  defp max_cases(opts) do

  def start(options \\ []) do
    {:ok, _} = Application.ensure_all_started(:ex_unit)

    configure(options)
    config = put_defaults(configuration())

    if Application.fetch_env!(:ex_unit, :autorun) do
      Application.put_env(:ex_unit, :autorun, false)
