mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +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).
|
||||
|
||||
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(),
|
||||
code:add_pathz(filename:join(test_dir(), "../include")),
|
||||
Config.
|
||||
|
@ -47,10 +47,10 @@ init_config(Config) ->
|
||||
]),
|
||||
ConfigPath = filename:join([CWD, "ejabberd.yml"]),
|
||||
ok = file:write_file(ConfigPath, CfgContent),
|
||||
ok = file:make_dir(filename:join([CWD, "priv"])),
|
||||
ok = file:make_dir(filename:join([CWD, "priv", "sql"])),
|
||||
{ok, _} = file:copy(filename:join([DataDir, "..", "..", "sql", "lite.sql"]),
|
||||
filename:join([CWD, "priv", "sql", "lite.sql"])),
|
||||
NewEjPath = filename:join([CWD, "ejabberd-0.0.1"]),
|
||||
TopDir = filename:dirname(filename:dirname(DataDir)),
|
||||
ok = file:make_symlink(TopDir, NewEjPath),
|
||||
code:replace_path(ejabberd, NewEjPath),
|
||||
ok = application:load(sasl),
|
||||
ok = application:load(mnesia),
|
||||
ok = application:load(ejabberd),
|
||||
|
Loading…
Reference in New Issue
Block a user