aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-04-04 13:42:39 +0200
committerBjörn Gustavsson <[email protected]>2016-04-04 13:42:39 +0200
commit282f18834468ca36e0e56dc12ac637e8ea82e54a (patch)
treea3fedff82633920a4cb7a9f07edb582e52f2e5cf /lib/asn1
parentd5ee10dd6ad9e7d78fe1e306ad53b78c15f9b7f2 (diff)
parent17f7dd7a414feb14fa20200299e9115e832ed164 (diff)
downloadotp-282f18834468ca36e0e56dc12ac637e8ea82e54a.tar.gz
otp-282f18834468ca36e0e56dc12ac637e8ea82e54a.tar.bz2
otp-282f18834468ca36e0e56dc12ac637e8ea82e54a.zip
Merge branch 'bjorn/cuddle-with-tests'
* bjorn/cuddle-with-tests: inet_SUITE: Handle pointtopoint devices in getifaddrs/1 file_SUITE: Increase timetrap for large_write/1 gen_fsm_SUITE: Make abnormal1/1 stop failing gen_fsm_SUITE: Use timer:sleep/1 instead of ct:sleep/1 inet_SUITE: Handle {error,enoent} in simple_netns_open inet_SUITE: Handle missing SCTP support in simple_netns/1 asn1_SUITE: Remove temporary files file_name_SUITE: Improve handling of missing permission for link creation file_name_SUITE: Remove useless put/2 to process dictionary file_name_SUITE: Handle the case that HOMEPATH may not be set code_SUITE: Skip on_load_embedded/1 if no symlinks gen_sctp_SUITE: Skip most SCTP test cases on Solaris before 5.12 heart_SUITE: Increase timeout in restart/1 heart_SUITE: Use unique node names init_SUITE: Quote pathname that may contain a space gen_tcp_misc_SUITE: Clean up send_timeout{_active}/1 Clean up the determination of the hostname
Diffstat (limited to 'lib/asn1')
-rw-r--r--lib/asn1/test/asn1_SUITE.erl4
-rw-r--r--lib/asn1/test/asn1_test_lib.erl13
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl
index 77f78b2716..4d5120221d 100644
--- a/lib/asn1/test/asn1_SUITE.erl
+++ b/lib/asn1/test/asn1_SUITE.erl
@@ -202,7 +202,9 @@ init_per_testcase(Func, Config) ->
[{case_dir, CaseDir}|Config].
end_per_testcase(_Func, Config) ->
- code:del_path(proplists:get_value(case_dir, Config)).
+ CaseDir = proplists:get_value(case_dir, Config),
+ asn1_test_lib:rm_dirs([CaseDir]),
+ code:del_path(CaseDir).
%%------------------------------------------------------------------------------
%% Test runners
diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl
index 21f00b0968..b151546140 100644
--- a/lib/asn1/test/asn1_test_lib.erl
+++ b/lib/asn1/test/asn1_test_lib.erl
@@ -21,6 +21,7 @@
-module(asn1_test_lib).
-export([compile/3,compile_all/3,compile_erlang/3,
+ rm_dirs/1,
hex_to_bin/1,
match_value/2,
parallel/0,
@@ -105,6 +106,18 @@ compile_erlang(Mod, Config, Options) ->
{ok, M} = compile:file(filename:join(DataDir, Mod),
[report,{i,CaseDir},{outdir,CaseDir}|Options]).
+rm_dirs([Dir|Dirs]) ->
+ {ok,L0} = file:list_dir(Dir),
+ L = [filename:join(Dir, F) || F <- L0],
+ IsDir = fun(F) -> filelib:is_dir(F) end,
+ {Subdirs,Files} = lists:partition(IsDir, L),
+ _ = [ok = file:delete(F) || F <- Files],
+ rm_dirs(Subdirs),
+ ok = file:del_dir(Dir),
+ rm_dirs(Dirs);
+rm_dirs([]) ->
+ ok.
+
hex_to_bin(S) ->
<< <<(hex2num(C)):4>> || C <- S, C =/= $\s >>.