diff options
author | Hans Bolinder <[email protected]> | 2017-10-31 09:54:38 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-10-31 09:54:38 +0100 |
commit | b59ae230ed37078125cec0bfeece5c736784931c (patch) | |
tree | c56df1876765fe42445f2ae6390f85ec4c118b6b | |
parent | d4f61c4e26005740388668f3773871f043366342 (diff) | |
parent | 7fdded4d4fc2a63a927f499161bd1820aab07306 (diff) | |
download | otp-b59ae230ed37078125cec0bfeece5c736784931c.tar.gz otp-b59ae230ed37078125cec0bfeece5c736784931c.tar.bz2 otp-b59ae230ed37078125cec0bfeece5c736784931c.zip |
Merge branch 'hasse/stdlib/fix_qlc_SUITE' into maint
* hasse/stdlib/fix_qlc_SUITE:
stdlib: Fix a minor issue with the qlc suite
-rw-r--r-- | lib/stdlib/test/qlc_SUITE.erl | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl index 5e9e03e410..949142ec77 100644 --- a/lib/stdlib/test/qlc_SUITE.erl +++ b/lib/stdlib/test/qlc_SUITE.erl @@ -7871,7 +7871,7 @@ run_test(Config, Extra, {cres, Body, Opts, ExpectedCompileReturn}) -> {module, _} = code:load_abs(AbsFile, Mod), Ms0 = erlang:process_info(self(),messages), - Before = {{get(), lists:sort(ets:all()), Ms0}, pps()}, + Before = {{lget(), lists:sort(ets:all()), Ms0}, pps()}, %% Prepare the check that the qlc module does not call qlc_pt. _ = [unload_pt() || {file, Name} <- [code:is_loaded(qlc_pt)], @@ -7903,7 +7903,7 @@ run_test(Config, Extra, Body) -> wait_for_expected(R, {Strict0,PPS0}=Before, SourceFile, Wait) -> Ms = erlang:process_info(self(),messages), - After = {_,PPS1} = {{get(), lists:sort(ets:all()), Ms}, pps()}, + After = {_,PPS1} = {{lget(), lists:sort(ets:all()), Ms}, pps()}, case {R, After} of {ok, Before} -> ok; @@ -7931,6 +7931,18 @@ wait_for_expected(R, {Strict0,PPS0}=Before, SourceFile, Wait) -> expected({ok,Before}, {R,After}, SourceFile) end. +%% The qlc modules uses the process dictionary for storing names of files. +lget() -> + lists:sort([T || {K, _} = T <- get(), is_qlc_key(K)]). + +%% Copied from the qlc module. +-define(LCACHE_FILE(Ref), {Ref, '$_qlc_cache_tmpfiles_'}). +-define(MERGE_JOIN_FILE, '$_qlc_merge_join_tmpfiles_'). + +is_qlc_key(?LCACHE_FILE(_)) -> true; +is_qlc_key(?MERGE_JOIN_FILE) -> true; +is_qlc_key(_) -> false. + unload_pt() -> erlang:garbage_collect(), % get rid of references to qlc_pt... _ = code:purge(qlc_pt), |