39 lines
1.4 KiB
Diff
39 lines
1.4 KiB
Diff
From 9b254e6830d0f44e26179582a16fef6f642df754 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@dashbit.co>
|
|
Date: Tue, 20 Jun 2023 12:31:53 +0200
|
|
Subject: [PATCH] Do not expect OTP to be compiled with docs, closes #12677
|
|
|
|
---
|
|
lib/mix/test/mix/tasks/compile_test.exs | 10 ++++++++--
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/lib/mix/test/mix/tasks/compile_test.exs b/lib/mix/test/mix/tasks/compile_test.exs
|
|
index cdc40977c7..c4e672ffd2 100644
|
|
--- a/lib/mix/test/mix/tasks/compile_test.exs
|
|
+++ b/lib/mix/test/mix/tasks/compile_test.exs
|
|
@@ -329,16 +329,22 @@ defmodule Mix.Tasks.CompileTest do
|
|
Application.delete_env(:sample, :hello, persistent: true)
|
|
end
|
|
|
|
- test "code path prunning" do
|
|
+ test "code path pruning" do
|
|
Mix.ensure_application!(:parsetools)
|
|
+ otp_docs? = match?({:docs_v1, _, _, _, _, _, _}, Code.fetch_docs(:zlib))
|
|
|
|
in_fixture("no_mixfile", fn ->
|
|
assert Mix.Task.run("compile", []) == {:ok, []}
|
|
assert :code.where_is_file(~c"parsetools.app") == :non_existing
|
|
|
|
# Make sure erts is also kept but not loaded
|
|
- assert {:docs_v1, _, _, _, _, _, _} = Code.fetch_docs(:zlib)
|
|
assert Application.spec(:erts, :vsn) == nil
|
|
+
|
|
+ if otp_docs? do
|
|
+ assert {:docs_v1, _, _, _, _, _, _} = Code.fetch_docs(:zlib)
|
|
+ else
|
|
+ IO.warn("Erlang/OTP was not compiled with docs, skipping assertion")
|
|
+ end
|
|
end)
|
|
end
|
|
|