diff --git a/lib/elixir/test/elixir/test_helper.exs b/lib/elixir/test/elixir/test_helper.exs index abd34b1a52..27367cf375 100644 --- a/lib/elixir/test/elixir/test_helper.exs +++ b/lib/elixir/test/elixir/test_helper.exs @@ -18,14 +18,20 @@ defmodule PathHelpers do Path.join(tmp_path, extra) end + def elixirc(args) do + runcmd(elixirc_executable,args) + end + + def elixir(args) do + runcmd(elixir_executable,args) + end + if match? { :win32, _ }, :os.type do def executable_extension, do: ".bat" - def elixirc(args), do: :os.cmd binary_to_list("#{elixirc_executable} #{:unicode.characters_to_binary(args)} 2>&1") - def elixir(args), do: :os.cmd binary_to_list("#{elixir_executable} #{:unicode.characters_to_binary(args)} 2>&1") + defp runcmd(executable,args), do: :os.cmd binary_to_list("#{executable} #{:unicode.characters_to_binary(args)} 2>&1") else def executable_extension, do: "" - def elixirc(args), do: :os.cmd binary_to_list("#{elixirc_executable} #{:unicode.characters_to_binary(args)}") - def elixir(args), do: :os.cmd binary_to_list("#{elixir_executable} #{:unicode.characters_to_binary(args)}") + defp runcmd(executable,args), do: :os.cmd binary_to_list("#{executable} #{:unicode.characters_to_binary(args)}") end def elixir_executable do @@ -35,7 +41,6 @@ defmodule PathHelpers do def elixirc_executable do Path.expand("../../../../../bin/elixirc#{executable_extension}", __FILE__) end - end defmodule CompileAssertion do