aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-02-05 12:38:19 +0100
committerBjörn Gustavsson <[email protected]>2016-02-05 12:44:50 +0100
commitbf11b8fc3e9ac0f3cd48d8a3a834bd7d709ecc9e (patch)
tree40e4bf09e717192854b337880b5ed5feed47b08e /lib
parent42a363dbdf2c212833159edaa3391efc4d33c73c (diff)
downloadotp-bf11b8fc3e9ac0f3cd48d8a3a834bd7d709ecc9e.tar.gz
otp-bf11b8fc3e9ac0f3cd48d8a3a834bd7d709ecc9e.tar.bz2
otp-bf11b8fc3e9ac0f3cd48d8a3a834bd7d709ecc9e.zip
compile_SUITE: Use get_files/3 in more places
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/test/compile_SUITE.erl26
1 files changed, 8 insertions, 18 deletions
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl
index 212cbcb16b..b68d039681 100644
--- a/lib/compiler/test/compile_SUITE.erl
+++ b/lib/compiler/test/compile_SUITE.erl
@@ -161,11 +161,8 @@ module_mismatch(Config) when is_list(Config) ->
big_file(Config) when is_list(Config) ->
?line Dog = test_server:timetrap(test_server:minutes(5)),
- ?line DataDir = ?config(data_dir, Config),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Big = filename:join(DataDir, "big.erl"),
- ?line Target = filename:join(PrivDir, "big.beam"),
- ?line ok = file:set_cwd(PrivDir),
+ {Big,Target} = get_files(Config, big, "big_file"),
+ ok = file:set_cwd(filename:dirname(Target)),
?line compile_and_verify(Big, Target, []),
?line compile_and_verify(Big, Target, [debug_info]),
?line compile_and_verify(Big, Target, [no_postopt]),
@@ -362,21 +359,18 @@ do_file_listings(DataDir, PrivDir, [File|Files]) ->
listings_big(Config) when is_list(Config) ->
?line Dog = test_server:timetrap(test_server:minutes(10)),
- ?line DataDir = ?config(data_dir, Config),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Big = filename:join(DataDir, big),
- ?line TargetDir = filename:join(PrivDir, listings_big),
- ?line ok = file:make_dir(TargetDir),
+ {Big,Target} = get_files(Config, big, listings_big),
+ TargetDir = filename:dirname(Target),
?line do_listing(Big, TargetDir, 'S'),
?line do_listing(Big, TargetDir, 'E'),
?line do_listing(Big, TargetDir, 'P'),
?line do_listing(Big, TargetDir, dkern, ".kernel"),
- ?line Target = filename:join(TargetDir, big),
- {ok,big} = compile:file(Target, [from_asm,{outdir,TargetDir}]),
+ TargetNoext = filename:rootname(Target, code:objfile_extension()),
+ {ok,big} = compile:file(TargetNoext, [from_asm,{outdir,TargetDir}]),
%% Cleanup.
- ?line ok = file:delete(Target ++ ".beam"),
+ ok = file:delete(Target),
?line lists:foreach(fun(F) -> ok = file:delete(F) end,
filelib:wildcard(filename:join(TargetDir, "*"))),
?line ok = file:del_dir(TargetDir),
@@ -385,11 +379,7 @@ listings_big(Config) when is_list(Config) ->
other_output(Config) when is_list(Config) ->
?line Dog = test_server:timetrap(test_server:minutes(8)),
- ?line DataDir = ?config(data_dir, Config),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Simple = filename:join(DataDir, simple),
- ?line TargetDir = filename:join(PrivDir, other_output),
- ?line ok = file:make_dir(TargetDir),
+ {Simple,_Target} = get_files(Config, simple, "other_output"),
io:put_chars("to_pp"),
?line {ok,[],PP} = compile:file(Simple, [to_pp,binary,time]),