mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Make tests run correctly even when ejabberd src in not in ejabberd-xxx dir
This commit is contained in:
parent
e81302dc79
commit
1d3959b5a2
@ -18,6 +18,17 @@
|
|||||||
-compile(export_all).
|
-compile(export_all).
|
||||||
|
|
||||||
init_per_suite(Config) ->
|
init_per_suite(Config) ->
|
||||||
|
case code:lib_dir(ejabberd) of
|
||||||
|
{error, _} ->
|
||||||
|
DataDir = proplists:get_value(data_dir, Config),
|
||||||
|
{ok, CWD} = file:get_cwd(),
|
||||||
|
NewEjPath = filename:join([CWD, "ejabberd-0.0.1"]),
|
||||||
|
TopDir = filename:dirname(filename:dirname(filename:dirname(DataDir))),
|
||||||
|
ok = file:make_symlink(TopDir, NewEjPath),
|
||||||
|
code:replace_path(ejabberd, NewEjPath);
|
||||||
|
_ ->
|
||||||
|
ok
|
||||||
|
end,
|
||||||
check_meck(),
|
check_meck(),
|
||||||
code:add_pathz(filename:join(test_dir(), "../include")),
|
code:add_pathz(filename:join(test_dir(), "../include")),
|
||||||
Config.
|
Config.
|
||||||
|
@ -47,10 +47,10 @@ init_config(Config) ->
|
|||||||
]),
|
]),
|
||||||
ConfigPath = filename:join([CWD, "ejabberd.yml"]),
|
ConfigPath = filename:join([CWD, "ejabberd.yml"]),
|
||||||
ok = file:write_file(ConfigPath, CfgContent),
|
ok = file:write_file(ConfigPath, CfgContent),
|
||||||
ok = file:make_dir(filename:join([CWD, "priv"])),
|
NewEjPath = filename:join([CWD, "ejabberd-0.0.1"]),
|
||||||
ok = file:make_dir(filename:join([CWD, "priv", "sql"])),
|
TopDir = filename:dirname(filename:dirname(DataDir)),
|
||||||
{ok, _} = file:copy(filename:join([DataDir, "..", "..", "sql", "lite.sql"]),
|
ok = file:make_symlink(TopDir, NewEjPath),
|
||||||
filename:join([CWD, "priv", "sql", "lite.sql"])),
|
code:replace_path(ejabberd, NewEjPath),
|
||||||
ok = application:load(sasl),
|
ok = application:load(sasl),
|
||||||
ok = application:load(mnesia),
|
ok = application:load(mnesia),
|
||||||
ok = application:load(ejabberd),
|
ok = application:load(ejabberd),
|
||||||
|
Loading…
Reference in New Issue
Block a user