aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/record_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-04-14 16:44:29 +0200
committerBjörn Gustavsson <[email protected]>2011-04-14 16:44:29 +0200
commit27fc85fe624441a9c5754288aeac510c20a80695 (patch)
tree92425ccfad933bc0d894023c2b86f4b65402d689 /lib/compiler/test/record_SUITE.erl
parentc9e14ed976cf7b1ed89eeb3e75a258c37981feb4 (diff)
parenta86d00316ef882310fa222e0a2ac76dd8c1ab275 (diff)
downloadotp-27fc85fe624441a9c5754288aeac510c20a80695.tar.gz
otp-27fc85fe624441a9c5754288aeac510c20a80695.tar.bz2
otp-27fc85fe624441a9c5754288aeac510c20a80695.zip
Merge branch 'bjorn/compiler/coverage' into dev
* bjorn/compiler/coverage: bs_match_SUITE: Improve coverage of beam_bsm beam_bsm: Eliminate uncovered line in warning generation match_SUITE: Cover a clause in beam_dead:forward/4 beam_dead: Remove uncovered special case handling of empty blocks beam_dead: Remove uncovered clauses in binary matching optimization beam_dead: Remove uncoverable case clause in update_value_dict/3 beam_dead: Remove code that cannot be covered in forward/4 record_SUITE: Cover optimization of is_record/3 in beam_type compiler tests: Reinstate ?MODULE macro in calls to test_lib:recompile/1
Diffstat (limited to 'lib/compiler/test/record_SUITE.erl')
-rw-r--r--lib/compiler/test/record_SUITE.erl21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl
index 65b96590ed..363422ec7e 100644
--- a/lib/compiler/test/record_SUITE.erl
+++ b/lib/compiler/test/record_SUITE.erl
@@ -26,7 +26,8 @@
init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
errors/1,record_test_2/1,record_test_3/1,record_access_in_guards/1,
- guard_opt/1,eval_once/1,foobar/1,missing_test_heap/1, nested_access/1]).
+ guard_opt/1,eval_once/1,foobar/1,missing_test_heap/1,
+ nested_access/1,coverage/1]).
init_per_testcase(_Case, Config) ->
?line Dog = test_server:timetrap(test_server:minutes(2)),
@@ -40,10 +41,10 @@ end_per_testcase(_Case, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- test_lib:recompile(record_SUITE),
+ test_lib:recompile(?MODULE),
[errors, record_test_2, record_test_3,
record_access_in_guards, guard_opt, eval_once, foobar,
- missing_test_heap, nested_access].
+ missing_test_heap, nested_access, coverage].
groups() ->
[].
@@ -568,4 +569,18 @@ nested_access(Config) when is_list(Config) ->
?line N2a = N2b,
ok.
+-record(rr, {a,b,c}).
+
+coverage(Config) when is_list(Config) ->
+ %% There should only remain one record test in the code below.
+ R0 = id(#rr{a=1,b=2,c=3}),
+ B = R0#rr.b, %Test the record here.
+ R = R0#rr{c=42}, %No need to test here.
+ if
+ B > R#rr.a -> %No need to test here.
+ ok
+ end,
+ #rr{a=1,b=2,c=42} = id(R), %Test for correctness.
+ ok.
+
id(I) -> I.