From 6ec2f04e936bf8991cd398a8ae5c2f6f325a8122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 26 Feb 2013 08:55:17 +0100 Subject: asn1_test_lib: Give more information when things goes wrong Ensure that compilation errors of Erlang code gets printed. If compilation of an ASN.1 specification goes wrong, print out the filename of the offending specification. It can be seen in the test case log, but because most test cases run in a parallel group, the test case log is not available until all test case in the group have finished. --- lib/asn1/test/asn1_test_lib.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/asn1/test/asn1_test_lib.erl') diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl index 1e40fd7b9e..191c321992 100644 --- a/lib/asn1/test/asn1_test_lib.erl +++ b/lib/asn1/test/asn1_test_lib.erl @@ -50,6 +50,7 @@ compile_file(File, Options) -> end catch Class:Reason -> + ct:print("Failed to compile ~s\n", [File]), erlang:error({compile_failed, {File, Options}, {Class, Reason}}) end. @@ -58,7 +59,7 @@ compile_erlang(Mod, Config, Options) -> CaseDir = ?config(case_dir, Config), M = list_to_atom(Mod), {ok, M} = compile:file(filename:join(DataDir, Mod), - [{i, CaseDir}, {outdir, CaseDir}|Options]). + [report,{i,CaseDir},{outdir,CaseDir}|Options]). should_load(File, Options) -> case lists:member(abs, Options) of -- cgit v1.2.3 From ad3cd6debf4173f44a4f72bc866b908739bdfc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 7 Mar 2013 11:43:53 +0100 Subject: asn1_test_lib: Purge old code when loading a new module In the 64-bit run-time, there is about 40Mb in old code after running the asn1 test suite. Since it is very easy to reclaim that memory, let's do it. Also get rid of the unnecessary call to code:soft_purge/1 just before loading the new code. --- lib/asn1/test/asn1_test_lib.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/asn1/test/asn1_test_lib.erl') diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl index 191c321992..fc237da868 100644 --- a/lib/asn1/test/asn1_test_lib.erl +++ b/lib/asn1/test/asn1_test_lib.erl @@ -45,8 +45,8 @@ compile_file(File, Options) -> ok; {module, Module} -> code:purge(Module), - true = code:soft_purge(Module), - {module, Module} = code:load_file(Module) + {module, Module} = code:load_file(Module), + code:purge(Module) end catch Class:Reason -> -- cgit v1.2.3 From 66cc5110814e74d602f6bda65e8388babc3982a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 11 Mar 2013 15:14:32 +0100 Subject: When testing, don't tolerate warnings from the BEAM compiler --- lib/asn1/test/asn1_test_lib.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/asn1/test/asn1_test_lib.erl') diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl index fc237da868..b839dfcf2a 100644 --- a/lib/asn1/test/asn1_test_lib.erl +++ b/lib/asn1/test/asn1_test_lib.erl @@ -39,7 +39,7 @@ compile_all(Files, Config, Options) -> compile_file(File, Options) -> try - ok = asn1ct:compile(File, Options), + ok = asn1ct:compile(File, [warnings_as_errors|Options]), case should_load(File, Options) of false -> ok; -- cgit v1.2.3