From 844e2126e3b814f9fa058be367be3af745c7a80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 19 Dec 2012 08:06:02 +0100 Subject: Generate modules with selected run-time functions for compiler usage --- lib/asn1/test/asn1_SUITE.erl | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'lib/asn1/test/asn1_SUITE.erl') diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 1a47d91634..6299d50513 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -66,7 +66,8 @@ groups() -> {appup_test, [], [{asn1_appup_test, all}]}, {parallel, parallel([]), - [{group, ber}, + [cover, + {group, ber}, % Uses 'P-Record', 'Constraints', 'MEDIA-GATEWAY-CONTROL'... {group, [], [parse, test_driver_load, @@ -295,6 +296,28 @@ case_dir([C|Config], Opt) -> %% Test cases %%------------------------------------------------------------------------------ +%% Cover run-time functions that are only called by the ASN.1 compiler +%% (if any). +cover(_) -> + Wc = filename:join([code:lib_dir(asn1),"ebin","asn1ct_eval_*.beam"]), + Beams = filelib:wildcard(Wc), + true = Beams =/= [], + [begin + M0 = filename:basename(Beam), + M1 = filename:rootname(M0), + M = list_to_atom(M1), + "asn1ct_eval_" ++ Group0 = M1, + Group = list_to_atom(Group0), + io:format("%%\n" + "%% ~s\n" + "%%\n", [M]), + asn1ct_func:start_link(), + [asn1ct_func:need({Group,F,A}) || + {F,A} <- M:module_info(exports), F =/= module_info], + asn1ct_func:generate(group_leader()) + end || Beam <- Beams], + ok. + testPrim(Config) -> test(Config, fun testPrim/3). testPrim(Config, Rule, Opts) -> asn1_test_lib:compile_all(["Prim", "Real"], Config, [Rule|Opts]), -- cgit v1.2.3