diff options
Diffstat (limited to 'lib/sasl/test/systools_SUITE.erl')
-rw-r--r-- | lib/sasl/test/systools_SUITE.erl | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/sasl/test/systools_SUITE.erl b/lib/sasl/test/systools_SUITE.erl index ef863581a5..801660ddac 100644 --- a/lib/sasl/test/systools_SUITE.erl +++ b/lib/sasl/test/systools_SUITE.erl @@ -106,6 +106,9 @@ init_per_suite(Config) when is_list(Config) -> %% Compile source files in the copy directory. Sources = filelib:wildcard(fname([CopyDir,'*','*','*','*','*.erl'])), lists:foreach(fun compile_source/1, Sources), + %% Deal with subdirectories, if any + SubSources = filelib:wildcard(fname([CopyDir,'*','*','*','*','*','*.erl'])), + lists:foreach(fun compile_subsource/1, SubSources), [{copy_dir, CopyDir}, {cwd,Cwd}, {path,Path} | Config]. @@ -122,6 +125,16 @@ compile_source(File) -> ok = file:write_file(OutFileTemp, Code), file:rename(OutFileTemp, OutFile). +compile_subsource(File) -> + %% Same as compile_source/1 but works a subdirectory lower + U = filename:dirname(filename:dirname(filename:dirname(File))), + Base = filename:rootname(filename:basename(File)), + OutFile = filename:join([U,"ebin",Base++".beam"]), + OutFileTemp = OutFile ++ "#", + {ok,_,Code} = compile:file(File, [binary]), + ok = file:write_file(OutFileTemp, Code), + file:rename(OutFileTemp, OutFile). + end_per_suite(Config) when is_list(Config) -> rh_test_lib:clean_dir(?privdir), Config. @@ -278,9 +291,7 @@ unicode_script(Config) when is_list(Config) -> %% Need to do this on a separate node to make sure it has unicode %% filename mode (+fnu*) - {ok,HostStr} = inet:gethostname(), - Host = list_to_atom(HostStr), - {ok,Node} = ct_slave:start(Host,unicode_script_node,[{erl_flags,"+fnui"}]), + {ok,Peer,Node} = ?CT_PEER(["+fnui"]), ok = rpc:call(Node,erl_tar,extract, [TarFile, [{cwd,UnicodeLibDir},compressed]]), @@ -313,10 +324,11 @@ unicode_script(Config) when is_list(Config) -> rpc:call(Node,code,add_pathz,[filename:dirname(code:which(?MODULE))]), rpc:call(Node,?MODULE,delete_tree,[UnicodeLibDir]), + peer:stop(Peer), + ok. unicode_script(cleanup,Config) -> - _ = ct_slave:stop(unicode_script_node), file:delete(fname(?privdir, "unicode_app.tgz")), ok. @@ -1386,7 +1398,7 @@ src_tests_tar(Config) when is_list(Config) -> %% make_tar: Check that make_tar handles generation and placement of %% tar files for variables outside the main tar file. -%% Test the {var_tar, include | ownfile | omit} optio. +%% Test the {var_tar, include | ownfile | omit} option. var_tar(Config) when is_list(Config) -> {ok, OldDir} = file:get_cwd(), PSAVE = code:get_path(), % Save path |