Skip to content

Commit 96a1c0b

Browse files
committed
Exclude gleam tests if gleam is missing
1 parent 85ba7b2 commit 96a1c0b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/mix/test/mix/gleam_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Code.require_file("../test_helper.exs", __DIR__)
66

77
defmodule Mix.GleamTest do
88
use MixTest.Case
9+
@moduletag :gleam
910

1011
@compile {:no_warn_undefined, [:gleam_dep, :gleam@int]}
1112

lib/mix/test/test_helper.exs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,23 @@ re_import_exclude =
5151
[:re_import]
5252
end
5353

54+
gleam_exclude =
55+
try do
56+
Mix.Gleam.require!()
57+
[]
58+
rescue
59+
Mix.Error -> [gleam: true]
60+
end
61+
5462
Code.require_file("../../elixir/scripts/cover_record.exs", __DIR__)
5563
CoverageRecorder.maybe_record("mix")
5664

5765
ExUnit.start(
5866
trace: !!System.get_env("TRACE"),
5967
exclude:
6068
epmd_exclude ++
61-
os_exclude ++ git_exclude ++ line_exclude ++ cover_exclude ++ re_import_exclude,
69+
os_exclude ++
70+
git_exclude ++ line_exclude ++ cover_exclude ++ re_import_exclude ++ gleam_exclude,
6271
include: line_include,
6372
assert_receive_timeout: String.to_integer(System.get_env("ELIXIR_ASSERT_TIMEOUT", "300"))
6473
)

0 commit comments

Comments
 (0)