aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/beam_validator_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-01-08 14:30:06 +0100
committerBjörn Gustavsson <[email protected]>2015-01-21 10:01:08 +0100
commitd92a5127d894581f9681530072f38bd7d99ce9bf (patch)
tree101d7243099a402df64606373990382caee84b1b /lib/compiler/test/beam_validator_SUITE.erl
parentb410d5881fbb408904e0bfd5898cf7983b503f05 (diff)
downloadotp-d92a5127d894581f9681530072f38bd7d99ce9bf.tar.gz
otp-d92a5127d894581f9681530072f38bd7d99ce9bf.tar.bz2
otp-d92a5127d894581f9681530072f38bd7d99ce9bf.zip
beam_validator_SUITE: Mend the compiler_bug/1 test case
The compiler_bug/1 test case succeeded for the wrong reason. The 'asm' option is no longer supported (was ignored) and the compiler looked for a .erl file. Make sure that we don't fall for this trick again by making sure that the error is reported from beam_validator.
Diffstat (limited to 'lib/compiler/test/beam_validator_SUITE.erl')
-rw-r--r--lib/compiler/test/beam_validator_SUITE.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl
index 626f89ba7a..27979647c6 100644
--- a/lib/compiler/test/beam_validator_SUITE.erl
+++ b/lib/compiler/test/beam_validator_SUITE.erl
@@ -96,9 +96,16 @@ do_beam_file(F) ->
compiler_bug(Config) when is_list(Config) ->
%% Check that the compiler returns an error if we try to
%% assemble one of the bad '.S' files.
- ?line Data = ?config(data_dir, Config),
- ?line File = filename:join(Data, "stack"),
- ?line error = compile:file(File, [asm,report_errors,binary,time]),
+ Data = ?config(data_dir, Config),
+ File = filename:join(Data, "compiler_bug"),
+ error = compile:file(File, [from_asm,report_errors,time]),
+
+ %% Make sure that the error was reported by
+ %% the beam_validator module.
+ {error,
+ [{"compiler_bug",
+ [{beam_validator,_}]}],
+ []} = compile:file(File, [from_asm,return_errors,time]),
ok.
%% The following code is stupid but it should compile.