Skip to content

Commit 611598b

Browse files
committed
Add :require_ast
1 parent 07393e6 commit 611598b

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

lib/mix/test/mix/tasks/source_test.exs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ defmodule Mix.Tasks.SourceTest do
1919
end)
2020
end
2121

22+
@tag :require_ast
2223
test "source MODULE.FUN", context do
2324
in_tmp(context.test, fn ->
2425
Mix.Tasks.Source.run(["Enum.map"])
@@ -27,6 +28,7 @@ defmodule Mix.Tasks.SourceTest do
2728
end)
2829
end
2930

31+
@tag :require_ast
3032
test "source MODULE.FUN/ARITY", context do
3133
in_tmp(context.test, fn ->
3234
Mix.Tasks.Source.run(["Enum.map/2"])
@@ -80,23 +82,6 @@ defmodule Mix.Tasks.SourceTest do
8082
else: System.delete_env("ELIXIR_EDITOR")
8183
end
8284

83-
test "source -o opens with shortcut", context do
84-
System.put_env("ELIXIR_EDITOR", "echo __LINE__:__FILE__")
85-
86-
in_tmp(context.test, fn ->
87-
output =
88-
capture_io(fn ->
89-
Mix.Tasks.Source.run(["-o", "Enum.map/2"])
90-
end)
91-
92-
assert output =~ ~r"\d+:.*lib/elixir/lib/enum\.ex"
93-
end)
94-
after
95-
if @editor,
96-
do: System.put_env("ELIXIR_EDITOR", @editor),
97-
else: System.delete_env("ELIXIR_EDITOR")
98-
end
99-
10085
test "source --open without editor" do
10186
System.delete_env("ELIXIR_EDITOR")
10287
System.delete_env("EDITOR")

lib/mix/test/test_helper.exs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ git_exclude =
3636
{line_exclude, line_include} =
3737
if line = System.get_env("LINE"), do: {[:test], [line: line]}, else: {[], []}
3838

39-
cover_exclude =
39+
deterministic_exclude =
4040
if :deterministic in :compile.env_compiler_options() do
4141
[:cover, :requires_source]
4242
else
@@ -52,7 +52,13 @@ re_import_exclude =
5252
end
5353

5454
Code.require_file("../../elixir/scripts/cover_record.exs", __DIR__)
55-
CoverageRecorder.maybe_record("mix")
55+
56+
cover_exclude =
57+
if CoverageRecorder.maybe_record("mix") do
58+
[:require_ast]
59+
else
60+
[]
61+
end
5662

5763
maybe_seed_opt = if seed = System.get_env("SEED"), do: [seed: String.to_integer(seed)], else: []
5864

@@ -61,6 +67,7 @@ ex_unit_opts =
6167
trace: !!System.get_env("TRACE"),
6268
exclude:
6369
epmd_exclude ++
70+
deterministic_exclude ++
6471
os_exclude ++ git_exclude ++ line_exclude ++ cover_exclude ++ re_import_exclude,
6572
include: line_include,
6673
assert_receive_timeout: String.to_integer(System.get_env("ELIXIR_ASSERT_TIMEOUT", "300"))

0 commit comments

Comments
 (0)