mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Run tests for mssql only if configured with --enable-mssql
This commit is contained in:
parent
56c8f6b280
commit
25597a4326
@ -103,8 +103,8 @@ esac],[full_xml=false])
|
||||
AC_ARG_ENABLE(mssql,
|
||||
[AC_HELP_STRING([--enable-mssql], [use Microsoft SQL Server database (default: no, requires --enable-odbc)])],
|
||||
[case "${enableval}" in
|
||||
yes) db_type=mssql ;;
|
||||
no) db_type=generic ;;
|
||||
yes) db_type=mssql; mssql=true ;;
|
||||
no) db_type=generic; mssql=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mssql) ;;
|
||||
esac],[db_type=generic])
|
||||
|
||||
@ -267,7 +267,7 @@ if test "$sqlite" = "true"; then
|
||||
fi
|
||||
|
||||
enabled_backends=""
|
||||
for backend in odbc mysql pgsql sqlite redis; do
|
||||
for backend in odbc mysql pgsql sqlite redis mssql; do
|
||||
if eval test x\${$backend} = xtrue; then
|
||||
if test "x$enabled_backends" = "x"; then
|
||||
enabled_backends=$backend
|
||||
|
@ -77,15 +77,6 @@ init_per_group(Group, Config) ->
|
||||
do_init_per_group(Group, Config);
|
||||
Backends ->
|
||||
%% Skipped backends that were not explicitely enabled
|
||||
case Group of
|
||||
mssql ->
|
||||
case lists:member(odbc, Backends) of
|
||||
true ->
|
||||
do_init_per_group(Group, Config);
|
||||
false ->
|
||||
{skip, {disabled_backend, Group}}
|
||||
end;
|
||||
_ ->
|
||||
case lists:member(Group, Backends) of
|
||||
true ->
|
||||
do_init_per_group(Group, Config);
|
||||
@ -93,7 +84,6 @@ init_per_group(Group, Config) ->
|
||||
{skip, {disabled_backend, Group}}
|
||||
end
|
||||
end
|
||||
end
|
||||
end.
|
||||
|
||||
do_init_per_group(no_db, Config) ->
|
||||
|
@ -139,23 +139,13 @@ copy_backend_configs(DataDir, CWD, Backends) ->
|
||||
Files = filelib:wildcard(filename:join([DataDir, "ejabberd.*.yml"])),
|
||||
lists:foreach(
|
||||
fun(Src) ->
|
||||
io:format("copying ~p", [Src]),
|
||||
File = filename:basename(Src),
|
||||
case string:tokens(File, ".") of
|
||||
["ejabberd", SBackend, "yml"] ->
|
||||
Backend = list_to_atom(SBackend),
|
||||
Macro = list_to_atom(string:to_upper(SBackend) ++ "_CONFIG"),
|
||||
Dst = filename:join([CWD, File]),
|
||||
case Backend of
|
||||
mssql ->
|
||||
case lists:member(odbc, Backends) of
|
||||
true ->
|
||||
{ok, _} = file:copy(Src, Dst);
|
||||
false ->
|
||||
ok = file:write_file(
|
||||
Dst, fast_yaml:encode(
|
||||
[{define_macro, [{Macro, []}]}]))
|
||||
end;
|
||||
_ ->
|
||||
case lists:member(Backend, Backends) of
|
||||
true ->
|
||||
{ok, _} = file:copy(Src, Dst);
|
||||
@ -163,7 +153,6 @@ copy_backend_configs(DataDir, CWD, Backends) ->
|
||||
ok = file:write_file(
|
||||
Dst, fast_yaml:encode(
|
||||
[{define_macro, [{Macro, []}]}]))
|
||||
end
|
||||
end;
|
||||
_ ->
|
||||
ok
|
||||
|
Loading…
Reference in New Issue
Block a user