Skip to content

Commit 9b254e6

Browse files
committed
Do not expect OTP to be compiled with docs, closes #12677
1 parent 0dd933b commit 9b254e6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/mix/test/mix/tasks/compile_test.exs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,16 +329,22 @@ defmodule Mix.Tasks.CompileTest do
329329
Application.delete_env(:sample, :hello, persistent: true)
330330
end
331331

332-
test "code path prunning" do
332+
test "code path pruning" do
333333
Mix.ensure_application!(:parsetools)
334+
otp_docs? = match?({:docs_v1, _, _, _, _, _, _}, Code.fetch_docs(:zlib))
334335

335336
in_fixture("no_mixfile", fn ->
336337
assert Mix.Task.run("compile", []) == {:ok, []}
337338
assert :code.where_is_file(~c"parsetools.app") == :non_existing
338339

339340
# Make sure erts is also kept but not loaded
340-
assert {:docs_v1, _, _, _, _, _, _} = Code.fetch_docs(:zlib)
341341
assert Application.spec(:erts, :vsn) == nil
342+
343+
if otp_docs? do
344+
assert {:docs_v1, _, _, _, _, _, _} = Code.fetch_docs(:zlib)
345+
else
346+
IO.warn("Erlang/OTP was not compiled with docs, skipping assertion")
347+
end
342348
end)
343349
end
344350

0 commit comments

Comments
 (0)