diff options
author | Anders Svensson <anders@erlang.org> | 2022-03-18 14:24:52 +0100 |
---|---|---|
committer | Anders Svensson <anders@erlang.org> | 2022-03-18 15:54:04 +0100 |
commit | 4daaa84cf99f26647ffa66f100c788eae533897d (patch) | |
tree | f127495d21313de74701b6ec2a0f597749c7619e /lib/diameter/test/diameter_codec_SUITE.erl | |
parent | e3543404fda83d78b02a80517b64a040d4996128 (diff) | |
download | erlang-4daaa84cf99f26647ffa66f100c788eae533897d.tar.gz |
Ensure testsuites only write to temporary directory
The compiler, codec, and examples testsuites wrote to pwd, which
common_test changes to its priv_dir, but that isn't ideal without
common_test. Write to a created temporary directory in this case.
Diffstat (limited to 'lib/diameter/test/diameter_codec_SUITE.erl')
-rw-r--r-- | lib/diameter/test/diameter_codec_SUITE.erl | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/diameter/test/diameter_codec_SUITE.erl b/lib/diameter/test/diameter_codec_SUITE.erl index ff8a031460..f92b360dab 100644 --- a/lib/diameter/test/diameter_codec_SUITE.erl +++ b/lib/diameter/test/diameter_codec_SUITE.erl @@ -97,7 +97,7 @@ run(lib) -> %% Have a separate AVP dictionary just to exercise more code. run(unknown) -> - PD = ?util:mktemp(filename:join(?util:tmpdir(), "diameter_codec")), + PD = ?util:mktemp("diameter_codec"), DD = filename:join([code:lib_dir(diameter), "test", "diameter_codec_SUITE_data"]), @@ -132,24 +132,25 @@ run(List) -> %% =========================================================================== unknown(Priv, Data) -> - ok = make(Data, "recv.dia"), - ok = make(Data, "avps.dia"), - {ok, _, _} = compile("diameter_test_avps.erl"), - ok = make(Data, "send.dia"), - {ok, _, _} = compile("diameter_test_send.erl"), - {ok, _, _} = compile("diameter_test_recv.erl"), - {ok, _, _} = compile(filename:join([Data, "diameter_test_unknown.erl"]), + ok = make(Data, "recv.dia", Priv), + ok = make(Data, "avps.dia", Priv), + {ok, _, _} = compile(Priv, "diameter_test_avps.erl"), + ok = make(Data, "send.dia", Priv), + {ok, _, _} = compile(Priv, "diameter_test_send.erl"), + {ok, _, _} = compile(Priv, "diameter_test_recv.erl"), + {ok, _, _} = compile(Priv, + filename:join([Data, "diameter_test_unknown.erl"]), [{i, Priv}]), diameter_test_unknown:run(). -make(Dir, File) -> - diameter_make:codec(filename:join([Dir, File])). +make(Dir, File, Out) -> + diameter_make:codec(filename:join(Dir, File), [{outdir, Out}]). -compile(File) -> - compile(File, []). +compile(Dir, File) -> + compile(Dir, File, []). -compile(File, Opts) -> - compile:file(File, [return | Opts]). +compile(Dir, File, Opts) -> + compile:file(filename:join(Dir, File), [return | Opts]). %% =========================================================================== |