aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2012-03-21 08:09:49 +0100
committerHans Bolinder <[email protected]>2012-03-21 08:09:49 +0100
commit87b589c3f7fcdecb572cd301476bb4347ddfac79 (patch)
tree2448c578f444966e955278c0e2172ed24ec37456 /lib
parentd71f706dcca0145f9b3d54187c9ee37365b1e559 (diff)
parent837047b4c9b0f1ac4bcb8e27fb0db36ccc317385 (diff)
downloadotp-87b589c3f7fcdecb572cd301476bb4347ddfac79.tar.gz
otp-87b589c3f7fcdecb572cd301476bb4347ddfac79.tar.bz2
otp-87b589c3f7fcdecb572cd301476bb4347ddfac79.zip
Merge branch 'hb/stdlib/fix_qlc_suite/OTP-10000' into maint
* hb/stdlib/fix_qlc_suite/OTP-10000: Correct a minor bug in qlc's testsuite
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/test/qlc_SUITE.erl22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl
index 50a76cdfb5..1e74ad7727 100644
--- a/lib/stdlib/test/qlc_SUITE.erl
+++ b/lib/stdlib/test/qlc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -7927,15 +7927,23 @@ run_test(Config, Extra, {cres, Body, Opts, ExpectedCompileReturn}) ->
ok
end,
+ wait_for_expected(R, Before, SourceFile, true),
+ code:purge(Mod);
+run_test(Config, Extra, Body) ->
+ run_test(Config, Extra, {cres,Body,[]}).
+
+wait_for_expected(R, Before, SourceFile, Wait) ->
Ms = erlang:process_info(self(),messages),
After = {get(), pps(), ets:all(), Ms},
- code:purge(Mod),
case {R, After} of
- {ok, Before} -> ok;
- _ -> expected({ok,Before}, {R,After}, SourceFile)
- end;
-run_test(Config, Extra, Body) ->
- run_test(Config, Extra, {cres,Body,[]}).
+ {ok, Before} ->
+ ok;
+ _ when Wait ->
+ timer:sleep(1000),
+ wait_for_expected(R, Before, SourceFile, false);
+ _ ->
+ expected({ok,Before}, {R,After}, SourceFile)
+ end.
unload_pt() ->
erlang:garbage_collect(), % get rid of references to qlc_pt...