1: %%
    2: %% %CopyrightBegin%
    3: %%
    4: %% Copyright Ericsson AB 1998-2011. All Rights Reserved.
    5: %%
    6: %% The contents of this file are subject to the Erlang Public License,
    7: %% Version 1.1, (the "License"); you may not use this file except in
    8: %% compliance with the License. You should have received a copy of the
    9: %% Erlang Public License along with this software. If not, it can be
   10: %% retrieved online at http://www.erlang.org/.
   11: %%
   12: %% Software distributed under the License is distributed on an "AS IS"
   13: %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
   14: %% the License for the specific language governing rights and limitations
   15: %% under the License.
   16: %%
   17: %% %CopyrightEnd%
   18: %%
   19: 
   20: %%
   21: -module(bug_SUITE).
   22: 
   23: -include_lib("test_server/include/test_server.hrl").
   24: 
   25: -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
   26: 	 init_per_group/2,end_per_group/2]).
   27: 
   28: -export([otp2163/1, otp4845/1]).
   29: 
   30: suite() -> [{ct_hooks,[ts_install_cth]}].
   31: 
   32: all() -> 
   33:     [{group, ticket_tests}].
   34: 
   35: groups() -> 
   36:     [{ticket_tests, [], [otp2163, otp4845]}].
   37: 
   38: init_per_suite(Config) ->
   39:     Config.
   40: 
   41: end_per_suite(_Config) ->
   42:     ok.
   43: 
   44: init_per_group(_GroupName, Config) ->
   45: 	Config.
   46: 
   47: end_per_group(_GroupName, Config) ->
   48: 	Config.
   49: 
   50: 
   51: 
   52: otp2163(doc) -> ["BIF exit reason"];
   53: otp2163(suite) -> [];
   54: otp2163(Config) when is_list(Config) ->
   55:     ?line DataDir = ?config(data_dir, Config),
   56: 
   57:     %% First compile and get the expected results:
   58: 
   59:     ?line FileName = filename:join(DataDir, "otp2163"),
   60:     ?line {module,otp2163} = code:load_abs(FileName),
   61: 
   62:     ?line {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
   63:     ?line {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
   64: 
   65:     %% Then interpret, and check if the results are OK.
   66:     ?line {module,otp2163} = int:i(FileName),
   67: 
   68:     ?line ok = io:format("Expecting ~p", [ApplyRes]),
   69:     ?line {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
   70:     ?line ok = io:format("Expecting ~p", [ListRes]),
   71:     ?line {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
   72:     ok.
   73: 
   74: 
   75: otp4845(doc) -> ["BIF not loading and not bug compatible, OTP-4845 OTP-4859"];
   76: otp4845(suite) -> [];
   77: otp4845(Config) when is_list(Config) ->
   78:     ?line DataDir = ?config(data_dir, Config),
   79: 
   80:     %% First compile and get the expected results:
   81: 
   82:     ?line FileName = filename:join(DataDir, "otp4845"),
   83:     ?line {module,otp4845} = code:load_abs(FileName),
   84: 
   85:     ?line CompiledRes = (catch otp4845:test()),
   86:     ?line ok = io:format("Compiled ~p", [CompiledRes]),
   87: 
   88:     %% Then interpret, and check if the results are OK.
   89:     ?line {module,otp4845} = int:i(FileName),
   90: 
   91:     ?line IntRes = (catch otp4845:test()),
   92:     ?line ok = io:format("Interpreted ~p", [IntRes]),
   93: 
   94:     ?line CompiledRes = IntRes,
   95:     ok.