Skip to content

Commit c028c2d

Browse files
michallepickijosevalim
authored andcommitted
Recreate local.sample task fixture in test_helper.exs (#11640)
1 parent 4b480cb commit c028c2d

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ clean_residual_files:
171171
rm -rf lib/mix/test/fixtures/git_rebar/
172172
rm -rf lib/mix/test/fixtures/git_repo/
173173
rm -rf lib/mix/test/fixtures/git_sparse_repo/
174+
rm -rf lib/mix/test/fixtures/archive/ebin/
174175
rm -f erl_crash.dump
175176
$(Q) $(MAKE) clean_man
176177

lib/mix/test/fixtures/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/git_rebar/
55
/git_repo/
66
/git_sparse_repo/
7+
/archive/ebin/
Binary file not shown.

lib/mix/test/fixtures/archive/ebin/local_sample.app

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/mix/test/test_helper.exs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,26 @@ Enum.each([:invalidapp, :invalidvsn, :noappfile, :nosemver, :ok], fn dep ->
412412
File.mkdir_p!(Path.expand("fixtures/deps_status/deps/#{dep}/.git", __DIR__))
413413
end)
414414

415+
# Archive ebin
416+
target = Path.expand("fixtures/archive", __DIR__)
417+
418+
unless File.dir?(Path.join(target, "ebin")) do
419+
File.mkdir_p!(Path.join(target, "ebin"))
420+
421+
File.write!(Path.join([target, "ebin", "local_sample.app"]), """
422+
{application,local_sample,
423+
[
424+
{modules,['Elixir.Mix.Tasks.Local.Sample']},
425+
{applications,[kernel,stdlib,elixir]}
426+
]
427+
}.
428+
""")
429+
430+
[{name, bin}] = Code.compile_file("lib/local.sample.ex", target)
431+
432+
File.write!(Path.join([target, "ebin", Atom.to_string(name) <> ".beam"]), bin)
433+
end
434+
415435
## Generate helper modules
416436

417437
path = MixTest.Case.tmp_path("beams")

0 commit comments

Comments
 (0)