mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
examples_SUITE: Query system to find GNU Make executable
... instead of hard-coding "make". First, we check the value of `$MAKE`. If it's unset, we look for `gmake` in the `$PATH`. If it's missing, we assume it's `make`. This fixes the testsuite where GNU Make is installed as `gmake`.
This commit is contained in:
parent
2166733628
commit
d8d7838a77
1 changed files with 15 additions and 1 deletions
|
@ -35,6 +35,19 @@ init_per_suite(Config) ->
|
|||
end_per_suite(_) ->
|
||||
ok.
|
||||
|
||||
%% Find GNU Make.
|
||||
|
||||
do_find_make_cmd() ->
|
||||
case os:getenv("MAKE") of
|
||||
false ->
|
||||
case os:find_executable("gmake") of
|
||||
false -> "make";
|
||||
Cmd -> Cmd
|
||||
end;
|
||||
Cmd ->
|
||||
Cmd
|
||||
end.
|
||||
|
||||
%% Compile, start and stop releases.
|
||||
|
||||
do_get_paths(Example0) ->
|
||||
|
@ -46,9 +59,10 @@ do_get_paths(Example0) ->
|
|||
{Dir, Rel, Log}.
|
||||
|
||||
do_compile_and_start(Example) ->
|
||||
Make = do_find_make_cmd(),
|
||||
{Dir, Rel, _} = do_get_paths(Example),
|
||||
%% TERM=dumb disables relx coloring.
|
||||
ct:log("~s~n", [os:cmd("cd " ++ Dir ++ " && make distclean && make all TERM=dumb")]),
|
||||
ct:log("~s~n", [os:cmd("cd " ++ Dir ++ " && " ++ Make ++ " distclean && " ++ Make ++ " all TERM=dumb")]),
|
||||
ct:log("~s~n", [os:cmd(Rel ++ " stop")]),
|
||||
ct:log("~s~n", [os:cmd(Rel ++ " start")]),
|
||||
timer:sleep(2000),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue