Skip to content

Commit d65e283

Browse files
committed
compiler: Let cloned test suites run under other build systems
Some compiler test suites get cloned so they can be built with different compiler options. When building tests with make, they need to share the data dir, and test_lib:get_data_dir/1 does the conversion. However, if we try to run these tests under a different build system (e.g. buck, but possibly the same would happen with rebar3) then it is more convenient to let the build system handle the aliasing of data-dir, and in that case the adapter should do nothing
1 parent 374ca47 commit d65e283

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

lib/compiler/test/test_lib.erl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,16 @@ get_data_dir(Config) ->
135135
"_no_type_opt_SUITE",
136136
"_no_ssa_opt_SUITE",
137137
"_cover_SUITE"],
138-
lists:foldl(fun(Suffix, Acc) ->
139-
Opts = [{return,list}],
140-
re:replace(Acc, Suffix, "_SUITE", Opts)
141-
end, Data, Suffixes).
138+
case filelib:is_dir(Data) of
139+
true ->
140+
%% Build system already provides it
141+
Data;
142+
false ->
143+
lists:foldl(fun(Suffix, Acc) ->
144+
Opts = [{return,list}],
145+
re:replace(Acc, Suffix, "_SUITE", Opts)
146+
end, Data, Suffixes)
147+
end.
142148

143149
%% Test whether the module is cloned. We don't consider modules
144150
%% compiled with compatibility for an older release cloned (that

0 commit comments

Comments
 (0)