diff options
author | Björn Gustavsson <[email protected]> | 2011-12-05 12:31:38 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-12-05 12:31:38 +0100 |
commit | bdc69e0c35229fe11c98c14715b040b2f0eee5aa (patch) | |
tree | 33e9fe280bfaee82e3a5facd597a78ce6625d29b /lib/tools/test/cover_SUITE.erl | |
parent | f667e4a47b07b07ed035073b94d699ff5fe0ba9b (diff) | |
parent | 6e36ca17f9c36a420702c683f1e09c2b7daa58bc (diff) | |
download | otp-bdc69e0c35229fe11c98c14715b040b2f0eee5aa.tar.gz otp-bdc69e0c35229fe11c98c14715b040b2f0eee5aa.tar.bz2 otp-bdc69e0c35229fe11c98c14715b040b2f0eee5aa.zip |
Merge branch 'bjorn/test-cases'
* bjorn/test-cases:
lcnt_SUITE: Be kind to slow machines
crypto_SUITE: Reinstate what was "lost in translation"
fileTransferSUITE: Cope with missing/broken crypto application
sensitive_SUITE: Fix spuriously failing recv_trace/1
eprof_SUITE: Cope with fast computers and bad time measurements
cover_SUITE: Cope with missing/broken crypto application
otp_SUITE: Write log files about undefined functions and so on
Diffstat (limited to 'lib/tools/test/cover_SUITE.erl')
-rw-r--r-- | lib/tools/test/cover_SUITE.erl | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index 881a3c2997..576d7e261c 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -130,13 +130,20 @@ compile(Config) when is_list(Config) -> ?line {ok,_} = compile:file(x), ?line {ok,_} = compile:file("d/y",[debug_info,{outdir,"d"},report]), ?line Key = "A Krypto Key", - ?line {ok,_} = compile:file(crypt, [debug_info,{debug_info_key,Key},report]), + CryptoWorks = crypto_works(), + case CryptoWorks of + false -> + {ok,_} = compile:file(crypt, [debug_info,report]), + {ok,crypt} = cover:compile_beam("crypt.beam"); + true -> + {ok,_} = compile:file(crypt, [{debug_info_key,Key},report]), + {error,{encrypted_abstract_code,_}} = + cover:compile_beam("crypt.beam"), + ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)), + {ok,crypt} = cover:compile_beam("crypt.beam") + end, ?line {ok,v} = cover:compile_beam(v), ?line {ok,w} = cover:compile_beam("w.beam"), - ?line {error,{encrypted_abstract_code,_}} = - cover:compile_beam("crypt.beam"), - ?line ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)), - ?line {ok,crypt} = cover:compile_beam("crypt.beam"), ?line {error,{no_abstract_code,"./x.beam"}} = cover:compile_beam(x), ?line {error,{already_cover_compiled,no_beam_found,a}}=cover:compile_beam(a), ?line {error,non_existing} = cover:compile_beam(z), @@ -148,6 +155,15 @@ compile(Config) when is_list(Config) -> ?line Files = lsfiles(), ?line remove(files(Files, ".beam")). +crypto_works() -> + try crypto:start() of + {error,{already_started,crypto}} -> true; + ok -> true + catch + error:_ -> + false + end. + simple_crypto_fun(Key) -> fun(init) -> ok; ({debug_info, des3_cbc, crypt, _}) -> Key |