From 7c0a62d3d8083bf1aa8430aad35ad93c2a887de7 Mon Sep 17 00:00:00 2001 From: Lars Thorsen Date: Fri, 20 May 2016 08:02:38 +0200 Subject: [ic] Update the test suites to follow the new style * Eliminate use of ?config(), ?t() and ?line() macros * Remove the doc and suite clauses --- lib/ic/test/c_client_erl_server_SUITE.erl | 76 +--- lib/ic/test/c_client_erl_server_proto_SUITE.erl | 76 +--- .../test/c_client_erl_server_proto_tmo_SUITE.erl | 78 +--- lib/ic/test/erl_client_c_server_SUITE.erl | 77 +--- lib/ic/test/erl_client_c_server_proto_SUITE.erl | 77 +--- lib/ic/test/ic_SUITE.erl | 469 +++++++++------------ lib/ic/test/ic_be_SUITE.erl | 23 +- lib/ic/test/ic_pp_SUITE.erl | 212 ++++------ lib/ic/test/ic_pragma_SUITE.erl | 48 +-- lib/ic/test/ic_register_SUITE.erl | 186 ++++---- lib/ic/test/java_client_erl_server_SUITE.erl | 137 +++--- 11 files changed, 457 insertions(+), 1002 deletions(-) (limited to 'lib/ic') diff --git a/lib/ic/test/c_client_erl_server_SUITE.erl b/lib/ic/test/c_client_erl_server_SUITE.erl index 7668300b58..b6e100e102 100644 --- a/lib/ic/test/c_client_erl_server_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_SUITE.erl @@ -49,7 +49,7 @@ %% Add/remove code path and watchdog before/after each test case. %% init_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:add_patha(DataDir), %% Since other test suites use the module m_i, we have @@ -61,9 +61,9 @@ init_per_testcase(_Case, Config) -> [{watchdog, WatchDog}| Config]. end_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:del_path(DataDir), - WatchDog = ?config(watchdog, Config), + WatchDog = proplists:get_value(watchdog, Config), test_server:timetrap_cancel(WatchDog). suite() -> [{ct_hooks,[ts_install_cth]}]. @@ -95,173 +95,105 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. -array1_test(doc) -> ""; -array1_test(suite) -> []; array1_test(Config) -> do_test(array1_test, Config). -array2_test(doc) -> ""; -array2_test(suite) -> []; array2_test(Config) -> do_test(array2_test, Config). -bool_test(doc) -> ""; -bool_test(suite) -> []; bool_test(Config) -> do_test(bool_test, Config). -char_test(doc) -> ""; -char_test(suite) -> []; char_test(Config) -> do_test(char_test, Config). -double_test(doc) -> ""; -double_test(suite) -> []; double_test(Config) -> do_test(double_test, Config). -enum_test(doc) -> ""; -enum_test(suite) -> []; enum_test(Config) -> do_test(enum_test, Config). -inline_sequence_test(doc) -> ""; -inline_sequence_test(suite) -> []; inline_sequence_test(Config) -> do_test(inline_sequence_test, Config). -long_long_test(doc) -> ""; -long_long_test(suite) -> []; long_long_test(Config) -> do_test(long_long_test, Config). -long_test(doc) -> ""; -long_test(suite) -> []; long_test(Config) -> do_test(long_test, Config). -octet_test(doc) -> ""; -octet_test(suite) -> []; octet_test(Config) -> do_test(octet_test, Config). -pid_test(doc) -> ""; -pid_test(suite) -> []; pid_test(Config) -> do_test(pid_test, Config). -port_test(doc) -> ""; -port_test(suite) -> []; port_test(Config) -> do_test(port_test, Config). -ref_test(doc) -> ""; -ref_test(suite) -> []; ref_test(Config) -> do_test(ref_test, Config). -seq1_test(doc) -> ""; -seq1_test(suite) -> []; seq1_test(Config) -> do_test(seq1_test, Config). -seq2_test(doc) -> ""; -seq2_test(suite) -> []; seq2_test(Config) -> do_test(seq2_test, Config). -seq3_test(doc) -> ""; -seq3_test(suite) -> []; seq3_test(Config) -> do_test(seq3_test, Config). -seq4_test(doc) -> ""; -seq4_test(suite) -> []; seq4_test(Config) -> do_test(seq4_test, Config). -seq5_test(doc) -> ""; -seq5_test(suite) -> []; seq5_test(Config) -> do_test(seq5_test, Config). -string1_test(doc) -> ""; -string1_test(suite) -> []; string1_test(Config) -> do_test(string1_test, Config). -string2_test(doc) -> ""; -string2_test(suite) -> []; string2_test(Config) -> do_test(string2_test, Config). -string3_test(doc) -> ""; -string3_test(suite) -> []; string3_test(Config) -> do_test(string3_test, Config). -string4_test(doc) -> ""; -string4_test(suite) -> []; string4_test(Config) -> do_test(string4_test, Config). -struct2_test(doc) -> ""; -struct2_test(suite) -> []; struct2_test(Config) -> do_test(struct2_test, Config). -struct_test(doc) -> ""; -struct_test(suite) -> []; struct_test(Config) -> do_test(struct_test, Config). -term_sequence_test(doc) -> ""; -term_sequence_test(suite) -> []; term_sequence_test(Config) -> do_test(term_sequence_test, Config). -term_struct_test(doc) -> ""; -term_struct_test(suite) -> []; term_struct_test(Config) -> do_test(term_struct_test, Config). -term_test(doc) -> ""; -term_test(suite) -> []; term_test(Config) -> do_test(term_test, Config). -typedef_test(doc) -> ""; -typedef_test(suite) -> []; typedef_test(Config) -> do_test(typedef_test, Config). -unsigned_long_long_test(doc) -> ""; -unsigned_long_long_test(suite) -> []; unsigned_long_long_test(Config) -> do_test(unsigned_long_long_test, Config). -unsigned_long_test(doc) -> ""; -unsigned_long_test(suite) -> []; unsigned_long_test(Config) -> do_test(unsigned_long_test, Config). -unsigned_short_test(doc) -> ""; -unsigned_short_test(suite) -> []; unsigned_short_test(Config) -> do_test(unsigned_short_test, Config). -void_test(doc) -> ""; -void_test(suite) -> []; void_test(Config) -> do_test(void_test, Config). -wchar_test(doc) -> ""; -wchar_test(suite) -> []; wchar_test(Config) -> do_test(wchar_test, Config). -wstring1_test(doc) -> ""; -wstring1_test(suite) -> []; wstring1_test(Config) -> do_test(wstring1_test, Config). @@ -275,7 +207,7 @@ do_test(Case, Config) -> %% Start the server {ok, _Pid} = m_i:oe_create_link([], {local, ?ERLANG_SERVER_NAME}), Node = atom_to_list(node()), - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), %% io:format("~p: data directory: ~p~n", [?MODULE, DataDir]), Cookie = atom_to_list(erlang:get_cookie()), %% Start C-client node as a port program. diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_SUITE.erl index 2336a8417c..c15617ea3f 100644 --- a/lib/ic/test/c_client_erl_server_proto_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_SUITE.erl @@ -48,7 +48,7 @@ %% Add/remove code path and watchdog before/after each test case. %% init_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:add_patha(DataDir), %% Since other test suites use the module m_i, we have @@ -60,9 +60,9 @@ init_per_testcase(_Case, Config) -> [{watchdog, WatchDog}| Config]. end_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:del_path(DataDir), - WatchDog = ?config(watchdog, Config), + WatchDog = proplists:get_value(watchdog, Config), test_server:timetrap_cancel(WatchDog). suite() -> [{ct_hooks,[ts_install_cth]}]. @@ -94,173 +94,105 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. -array1_test(doc) -> ""; -array1_test(suite) -> []; array1_test(Config) -> do_test(array1_test, Config). -array2_test(doc) -> ""; -array2_test(suite) -> []; array2_test(Config) -> do_test(array2_test, Config). -bool_test(doc) -> ""; -bool_test(suite) -> []; bool_test(Config) -> do_test(bool_test, Config). -char_test(doc) -> ""; -char_test(suite) -> []; char_test(Config) -> do_test(char_test, Config). -double_test(doc) -> ""; -double_test(suite) -> []; double_test(Config) -> do_test(double_test, Config). -enum_test(doc) -> ""; -enum_test(suite) -> []; enum_test(Config) -> do_test(enum_test, Config). -inline_sequence_test(doc) -> ""; -inline_sequence_test(suite) -> []; inline_sequence_test(Config) -> do_test(inline_sequence_test, Config). -long_long_test(doc) -> ""; -long_long_test(suite) -> []; long_long_test(Config) -> do_test(long_long_test, Config). -long_test(doc) -> ""; -long_test(suite) -> []; long_test(Config) -> do_test(long_test, Config). -octet_test(doc) -> ""; -octet_test(suite) -> []; octet_test(Config) -> do_test(octet_test, Config). -pid_test(doc) -> ""; -pid_test(suite) -> []; pid_test(Config) -> do_test(pid_test, Config). -port_test(doc) -> ""; -port_test(suite) -> []; port_test(Config) -> do_test(port_test, Config). -ref_test(doc) -> ""; -ref_test(suite) -> []; ref_test(Config) -> do_test(ref_test, Config). -seq1_test(doc) -> ""; -seq1_test(suite) -> []; seq1_test(Config) -> do_test(seq1_test, Config). -seq2_test(doc) -> ""; -seq2_test(suite) -> []; seq2_test(Config) -> do_test(seq2_test, Config). -seq3_test(doc) -> ""; -seq3_test(suite) -> []; seq3_test(Config) -> do_test(seq3_test, Config). -seq4_test(doc) -> ""; -seq4_test(suite) -> []; seq4_test(Config) -> do_test(seq4_test, Config). -seq5_test(doc) -> ""; -seq5_test(suite) -> []; seq5_test(Config) -> do_test(seq5_test, Config). -string1_test(doc) -> ""; -string1_test(suite) -> []; string1_test(Config) -> do_test(string1_test, Config). -string2_test(doc) -> ""; -string2_test(suite) -> []; string2_test(Config) -> do_test(string2_test, Config). -string3_test(doc) -> ""; -string3_test(suite) -> []; string3_test(Config) -> do_test(string3_test, Config). -string4_test(doc) -> ""; -string4_test(suite) -> []; string4_test(Config) -> do_test(string4_test, Config). -struct2_test(doc) -> ""; -struct2_test(suite) -> []; struct2_test(Config) -> do_test(struct2_test, Config). -struct_test(doc) -> ""; -struct_test(suite) -> []; struct_test(Config) -> do_test(struct_test, Config). -term_sequence_test(doc) -> ""; -term_sequence_test(suite) -> []; term_sequence_test(Config) -> do_test(term_sequence_test, Config). -term_struct_test(doc) -> ""; -term_struct_test(suite) -> []; term_struct_test(Config) -> do_test(term_struct_test, Config). -term_test(doc) -> ""; -term_test(suite) -> []; term_test(Config) -> do_test(term_test, Config). -typedef_test(doc) -> ""; -typedef_test(suite) -> []; typedef_test(Config) -> do_test(typedef_test, Config). -unsigned_long_long_test(doc) -> ""; -unsigned_long_long_test(suite) -> []; unsigned_long_long_test(Config) -> do_test(unsigned_long_long_test, Config). -unsigned_long_test(doc) -> ""; -unsigned_long_test(suite) -> []; unsigned_long_test(Config) -> do_test(unsigned_long_test, Config). -unsigned_short_test(doc) -> ""; -unsigned_short_test(suite) -> []; unsigned_short_test(Config) -> do_test(unsigned_short_test, Config). -void_test(doc) -> ""; -void_test(suite) -> []; void_test(Config) -> do_test(void_test, Config). -wchar_test(doc) -> ""; -wchar_test(suite) -> []; wchar_test(Config) -> do_test(wchar_test, Config). -wstring1_test(doc) -> ""; -wstring1_test(suite) -> []; wstring1_test(Config) -> do_test(wstring1_test, Config). @@ -275,7 +207,7 @@ do_test(Case, Config) -> {ok, _Pid} = m_i:oe_create_link([], {local, ?ERLANG_SERVER_NAME}), Node = atom_to_list(node()), %% [NodeName, HostName] = string:tokens(Node, "@"), - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), %% io:format("~p: data directory: ~p~n", [?MODULE, DataDir]), Cookie = atom_to_list(erlang:get_cookie()), %% Start C-client node as a port program. diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl index ed45b7fd82..334db7c1da 100644 --- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl @@ -48,7 +48,7 @@ %% Add/remove code path and watchdog before/after each test case. %% init_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:add_patha(DataDir), %% Since other test suites use the module m_i, we have @@ -60,9 +60,9 @@ init_per_testcase(_Case, Config) -> [{watchdog, WatchDog}| Config]. end_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:del_path(DataDir), - WatchDog = ?config(watchdog, Config), + WatchDog = proplists:get_value(watchdog, Config), test_server:timetrap_cancel(WatchDog). suite() -> [{ct_hooks,[ts_install_cth]}]. @@ -94,175 +94,105 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. - - -array1_test(doc) -> ""; -array1_test(suite) -> []; array1_test(Config) -> do_test(array1_test, Config). -array2_test(doc) -> ""; -array2_test(suite) -> []; array2_test(Config) -> do_test(array2_test, Config). -bool_test(doc) -> ""; -bool_test(suite) -> []; bool_test(Config) -> do_test(bool_test, Config). -char_test(doc) -> ""; -char_test(suite) -> []; char_test(Config) -> do_test(char_test, Config). -double_test(doc) -> ""; -double_test(suite) -> []; double_test(Config) -> do_test(double_test, Config). -enum_test(doc) -> ""; -enum_test(suite) -> []; enum_test(Config) -> do_test(enum_test, Config). -inline_sequence_test(doc) -> ""; -inline_sequence_test(suite) -> []; inline_sequence_test(Config) -> do_test(inline_sequence_test, Config). -long_long_test(doc) -> ""; -long_long_test(suite) -> []; long_long_test(Config) -> do_test(long_long_test, Config). -long_test(doc) -> ""; -long_test(suite) -> []; long_test(Config) -> do_test(long_test, Config). -octet_test(doc) -> ""; -octet_test(suite) -> []; octet_test(Config) -> do_test(octet_test, Config). -pid_test(doc) -> ""; -pid_test(suite) -> []; pid_test(Config) -> do_test(pid_test, Config). -port_test(doc) -> ""; -port_test(suite) -> []; port_test(Config) -> do_test(port_test, Config). -ref_test(doc) -> ""; -ref_test(suite) -> []; ref_test(Config) -> do_test(ref_test, Config). -seq1_test(doc) -> ""; -seq1_test(suite) -> []; seq1_test(Config) -> do_test(seq1_test, Config). -seq2_test(doc) -> ""; -seq2_test(suite) -> []; seq2_test(Config) -> do_test(seq2_test, Config). -seq3_test(doc) -> ""; -seq3_test(suite) -> []; seq3_test(Config) -> do_test(seq3_test, Config). -seq4_test(doc) -> ""; -seq4_test(suite) -> []; seq4_test(Config) -> do_test(seq4_test, Config). -seq5_test(doc) -> ""; -seq5_test(suite) -> []; seq5_test(Config) -> do_test(seq5_test, Config). -string1_test(doc) -> ""; -string1_test(suite) -> []; string1_test(Config) -> do_test(string1_test, Config). -string2_test(doc) -> ""; -string2_test(suite) -> []; string2_test(Config) -> do_test(string2_test, Config). -string3_test(doc) -> ""; -string3_test(suite) -> []; string3_test(Config) -> do_test(string3_test, Config). -string4_test(doc) -> ""; -string4_test(suite) -> []; string4_test(Config) -> do_test(string4_test, Config). -struct2_test(doc) -> ""; -struct2_test(suite) -> []; struct2_test(Config) -> do_test(struct2_test, Config). -struct_test(doc) -> ""; -struct_test(suite) -> []; struct_test(Config) -> do_test(struct_test, Config). -term_sequence_test(doc) -> ""; -term_sequence_test(suite) -> []; term_sequence_test(Config) -> do_test(term_sequence_test, Config). -term_struct_test(doc) -> ""; -term_struct_test(suite) -> []; term_struct_test(Config) -> do_test(term_struct_test, Config). -term_test(doc) -> ""; -term_test(suite) -> []; term_test(Config) -> do_test(term_test, Config). -typedef_test(doc) -> ""; -typedef_test(suite) -> []; typedef_test(Config) -> do_test(typedef_test, Config). -unsigned_long_long_test(doc) -> ""; -unsigned_long_long_test(suite) -> []; unsigned_long_long_test(Config) -> do_test(unsigned_long_long_test, Config). -unsigned_long_test(doc) -> ""; -unsigned_long_test(suite) -> []; unsigned_long_test(Config) -> do_test(unsigned_long_test, Config). -unsigned_short_test(doc) -> ""; -unsigned_short_test(suite) -> []; unsigned_short_test(Config) -> do_test(unsigned_short_test, Config). -void_test(doc) -> ""; -void_test(suite) -> []; void_test(Config) -> do_test(void_test, Config). -wchar_test(doc) -> ""; -wchar_test(suite) -> []; wchar_test(Config) -> do_test(wchar_test, Config). -wstring1_test(doc) -> ""; -wstring1_test(suite) -> []; wstring1_test(Config) -> do_test(wstring1_test, Config). @@ -277,7 +207,7 @@ do_test(Case, Config) -> {ok, _Pid} = m_i:oe_create_link([], {local, ?ERLANG_SERVER_NAME}), Node = atom_to_list(node()), %% [NodeName, HostName] = string:tokens(Node, "@"), - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), %% io:format("~p: data directory: ~p~n", [?MODULE, DataDir]), Cookie = atom_to_list(erlang:get_cookie()), %% Start C-client node as a port program. diff --git a/lib/ic/test/erl_client_c_server_SUITE.erl b/lib/ic/test/erl_client_c_server_SUITE.erl index cc0dbfda74..d592a611f7 100644 --- a/lib/ic/test/erl_client_c_server_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_SUITE.erl @@ -47,7 +47,7 @@ %% Add/remove code path and watchdog before/after each test case. %% init_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:add_patha(DataDir), %% Since other test suites use the module m_i, we have @@ -59,9 +59,9 @@ init_per_testcase(_Case, Config) -> [{watchdog, WatchDog}| Config]. end_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:del_path(DataDir), - WatchDog = ?config(watchdog, Config), + WatchDog = proplists:get_value(watchdog, Config), test_server:timetrap_cancel(WatchDog). suite() -> [{ct_hooks,[ts_install_cth]}]. @@ -93,174 +93,105 @@ end_per_group(_GroupName, Config) -> Config. - -array1_test(doc) -> ""; -array1_test(suite) -> []; array1_test(Config) -> do_test(array1_test, Config). -array2_test(doc) -> ""; -array2_test(suite) -> []; array2_test(Config) -> do_test(array2_test, Config). -bool_test(doc) -> ""; -bool_test(suite) -> []; bool_test(Config) -> do_test(bool_test, Config). -char_test(doc) -> ""; -char_test(suite) -> []; char_test(Config) -> do_test(char_test, Config). -double_test(doc) -> ""; -double_test(suite) -> []; double_test(Config) -> do_test(double_test, Config). -enum_test(doc) -> ""; -enum_test(suite) -> []; enum_test(Config) -> do_test(enum_test, Config). -inline_sequence_test(doc) -> ""; -inline_sequence_test(suite) -> []; inline_sequence_test(Config) -> do_test(inline_sequence_test, Config). -longlong_test(doc) -> ""; -longlong_test(suite) -> []; longlong_test(Config) -> do_test(longlong_test, Config). -long_test(doc) -> ""; -long_test(suite) -> []; long_test(Config) -> do_test(long_test, Config). -octet_test(doc) -> ""; -octet_test(suite) -> []; octet_test(Config) -> do_test(octet_test, Config). -pid_test(doc) -> ""; -pid_test(suite) -> []; pid_test(Config) -> do_test(pid_test, Config). -port_test(doc) -> ""; -port_test(suite) -> []; port_test(Config) -> do_test(port_test, Config). -ref_test(doc) -> ""; -ref_test(suite) -> []; ref_test(Config) -> do_test(ref_test, Config). -seq1_test(doc) -> ""; -seq1_test(suite) -> []; seq1_test(Config) -> do_test(seq1_test, Config). -seq2_test(doc) -> ""; -seq2_test(suite) -> []; seq2_test(Config) -> do_test(seq2_test, Config). -seq3_test(doc) -> ""; -seq3_test(suite) -> []; seq3_test(Config) -> do_test(seq3_test, Config). -seq4_test(doc) -> ""; -seq4_test(suite) -> []; seq4_test(Config) -> do_test(seq4_test, Config). -seq5_test(doc) -> ""; -seq5_test(suite) -> []; seq5_test(Config) -> do_test(seq5_test, Config). -string1_test(doc) -> ""; -string1_test(suite) -> []; string1_test(Config) -> do_test(string1_test, Config). -string2_test(doc) -> ""; -string2_test(suite) -> []; string2_test(Config) -> do_test(string2_test, Config). -string3_test(doc) -> ""; -string3_test(suite) -> []; string3_test(Config) -> do_test(string3_test, Config). -string4_test(doc) -> ""; -string4_test(suite) -> []; string4_test(Config) -> do_test(string4_test, Config). -struct2_test(doc) -> ""; -struct2_test(suite) -> []; struct2_test(Config) -> do_test(struct2_test, Config). -struct_test(doc) -> ""; -struct_test(suite) -> []; struct_test(Config) -> do_test(struct_test, Config). -term_sequence_test(doc) -> ""; -term_sequence_test(suite) -> []; term_sequence_test(Config) -> do_test(term_sequence_test, Config). -term_struct_test(doc) -> ""; -term_struct_test(suite) -> []; term_struct_test(Config) -> do_test(term_struct_test, Config). -term_test(doc) -> ""; -term_test(suite) -> []; term_test(Config) -> do_test(term_test, Config). -typedef_test(doc) -> ""; -typedef_test(suite) -> []; typedef_test(Config) -> do_test(typedef_test, Config). -ulonglong_test(doc) -> ""; -ulonglong_test(suite) -> []; ulonglong_test(Config) -> do_test(ulonglong_test, Config). -ulong_test(doc) -> ""; -ulong_test(suite) -> []; ulong_test(Config) -> do_test(ulong_test, Config). -ushort_test(doc) -> ""; -ushort_test(suite) -> []; ushort_test(Config) -> do_test(ushort_test, Config). -void_test(doc) -> ""; -void_test(suite) -> []; void_test(Config) -> do_test(void_test, Config). -wchar_test(doc) -> ""; -wchar_test(suite) -> []; wchar_test(Config) -> do_test(wchar_test, Config). -wstring1_test(doc) -> ""; -wstring1_test(suite) -> []; wstring1_test(Config) -> do_test(wstring1_test, Config). @@ -270,7 +201,7 @@ do_test(Case, Config) -> process_flag(trap_exit, true), Node = atom_to_list(node()), [_NodeName, HostName] = string:tokens(Node, "@"), - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), %% io:format("~p: data directory: ~p~n", [?MODULE, DataDir]), Cookie = atom_to_list(erlang:get_cookie()), ServerNodeName = atom_to_list(?C_SERVER_NODE_NAME), diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE.erl b/lib/ic/test/erl_client_c_server_proto_SUITE.erl index 48330b95a8..99eeed01ad 100644 --- a/lib/ic/test/erl_client_c_server_proto_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_proto_SUITE.erl @@ -47,7 +47,7 @@ %% Add/remove code path and watchdog before/after each test case. %% init_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:add_patha(DataDir), %% Since other test suites use the module m_i, we have @@ -59,9 +59,9 @@ init_per_testcase(_Case, Config) -> [{watchdog, WatchDog}| Config]. end_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:del_path(DataDir), - WatchDog = ?config(watchdog, Config), + WatchDog = proplists:get_value(watchdog, Config), test_server:timetrap_cancel(WatchDog). suite() -> [{ct_hooks,[ts_install_cth]}]. @@ -93,174 +93,105 @@ end_per_group(_GroupName, Config) -> Config. - -array1_test(doc) -> ""; -array1_test(suite) -> []; array1_test(Config) -> do_test(array1_test, Config). -array2_test(doc) -> ""; -array2_test(suite) -> []; array2_test(Config) -> do_test(array2_test, Config). -bool_test(doc) -> ""; -bool_test(suite) -> []; bool_test(Config) -> do_test(bool_test, Config). -char_test(doc) -> ""; -char_test(suite) -> []; char_test(Config) -> do_test(char_test, Config). -double_test(doc) -> ""; -double_test(suite) -> []; double_test(Config) -> do_test(double_test, Config). -enum_test(doc) -> ""; -enum_test(suite) -> []; enum_test(Config) -> do_test(enum_test, Config). -inline_sequence_test(doc) -> ""; -inline_sequence_test(suite) -> []; inline_sequence_test(Config) -> do_test(inline_sequence_test, Config). -longlong_test(doc) -> ""; -longlong_test(suite) -> []; longlong_test(Config) -> do_test(longlong_test, Config). -long_test(doc) -> ""; -long_test(suite) -> []; long_test(Config) -> do_test(long_test, Config). -octet_test(doc) -> ""; -octet_test(suite) -> []; octet_test(Config) -> do_test(octet_test, Config). -pid_test(doc) -> ""; -pid_test(suite) -> []; pid_test(Config) -> do_test(pid_test, Config). -port_test(doc) -> ""; -port_test(suite) -> []; port_test(Config) -> do_test(port_test, Config). -ref_test(doc) -> ""; -ref_test(suite) -> []; ref_test(Config) -> do_test(ref_test, Config). -seq1_test(doc) -> ""; -seq1_test(suite) -> []; seq1_test(Config) -> do_test(seq1_test, Config). -seq2_test(doc) -> ""; -seq2_test(suite) -> []; seq2_test(Config) -> do_test(seq2_test, Config). -seq3_test(doc) -> ""; -seq3_test(suite) -> []; seq3_test(Config) -> do_test(seq3_test, Config). -seq4_test(doc) -> ""; -seq4_test(suite) -> []; seq4_test(Config) -> do_test(seq4_test, Config). -seq5_test(doc) -> ""; -seq5_test(suite) -> []; seq5_test(Config) -> do_test(seq5_test, Config). -string1_test(doc) -> ""; -string1_test(suite) -> []; string1_test(Config) -> do_test(string1_test, Config). -string2_test(doc) -> ""; -string2_test(suite) -> []; string2_test(Config) -> do_test(string2_test, Config). -string3_test(doc) -> ""; -string3_test(suite) -> []; string3_test(Config) -> do_test(string3_test, Config). -string4_test(doc) -> ""; -string4_test(suite) -> []; string4_test(Config) -> do_test(string4_test, Config). -struct2_test(doc) -> ""; -struct2_test(suite) -> []; struct2_test(Config) -> do_test(struct2_test, Config). -struct_test(doc) -> ""; -struct_test(suite) -> []; struct_test(Config) -> do_test(struct_test, Config). -term_sequence_test(doc) -> ""; -term_sequence_test(suite) -> []; term_sequence_test(Config) -> do_test(term_sequence_test, Config). -term_struct_test(doc) -> ""; -term_struct_test(suite) -> []; term_struct_test(Config) -> do_test(term_struct_test, Config). -term_test(doc) -> ""; -term_test(suite) -> []; term_test(Config) -> do_test(term_test, Config). -typedef_test(doc) -> ""; -typedef_test(suite) -> []; typedef_test(Config) -> do_test(typedef_test, Config). -ulonglong_test(doc) -> ""; -ulonglong_test(suite) -> []; ulonglong_test(Config) -> do_test(ulonglong_test, Config). -ulong_test(doc) -> ""; -ulong_test(suite) -> []; ulong_test(Config) -> do_test(ulong_test, Config). -ushort_test(doc) -> ""; -ushort_test(suite) -> []; ushort_test(Config) -> do_test(ushort_test, Config). -void_test(doc) -> ""; -void_test(suite) -> []; void_test(Config) -> do_test(void_test, Config). -wchar_test(doc) -> ""; -wchar_test(suite) -> []; wchar_test(Config) -> do_test(wchar_test, Config). -wstring1_test(doc) -> ""; -wstring1_test(suite) -> []; wstring1_test(Config) -> do_test(wstring1_test, Config). @@ -270,7 +201,7 @@ do_test(Case, Config) -> process_flag(trap_exit, true), Node = atom_to_list(node()), [_NodeName, HostName] = string:tokens(Node, "@"), - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), %% io:format("~p: data directory: ~p~n", [?MODULE, DataDir]), Cookie = atom_to_list(erlang:get_cookie()), ServerNodeName = atom_to_list(?C_SERVER_NODE_NAME), diff --git a/lib/ic/test/ic_SUITE.erl b/lib/ic/test/ic_SUITE.erl index 1d436eda2b..42c1dbb415 100644 --- a/lib/ic/test/ic_SUITE.erl +++ b/lib/ic/test/ic_SUITE.erl @@ -83,7 +83,7 @@ %% Standard options to the ic compiler, NOTE unholy use of OutDir --define(OUT(X), filename:join([?config(priv_dir, Config), gen, to_list(X)])). +-define(OUT(X), filename:join([proplists:get_value(priv_dir, Config), gen, to_list(X)])). %% Top of cases @@ -129,9 +129,6 @@ end_per_group(_GroupName, Config) -> Config. - -app_test(doc) -> []; -app_test(suite) -> []; app_test(_Config) -> ok=test_server:app_test(ic), ok. @@ -141,89 +138,72 @@ app_test(_Config) -> %% Test of constant expressions. %% - - -const_norm(doc) -> - ["Checks normal constant types and values"]; -const_norm(suite) -> []; +%% Checks normal constant types and values const_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(const_norm), File = filename:join(DataDir, c_norm), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, const_norm_files()), + ok = ic:gen(File, stdopts(OutDir)), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, const_norm_files()), ok. -const_bad_tk(doc) -> - ["Checks when the constant value doesn't match the declared type"]; -const_bad_tk(suite) -> []; +%% Checks when the constant value doesn't match the declared type const_bad_tk(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, c_err1), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(18, bad_tk_match, R), ok. -const_bad_type(doc) -> - ["Checks operands of ops are of correct type"]; -const_bad_type(suite) -> []; +%% Checks operands of ops are of correct type const_bad_type(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, c_err2), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(4, bad_type, R), ok. -const_bad_comb(doc) -> - ["Checks operands of ops are of conflicting types"]; -const_bad_comb(suite) -> []; +%% Checks operands of ops are of conflicting types const_bad_comb(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, c_err3), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(3, bad_type_combination, R), ok. - - - -union_norm(doc) -> - ["Checks that normal union declarations works."]; -union_norm(suite) -> []; +%% Checks that normal union declarations works. union_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(union_norm), File = filename:join(DataDir, u_norm), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, union_norm_files()), + ok = ic:gen(File, stdopts(OutDir)), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, union_norm_files()), ok. %% Checks OTP-2007 -union_default(doc) -> - ["Checks that default cases are correct in type code."]; -union_default(suite) -> []; +%% Checks that default cases are correct in type code. union_default(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(union_default), File = filename:join(DataDir, u_default), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, union_default_files(), [load]), + ok = ic:gen(File, stdopts(OutDir)), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, union_default_files(), [load]), TkList = i1:oe_get_interface(), check_label("op0", 0, TkList), check_label("op1", 1, TkList), @@ -256,50 +236,41 @@ check_label(Id, N, List) -> test_server:fail({'no_such_op!', Id, List}) end. -union_type(doc) -> - ["Checks that errors are detected. Check that mismatch between case ", - "value and declared discriminator type is detected."]; -union_type(suite) -> []; +%% Checks that errors are detected. Check that mismatch between case +%% value and declared discriminator type is detected. union_type(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, u_type), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(28, bad_case_type, R), ok. -union_mult_err(doc) -> - ["Check that multiple declared declarators are caught.", - "Also check that if the discriminator is an enum, then the enum name", - "must not be used as a declarator in the union switch (declarator", - "as opposed to label)."]; -union_mult_err(suite) -> []; +%% Check that multiple declared declarators are caught. +%% Also check that if the discriminator is an enum, then the enum name +%% must not be used as a declarator in the union switch (declarator +%% as opposed to label). union_mult_err(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, u_mult), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(8, multiply_defined, R), ok. -%% Checking mult cases. Now check that other errors are found in the -%% correct order XXXX - - -union_case_mult(doc) -> - ["Check that multiply defined case labels are found and reported."]; -union_case_mult(suite) -> []; +%% Check that multiply defined case labels are found in the +%% correct order union_case_mult(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, u_case_mult), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(7, multiple_cases, R), ok. @@ -309,19 +280,15 @@ union_case_mult(Config) when is_list(Config) -> %% %% Enum cases %% - - -enum_norm(doc) -> - ["Checks that normal enum declarations works."]; -enum_norm(suite) -> []; +%%Checks that normal enum declarations works. enum_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(enum_norm), File = filename:join(DataDir, enum), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, enum_norm_files()), + ok = ic:gen(File, stdopts(OutDir)), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, enum_norm_files()), ok. @@ -329,27 +296,23 @@ enum_norm(Config) when is_list(Config) -> %% %% Struct cases %% - - -struct_norm(doc) -> - ["Checks that normal struct declarations works."]; -struct_norm(suite) -> []; +%% Checks that normal struct declarations works. struct_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(struct_norm), File = filename:join(DataDir, struct), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, struct_norm_files()), + ok = ic:gen(File, stdopts(OutDir)), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, struct_norm_files()), Mod = ridiculous_name_to_avoid_clash_svenne, TestFile = filename:join(OutDir, Mod), - ?line ok = gen_struct_file(TestFile, Mod), - ?line ok = compile(OutDir, [Mod], [load]), -%% ?line {ok, Mod, []} = compile:file(TestFile, + ok = gen_struct_file(TestFile, Mod), + ok = compile(OutDir, [Mod], [load]), +%% {ok, Mod, []} = compile:file(TestFile, %% [{i, OutDir}, {outdir, OutDir}, %% return, load]), - ?line ok = Mod:test(), + ok = Mod:test(), ok. @@ -359,36 +322,30 @@ struct_norm(Config) when is_list(Config) -> %% %% coss (add sometimes, takes 440 seconds!) - -typeid(doc) -> - ["Check that type id's are generated correctly"]; -typeid(suite) -> []; +%% Check that type id's are generated correctly typeid(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(typeid), File = filename:join(DataDir, typeid), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, typeid_files(), [load]), - ?line "IDL:I1:1.0" = 'I1':'typeID'(), - ?line "IDL:M1/I1:1.0" = 'M1_I1':'typeID'(), - ?line "IDL:M2/M1/I1:1.0" = 'M2_M1_I1':'typeID'(), - ?line "IDL:M3/M2/M1/I1:1.0" = 'M3_M2_M1_I1':'typeID'(), + ok = ic:gen(File, stdopts(OutDir)), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, typeid_files(), [load]), + "IDL:I1:1.0" = 'I1':'typeID'(), + "IDL:M1/I1:1.0" = 'M1_I1':'typeID'(), + "IDL:M2/M1/I1:1.0" = 'M2_M1_I1':'typeID'(), + "IDL:M3/M2/M1/I1:1.0" = 'M3_M2_M1_I1':'typeID'(), ok. %%% This test case is removed because there's no way to test this from %%% an automated test suite. -dir(doc) -> - ["Check that relative directories work, absolute is used in", - "all other cases in the suite."]; -%%% xxxxxx -dir(suite) -> []; +%% Check that relative directories work, absolute is used in +%% all other cases in the suite. dir(Config) when is_list(Config) -> -ok; + ok; dir(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), %% Needs a unique directory (any better way?) OutDir = mk_unique("oe_the_dir"), @@ -402,94 +359,82 @@ dir(Config) -> %% Generate a unique IDL file with a single constant gen_file(File, Const), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line ok = compile(OutDir, [load]), - ?line 19955 = Mod:Func(), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, [load]), - ?line 19955 = Mod:Func(), + ok = ic:gen(File, stdopts(OutDir)), + ok = compile(OutDir, [load]), + 19955 = Mod:Func(), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, [load]), + 19955 = Mod:Func(), - ?line ok = ic:gen(File), -%%% ?line ok = compile(".", [load]), + ok = ic:gen(File), +%%% ok = compile(".", [load]), ok. -undef_id(doc) -> - ["Check that various undefied id's are detected correctly"]; -undef_id(suite) -> []; +%% Check that various undefied id's are detected correctly undef_id(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, undef_id), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(16, tk_not_found, R), ok. -mult_ids(doc) -> - ["Check that multiply defined ids are caught."]; -mult_ids(suite) -> []; +%% Check that multiply defined ids are caught. mult_ids(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, mult_ids), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(22, multiply_defined, R), ok. -nasty_names(doc) -> - ["Check that various nasty names can be generated.", - "Try to provoke name clashes and name conflicts with", - "Erlang and IDL"]; -nasty_names(suite) -> []; +%% Check that various nasty names can be generated. +%% Try to provoke name clashes and name conflicts with +%% Erlang and IDL nasty_names(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(nasty_names), File = filename:join(DataDir, nasty), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, nasty_names_files(), [load]), + ok = ic:gen(File, stdopts(OutDir)), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, nasty_names_files(), [load]), ok. -coss(doc) -> - ["Check that the Coss standard specification works."]; -coss(suite) -> []; +%% Check that the Coss standard specification works. coss(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(coss), File = filename:join(DataDir, 'Coss'), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, [_W1]} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, []), + ok = ic:gen(File, stdopts(OutDir)), + {ok, [_W1]} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, []), ok. -forward(doc) -> - ["Check that forward declaratios work."]; -forward(suite) -> []; +%% Check that forward declaratios work. forward(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(forward), File = filename:join(DataDir, forward), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, forward_files(), [load]), + ok = ic:gen(File, stdopts(OutDir)), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, forward_files(), [load]), ok. -include(doc) -> - ["Check that various undefied id's are detected correctly"]; -include(suite) -> []; +%% Check that various undefied id's are detected correctly include(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, include), - ?line error = ic:gen(File, stdopts(OutDir)++[{preproc_flags,"-I" ++ DataDir}]), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)++[{preproc_flags,"-I" ++ DataDir}]), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[{preproc_flags,"-I" ++ DataDir},silent2]), case lists:map(fun(D) -> filename:rootname(filename:basename(element(3, D))) @@ -513,228 +458,198 @@ include(Config) when is_list(Config) -> %% Inhertit cases %% - -inherit_norm(doc) -> - ["Checks that normal inheritance works."]; -inherit_norm(suite) -> []; +%% Checks that normal inheritance works. inherit_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(inherit_norm), File = filename:join(DataDir, inherit), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, _Ws} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, inherit_norm_files(), [load]), + ok = ic:gen(File, stdopts(OutDir)), + {ok, _Ws} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, inherit_norm_files(), [load]), %% Now check constant values: - ?line 9 = m1_I1:c1(), + 9 = m1_I1:c1(), - ?line 9 = m1_I2:c1(), - ?line 14 = m1_I2:c2(), - ?line 27 = m1_I2:c3(), + 9 = m1_I2:c1(), + 14 = m1_I2:c2(), + 27 = m1_I2:c3(), - ?line 50 = m1_I3:c1(), - ?line 14 = m1_I3:c2(), - ?line 27 = m1_I3:c3(), - ?line 91 = m1_I3:c4(), - ?line 100 = m1_I3:c5(), + 50 = m1_I3:c1(), + 14 = m1_I3:c2(), + 27 = m1_I3:c3(), + 91 = m1_I3:c4(), + 100 = m1_I3:c5(), ok. -inherit_warn(doc) -> - ["Check that various inheritance shadowing is detected"]; -inherit_warn(suite) -> []; +%% Check that various inheritance shadowing is detected inherit_warn(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, inherit_warn), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, R} = + ok = ic:gen(File, stdopts(OutDir)), + {ok, R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(7, inherit_name_shadow, R), ok. -inherit_err(doc) -> - ["Check that various inheritance errors is detected"]; -inherit_err(suite) -> []; +%% Check that various inheritance errors is detected inherit_err(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, inherit_err), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, _Ws, R} = + error = ic:gen(File, stdopts(OutDir)), + {error, _Ws, R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(21, inherit_name_collision, R), ok. - -oneway_norm(doc) -> - ["Checks that normal oneway operations works."]; -oneway_norm(suite) -> []; +%% Checks that normal oneway operations works. oneway_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(oneway_norm), File = filename:join(DataDir, one), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line ok = compile(OutDir, oneway_norm_files(), [load]), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, oneway_norm_files(), [load]), + ok = ic:gen(File, stdopts(OutDir)), + ok = compile(OutDir, oneway_norm_files(), [load]), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, oneway_norm_files(), [load]), ok. -oneway_void(doc) -> - ["Check that non-void oneways are detected."]; -oneway_void(suite) -> []; +%% Check that non-void oneways are detected. oneway_void(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, one_void), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(2, bad_oneway_type, R), ok. -oneway_raises(doc) -> - ["Check that oneways cannot raise exceptions."]; -oneway_raises(suite) -> []; +%% Check that oneways cannot raise exceptions. oneway_raises(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, one_raises), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(3, oneway_raises, R), ok. -oneway_out(doc) -> - ["Check that illegal out parameters are detected"]; -oneway_out(suite) -> []; +%% Check that illegal out parameters are detected oneway_out(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, one_out), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(2, oneway_outparams, R), ok. -oneway_followed(doc) -> - ["Checks that normal oneways, followed by other operations."]; -oneway_followed(suite) -> []; +%% Checks that normal oneways, followed by other operations. oneway_followed(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(oneway_followed), File = filename:join(DataDir, one_followed), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line ok = compile(OutDir, oneway_followed_files(), [load]), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, oneway_followed_files(), [load]), + ok = ic:gen(File, stdopts(OutDir)), + ok = compile(OutDir, oneway_followed_files(), [load]), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, oneway_followed_files(), [load]), ok. -attr_norm(doc) -> - ["Checks that normal attr operations works."]; -attr_norm(suite) -> []; +%% Checks that normal attr operations works. attr_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(attr_norm), File = filename:join(DataDir, attr), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line ok = compile(OutDir, attr_norm_files(), [load]), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, attr_norm_files(), [load]), + ok = ic:gen(File, stdopts(OutDir)), + ok = compile(OutDir, attr_norm_files(), [load]), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, attr_norm_files(), [load]), ok. -type_norm(doc) -> - ["Checks all types are handled."]; -type_norm(suite) -> []; +%% Checks all types are handled. type_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(type_norm), File = filename:join(DataDir, type), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line ok = compile(OutDir, type_norm_files(), [load]), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, type_norm_files(), [load]), + ok = ic:gen(File, stdopts(OutDir)), + ok = compile(OutDir, type_norm_files(), [load]), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, type_norm_files(), [load]), ok. - - -syntax1(suite) -> []; syntax1(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, syntax1), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(1, parse_error, R), ok. -syntax2(suite) -> []; syntax2(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, syntax2), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(1, parse_error, R), ok. -syntax3(suite) -> []; syntax3(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, syntax3), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(1, parse_error, R), ok. -syntax4(suite) -> []; syntax4(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, syntax4), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(1, parse_error, R), ok. -syntax5(suite) -> []; syntax5(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, syntax5), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(1, parse_error, R), ok. -syntax6(suite) -> []; syntax6(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, syntax6), - ?line error = ic:gen(File, stdopts(OutDir)), - ?line {error, [], R} = + error = ic:gen(File, stdopts(OutDir)), + {error, [], R} = ic:gen(File, stdopts(OutDir)++[silent2]), check_errors(1, parse_error, R), ok. @@ -747,17 +662,15 @@ syntax6(Config) when is_list(Config) -> %% ( OTP-2102 ) %% -raises_reg(doc) -> - ["Check that exceptions are really registered to operations."]; -raises_reg(suite) -> []; +%% Check that exceptions are really registered to operations. raises_reg(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(raises_reg_check), File = filename:join(DataDir, raises_reg), - ?line ok = ic:gen(File, stdopts(OutDir)), - ?line {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), - ?line ok = compile(OutDir, raises_reg_files(), [load]), + ok = ic:gen(File, stdopts(OutDir)), + {ok, []} = ic:gen(File, stdopts(OutDir)++[silent2]), + ok = compile(OutDir, raises_reg_files(), [load]), set_up('oe_raises_reg'), @@ -924,7 +837,7 @@ to_list(X) -> X. %% File must be an atom gen_struct_file(File, Mod) -> - ?line {ok, Fd} = file:open(to_list(File)++".erl", [write]), + {ok, Fd} = file:open(to_list(File)++".erl", [write]), io:format(Fd, "~n", []), io:format(Fd, "-module(~p).~n", [Mod]), io:format(Fd, "-export([test/0]).~n", []), diff --git a/lib/ic/test/ic_be_SUITE.erl b/lib/ic/test/ic_be_SUITE.erl index 2fa28fc103..d5d3038a6e 100644 --- a/lib/ic/test/ic_be_SUITE.erl +++ b/lib/ic/test/ic_be_SUITE.erl @@ -30,7 +30,7 @@ init_per_group/2,end_per_group/2,plain/1]). --define(OUT(X), filename:join([?config(priv_dir, Config), gen, to_list(X)])). +-define(OUT(X), filename:join([proplists:get_value(priv_dir, Config), gen, to_list(X)])). %% Top of cases @@ -56,35 +56,20 @@ end_per_group(_GroupName, Config) -> Config. - - -plain(doc) -> - ["Checking code for the plain backend."]; -plain(suite) -> []; +%% Checking code for the plain backend. plain(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(slask), File = filename:join(DataDir, plain), - - ?line ok = ic:gen(File,stdopts(OutDir)++[{be,erl_plain}]), - + ok = ic:gen(File,stdopts(OutDir)++[{be,erl_plain}]), ok. - - - %%-------------------------------------------------------------------- %% %% Utilities - - stdopts(OutDir) -> [{outdir, OutDir}, {maxerrs, infinity}]. - - - - to_list(X) when is_atom(X) -> atom_to_list(X); to_list(X) -> X. diff --git a/lib/ic/test/ic_pp_SUITE.erl b/lib/ic/test/ic_pp_SUITE.erl index 38e936f9bc..be37953126 100644 --- a/lib/ic/test/ic_pp_SUITE.erl +++ b/lib/ic/test/ic_pp_SUITE.erl @@ -29,7 +29,7 @@ %% Standard options to the ic compiler, NOTE unholy use of OutDir --define(OUT(X), filename:join([?config(priv_dir, Config), gen, to_list(X)])). +-define(OUT(X), filename:join([proplists:get_value(priv_dir, Config), gen, to_list(X)])). -define(GCC, "g++"). -define(GCC_VER, "2.95.3"). @@ -146,121 +146,100 @@ cases() -> %%-------------------------------------------------------------------- %% arg %%-------------------------------------------------------------------- - - -arg_norm(doc) -> ["Checks arguments for #define."]; -arg_norm(suite) -> []; +%% Checks arguments for #define. arg_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(arg_norm), File = filename:join(DataDir, arg), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% cascade %%-------------------------------------------------------------------- - - -cascade_norm(doc) -> ["Check cascade #define."]; -cascade_norm(suite) -> []; +%% Check cascade #define. cascade_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(cascade_norm), File = filename:join(DataDir, cascade), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% comment %%-------------------------------------------------------------------- - - -comment_norm(doc) -> ["Check comments."]; -comment_norm(suite) -> []; +%% Check comments. comment_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(comment_norm), File = filename:join(DataDir, comment), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% concat %%-------------------------------------------------------------------- - - -concat_norm(doc) -> ["Check concatinations, i.e ## ."]; -concat_norm(suite) -> []; +%% Check concatinations, i.e ## . concat_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(concat_norm), File = filename:join(DataDir, concat), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% define %%-------------------------------------------------------------------- - - -define_norm(doc) -> ["Check misceleaneous #define."]; -define_norm(suite) -> []; +%% Check misceleaneous #define. define_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(define_norm), File = filename:join(DataDir, define), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% if %%-------------------------------------------------------------------- - -if_norm(doc) -> ["Check #if, #elif, and #endif. ."]; -if_norm(suite) -> []; +%% Check #if, #elif, and #endif. if_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(if_norm), File = filename:join(DataDir, 'if'), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. -if_zero(doc) -> ["Check #if 0"]; -if_zero(suite) -> []; +%% Check #if 0 if_zero(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(if_zero), File = filename:join(DataDir, if_zero), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% inc %%-------------------------------------------------------------------- - - -inc_norm(doc) -> ["Check #include."]; -inc_norm(suite) -> []; +%% Check #include. inc_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(inc_norm), File = filename:join(DataDir, inc), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. @@ -268,166 +247,133 @@ inc_norm(Config) when is_list(Config) -> %%-------------------------------------------------------------------- %% improp_nest_constr %%-------------------------------------------------------------------- - - -improp_nest_constr_norm(doc) -> ["Check improperly nested constructs."]; -improp_nest_constr_norm(suite) -> []; +%% Check improperly nested constructs. improp_nest_constr_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(improp_nest_constr_norm), File = filename:join(DataDir, improp_nest_constr), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% misc %%-------------------------------------------------------------------- - - -misc_norm(doc) -> ["Misceleaneous checks."]; -misc_norm(suite) -> []; +%% Misceleaneous checks. misc_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(misc_norm), File = filename:join(DataDir, misc), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% line %%-------------------------------------------------------------------- - - -line_norm(doc) -> ["Checks #line."]; -line_norm(suite) -> []; +%% Checks #line. line_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(line_norm), File = filename:join(DataDir, line), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% nopara %%-------------------------------------------------------------------- - - -nopara_norm(doc) -> ["Checks #define with no parameters."]; -nopara_norm(suite) -> []; +%% Checks #define with no parameters. nopara_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(nopara_norm), File = filename:join(DataDir, nopara), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% predef %%-------------------------------------------------------------------- - - -predef_norm(doc) -> ["Checks predefined macros. Note: not __TIME__ and __DATE__."]; -predef_norm(suite) -> []; +%% Checks predefined macros. Note: not __TIME__ and __DATE__. predef_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(predef_norm), File = filename:join(DataDir, predef), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% predef_time %%-------------------------------------------------------------------- - - -predef_time_norm(doc) -> ["Checks the predefined macros __TIME__ and __DATE__."]; -predef_time_norm(suite) -> []; +%% Checks the predefined macros __TIME__ and __DATE__. predef_time_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(predef_time_norm), File = filename:join(DataDir, predef_time), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% self_ref %%-------------------------------------------------------------------- - - -self_ref_norm(doc) -> ["Checks self referring macros."]; -self_ref_norm(suite) -> []; +%% Checks self referring macros. self_ref_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(self_ref_norm), File = filename:join(DataDir, self_ref), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% separate %%-------------------------------------------------------------------- - - -separate_norm(doc) -> ["Checks separete expansion of macro arguments."]; -separate_norm(suite) -> []; +%% Checks separete expansion of macro arguments. separate_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(separate_norm), File = filename:join(DataDir, separate), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% swallow_sc %%-------------------------------------------------------------------- - - -swallow_sc_norm(doc) -> ["Checks swallowing an undesirable semicolon."]; -swallow_sc_norm(suite) -> []; +%% Checks swallowing an undesirable semicolon. swallow_sc_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(swallow_sc_norm), File = filename:join(DataDir, swallow_sc), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. %%-------------------------------------------------------------------- %% unintended_grp %%-------------------------------------------------------------------- - - -unintended_grp_norm(doc) -> ["Checks unintended grouping of arithmetic."]; -unintended_grp_norm(suite) -> []; +%% Checks unintended grouping of arithmetic. unintended_grp_norm(Config) when is_list(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), _OutDir = ?OUT(unintended_grp_norm), File = filename:join(DataDir, unintended_grp), - ?line ok = test_file(File, DataDir), + ok = test_file(File, DataDir), ok. - - - test_file(FileT, DataDir) -> case test_file_1(FileT, DataDir) of ok -> ok; @@ -441,39 +387,39 @@ test_file_1(FileT, DataDir) -> FileName = lists:last(Tok), File = FileT++".idl", - ?line test_server:format("File ~p~n",[File]), - ?line test_server:format("FileName ~p~n",[FileName]), + test_server:format("File ~p~n",[File]), + test_server:format("FileName ~p~n",[FileName]), Flags = "-I"++DataDir, - ?line test_server:format("Flags ~p~n",[Flags]), + test_server:format("Flags ~p~n",[Flags]), - ?line Erl = pp_erl(File, Flags), - ?line Gcc = pp_gcc(File, Flags), + Erl = pp_erl(File, Flags), + Gcc = pp_gcc(File, Flags), - ?line case Erl of + case Erl of {error,_ErlError} -> - ?line test_server:format("Internal_pp Result ~n==================~n~p~n~n",[Erl]); + test_server:format("Internal_pp Result ~n==================~n~p~n~n",[Erl]); {warning, _ErlWar} -> - ?line test_server:format("Internal_pp Result ~n==================~n~p~n~n",[Erl]); + test_server:format("Internal_pp Result ~n==================~n~p~n~n",[Erl]); _ -> - ?line test_server:format("Internal_pp Result ~n==================~n~s~n~n",[Erl]) + test_server:format("Internal_pp Result ~n==================~n~s~n~n",[Erl]) end, - ?line case Gcc of + case Gcc of {error,GccError} -> Error = string:tokens(GccError, "\n"), - ?line test_server:format(?GCC" Result ~n==========~n~p~n~n", + test_server:format(?GCC" Result ~n==========~n~p~n~n", [Error]); _ -> - ?line test_server:format(?GCC" Result ~n==========~n~s~n~n",[Gcc]) + test_server:format(?GCC" Result ~n==========~n~s~n~n",[Gcc]) end, - ?line case {Erl,Gcc} of + case {Erl,Gcc} of {{warning,W}, {error,X}} -> - ?line case is_ok(W,X) of + case is_ok(W,X) of yes -> ok; no -> @@ -487,7 +433,7 @@ test_file_1(FileT, DataDir) -> "Internal_pp found the following Warning = ~p~n",[W]); {{error,E}, {error,X}} -> - ?line case is_ok(E,X) of + case is_ok(E,X) of yes -> ok; no -> @@ -496,9 +442,9 @@ test_file_1(FileT, DataDir) -> end; {{error,E}, _} -> - ?line case FileName of + case FileName of "if" -> - ?line case if_res(E) of + case if_res(E) of ok -> ok; _ -> @@ -516,18 +462,18 @@ test_file_1(FileT, DataDir) -> _ -> - ?line file:write_file("/tmp/Erl.pp",list_to_binary(Erl)), - ?line file:write_file("/tmp/Gcc.pp",list_to_binary(Gcc)), + file:write_file("/tmp/Erl.pp",list_to_binary(Erl)), + file:write_file("/tmp/Gcc.pp",list_to_binary(Gcc)), - ?line Res = os:cmd("diff -b -w /tmp/Erl.pp /tmp/Gcc.pp"), - ?line test_server:format("///////////{error,E} E ~p FileName~p~n",[Res,FileName]), - ?line case {Res, FileName} of + Res = os:cmd("diff -b -w /tmp/Erl.pp /tmp/Gcc.pp"), + test_server:format("///////////{error,E} E ~p FileName~p~n",[Res,FileName]), + case {Res, FileName} of {[], _} -> - ?line test_server:format("Diff = [] OK!!!!!!~n"), + test_server:format("Diff = [] OK!!!!!!~n"), ok; {_, "predef_time"} -> Tokens = string:tokens(Res,"\n"), - ?line test_server:format("///////////{error,E} Tokens~p~n",[Tokens]), + test_server:format("///////////{error,E} Tokens~p~n",[Tokens]), case Tokens of ["3c3",_,"---",_,"5c5",_,"---",_,"9c9",_,"---",_] -> ok; diff --git a/lib/ic/test/ic_pragma_SUITE.erl b/lib/ic/test/ic_pragma_SUITE.erl index 61becf74bf..bb95e59109 100644 --- a/lib/ic/test/ic_pragma_SUITE.erl +++ b/lib/ic/test/ic_pragma_SUITE.erl @@ -47,7 +47,7 @@ end). %% Standard options to the ic compiler, NOTE unholy use of OutDir --define(OUT(X), filename:join([?config(priv_dir, Config), gen, to_list(X)])). +-define(OUT(X), filename:join([proplists:get_value(priv_dir, Config), gen, to_list(X)])). %%----------------------------------------------------------------- @@ -105,23 +105,21 @@ end_per_suite(Config) -> %%----------------------------------------------------------------- %% Test Case: IFR registration with pragmas %%----------------------------------------------------------------- -ifr_pragma_reg(doc) -> - ["Checks that IFR object is correctly registered under pragma engagement."]; -ifr_pragma_reg(suite) -> []; +%% Checks that IFR object is correctly registered under pragma engagement. ifr_pragma_reg(Config) when is_list(Config) -> ?REMAP_EXCEPT(ifr_pragma_reg_run(Config)). ifr_pragma_reg_run(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(ifr_pragma_reg), File0 = filename:join(DataDir, reg_m0), - ?line ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}]), - ?line ok = compile(OutDir, ifr_pragma_files()), + ok = compile(OutDir, ifr_pragma_files()), code:add_pathz(OutDir), %% OE_register for all files - ?line ok = 'oe_reg_m0':'oe_register'(), + ok = 'oe_reg_m0':'oe_register'(), %% Pragma registration test OE_IFR = orber_ifr:find_repository(), @@ -132,7 +130,7 @@ ifr_pragma_reg_run(Config) -> check_pragma_effect(OE_IFR,"IDL:P1/M2/T4:2.4"), %% OE_unregister for all files - ?line ok = 'oe_reg_m0':'oe_unregister'(), + ok = 'oe_reg_m0':'oe_unregister'(), code:del_path(OutDir), ok. @@ -157,14 +155,12 @@ check_pragma_effect(OE_IFR,ID) -> %%----------------------------------------------------------------- %% Test Case: Syntactical / Semantical error pragma definitions %%----------------------------------------------------------------- -pragma_error(doc) -> - ["Finds errornous pragma definitions under compilation."]; -pragma_error(suite) -> []; +%% Finds errornous pragma definitions under compilation. pragma_error(Config) when is_list(Config) -> ?REMAP_EXCEPT(pragma_error_run(Config)). pragma_error_run(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(pragma_error), File1 = filename:join(DataDir, reg_m1), File2 = filename:join(DataDir, reg_m2), @@ -173,22 +169,22 @@ pragma_error_run(Config) -> File5 = filename:join(DataDir, reg_m5), File6 = filename:join(DataDir, reg_m6), - ?line error = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, + error = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line error = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, + error = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line error = ic:gen(File3, stdopts(OutDir)++[{preproc_flags, + error = ic:gen(File3, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line ok = ic:gen(File4, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File4, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line error = ic:gen(File5, stdopts(OutDir)++[{preproc_flags, + error = ic:gen(File5, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line error = ic:gen(File6, stdopts(OutDir)++[{preproc_flags, + error = ic:gen(File6, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), ok. @@ -198,25 +194,23 @@ pragma_error_run(Config) -> %%----------------------------------------------------------------- %% Test Case: IFR registration with realy uggly placed pragmas %%----------------------------------------------------------------- -uggly_pragmas(doc) -> - ["Checks that IFR object is correctly registered under really uggly pragma engagement."]; -uggly_pragmas(suite) -> []; +%% Checks that IFR object is correctly registered under really uggly pragma engagement. uggly_pragmas(Config) when is_list(Config) -> ?REMAP_EXCEPT(uggly_pragmas_run(Config)). uggly_pragmas_run(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(ifr_pragma_reg), File0 = filename:join(DataDir, uggly), - ?line ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}]), - ?line ok = compile(OutDir, uggly_pragma_files()), + ok = compile(OutDir, uggly_pragma_files()), code:add_pathz(OutDir), %% OE_register for all files - ?line ok = 'oe_uggly':'oe_register'(), + ok = 'oe_uggly':'oe_register'(), %% Pragma registration test OE_IFR = orber_ifr:find_repository(), @@ -234,7 +228,7 @@ uggly_pragmas_run(Config) -> check_pragma_effect(OE_IFR, "LOCAL:SomeLocalId:23"), %% OE_unregister for all files - ?line ok = 'oe_uggly':'oe_unregister'(), + ok = 'oe_uggly':'oe_unregister'(), code:del_path(OutDir), ok. diff --git a/lib/ic/test/ic_register_SUITE.erl b/lib/ic/test/ic_register_SUITE.erl index 5eb50202d7..69eb923f85 100644 --- a/lib/ic/test/ic_register_SUITE.erl +++ b/lib/ic/test/ic_register_SUITE.erl @@ -51,7 +51,7 @@ end). %% Standard options to the ic compiler, NOTE unholy use of OutDir --define(OUT(X), filename:join([?config(priv_dir, Config), gen, to_list(X)])). +-define(OUT(X), filename:join([proplists:get_value(priv_dir, Config), gen, to_list(X)])). %%----------------------------------------------------------------- @@ -111,39 +111,37 @@ end_per_suite(Config) -> %%----------------------------------------------------------------- %% Test Case: IFR type registration %%----------------------------------------------------------------- -ifr_reg_unreg(doc) -> - ["Checks that the generated register/unregister " - "code for the IFR is correct."]; -ifr_reg_unreg(suite) -> []; +%% Checks that the generated register/unregister +%% code for the IFR is correct. ifr_reg_unreg(Config) when is_list(Config) -> ?REMAP_EXCEPT(ifr_reg_unregt_run(Config)). ifr_reg_unregt_run(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(ifr_reg_unreg), File0 = filename:join(DataDir, reg_m8), File1 = filename:join(DataDir, reg_m9), File2 = filename:join(DataDir, reg_m10), - ?line ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File0, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File0, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File1, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File1, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File2, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File2, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = compile(OutDir, ifr_reg_unreg_files()), + ok = compile(OutDir, ifr_reg_unreg_files()), code:add_pathz(OutDir), - ?line ok = 'oe_reg_m8':'oe_register'(), - ?line ok = 'oe_reg_m9':'oe_register'(), - ?line ok = 'oe_reg_m10':'oe_register'(), - ?line ok = 'oe_reg_m10':'oe_unregister'(), - ?line ok = 'oe_reg_m9':'oe_unregister'(), - ?line ok = 'oe_reg_m8':'oe_unregister'(), + ok = 'oe_reg_m8':'oe_register'(), + ok = 'oe_reg_m9':'oe_register'(), + ok = 'oe_reg_m10':'oe_register'(), + ok = 'oe_reg_m10':'oe_unregister'(), + ok = 'oe_reg_m9':'oe_unregister'(), + ok = 'oe_reg_m8':'oe_unregister'(), code:del_path(OutDir), ok. @@ -155,58 +153,56 @@ ifr_reg_unreg_files() -> ['oe_reg_m8', 'oe_reg_m9', 'oe_reg_m10']. %% Test Case: IFR registration when object inheritence %% is applied and registered. %%----------------------------------------------------------------- -ifr_reg_unreg_with_inheritence(doc) -> - ["Checks that the generated register/unregister " - "code for the IFR is correct, and works even when" - "the object inheritence is registered. This fixes" - "two bugs in ifr that caused crash when trying to" - "use OE_register/OE_unregister in a sequence of" - "compiled files that contained interfaces who" - "inherited others in sequence."]; -ifr_reg_unreg_with_inheritence(suite) -> []; +%% Checks that the generated register/unregister +%% code for the IFR is correct, and works even when +%% the object inheritence is registered. This fixes +%% two bugs in ifr that caused crash when trying to +%% use OE_register/OE_unregister in a sequence of +%% compiled files that contained interfaces who +%% inherited others in sequence. ifr_reg_unreg_with_inheritence(Config) when is_list(Config) -> ?REMAP_EXCEPT(ifr_reg_unreg_with_inheritence_run(Config)). ifr_reg_unreg_with_inheritence_run(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(ifr_reg_unreg), File0 = filename:join(DataDir, reg_m8), File1 = filename:join(DataDir, reg_m9), File2 = filename:join(DataDir, reg_m10), File3 = filename:join(DataDir, reg_m11), File4 = filename:join(DataDir, reg_m12), - ?line ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File0, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File0, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File1, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File1, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File2, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File2, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File3, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File3, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File3, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File3, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File4, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File4, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File4, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File4, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = compile(OutDir, ifr_reg_unreg_with_inheritence_files()), + ok = compile(OutDir, ifr_reg_unreg_with_inheritence_files()), code:add_pathz(OutDir), - ?line ok = 'oe_reg_m8':'oe_register'(), - ?line ok = 'oe_reg_m9':'oe_register'(), - ?line ok = 'oe_reg_m10':'oe_register'(), - ?line ok = 'oe_reg_m11':'oe_register'(), - ?line ok = 'oe_reg_m12':'oe_register'(), - ?line ok = 'oe_reg_m8':'oe_unregister'(), - ?line ok = 'oe_reg_m9':'oe_unregister'(), - ?line ok = 'oe_reg_m10':'oe_unregister'(), - ?line ok = 'oe_reg_m11':'oe_unregister'(), - ?line ok = 'oe_reg_m12':'oe_unregister'(), + ok = 'oe_reg_m8':'oe_register'(), + ok = 'oe_reg_m9':'oe_register'(), + ok = 'oe_reg_m10':'oe_register'(), + ok = 'oe_reg_m11':'oe_register'(), + ok = 'oe_reg_m12':'oe_register'(), + ok = 'oe_reg_m8':'oe_unregister'(), + ok = 'oe_reg_m9':'oe_unregister'(), + ok = 'oe_reg_m10':'oe_unregister'(), + ok = 'oe_reg_m11':'oe_unregister'(), + ok = 'oe_reg_m12':'oe_unregister'(), code:del_path(OutDir), ok. @@ -224,35 +220,28 @@ ifr_reg_unreg_with_inheritence_files() -> %% are not allready registered when the current %% object is getting registered. %%----------------------------------------------------------------- -ifr_reg_unreg_with_inheritence_bad_order(doc) -> - ["This tests that ifr registration is done with - the right write order." - "Modules included and used from an ifr object" - "are tested if allready registered when the " - "current object is getting registered."]; -ifr_reg_unreg_with_inheritence_bad_order(suite) -> []; ifr_reg_unreg_with_inheritence_bad_order(Config) when is_list(Config) -> ?REMAP_EXCEPT(ifr_reg_unreg_with_inheritence_bad_order_run(Config)). ifr_reg_unreg_with_inheritence_bad_order_run(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(ifr_reg_unreg), File1 = filename:join(DataDir, reg_m9), File2 = filename:join(DataDir, reg_m10), File4 = filename:join(DataDir, reg_m12), - ?line ok = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File1, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File1, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File2, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File2, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File4, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File4, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File4, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File4, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = compile(OutDir, ifr_reg_unreg_with_inheritence_files()), + ok = compile(OutDir, ifr_reg_unreg_with_inheritence_files()), code:add_pathz(OutDir), case catch 'oe_reg_m12':'oe_register'() of {'EXIT',Reason1} -> @@ -261,7 +250,7 @@ ifr_reg_unreg_with_inheritence_bad_order_run(Config) -> _ -> test_server:fail("Failed to detect object missing : IDL:M1:1.0~n") end, - ?line ok = 'oe_reg_m9':'oe_register'(), + ok = 'oe_reg_m9':'oe_register'(), case catch 'oe_reg_m10':'oe_register'() of {'EXIT',Reason2} -> io:format("IFR object missing detected : ~p~n",[Reason2]), @@ -269,75 +258,70 @@ ifr_reg_unreg_with_inheritence_bad_order_run(Config) -> _ -> test_server:fail("Failed to detect object missing : IDL:M0:1.0~n") end, - ?line ok = 'oe_reg_m9':'oe_unregister'(), + ok = 'oe_reg_m9':'oe_unregister'(), code:del_path(OutDir), ok. - - %%----------------------------------------------------------------- -%% Test Case: IFR registration with inheritence +%% Test Case: IFR registration with inheritence is correctly registered %%----------------------------------------------------------------- -ifr_inheritence_reg(doc) -> - ["Checks that IFR object inheritence is correctly registered."]; -ifr_inheritence_reg(suite) -> []; ifr_inheritence_reg(Config) when is_list(Config) -> ?REMAP_EXCEPT(ifr_inh_reg_run(Config)). ifr_inh_reg_run(Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), OutDir = ?OUT(ifr_reg_unreg), File0 = filename:join(DataDir, reg_m8), File1 = filename:join(DataDir, reg_m9), File2 = filename:join(DataDir, reg_m10), File3 = filename:join(DataDir, reg_m11), File4 = filename:join(DataDir, reg_m12), - ?line ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File0, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File0, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File0, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File1, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File1, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File1, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File2, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File2, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File2, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File3, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File3, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File3, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File3, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = ic:gen(File4, stdopts(OutDir)++[{preproc_flags, + ok = ic:gen(File4, stdopts(OutDir)++[{preproc_flags, "-I" ++ DataDir}] ), - ?line {ok, []} = ic:gen(File4, stdopts(OutDir)++[silent2, {preproc_flags, + {ok, []} = ic:gen(File4, stdopts(OutDir)++[silent2, {preproc_flags, "-I" ++ DataDir}]), - ?line ok = compile(OutDir, ifr_reg_unreg_with_inheritence_files()), + ok = compile(OutDir, ifr_reg_unreg_with_inheritence_files()), code:add_pathz(OutDir), %% OE_register for all files - ?line ok = 'oe_reg_m8':'oe_register'(), - ?line ok = 'oe_reg_m9':'oe_register'(), - ?line ok = 'oe_reg_m10':'oe_register'(), - ?line ok = 'oe_reg_m11':'oe_register'(), - ?line ok = 'oe_reg_m12':'oe_register'(), + ok = 'oe_reg_m8':'oe_register'(), + ok = 'oe_reg_m9':'oe_register'(), + ok = 'oe_reg_m10':'oe_register'(), + ok = 'oe_reg_m11':'oe_register'(), + ok = 'oe_reg_m12':'oe_register'(), %% Inheritence registration test OE_IFR = orber_ifr:find_repository(), %% Interfaces that not inherit from other interfaces - ?line [] = get_inh(OE_IFR, "IDL:m0/i0:1.0"), - ?line [] = get_inh(OE_IFR, "IDL:m1/i1:1.0"), - ?line [] = get_inh(OE_IFR, "IDL:m3/i3:1.0"), + [] = get_inh(OE_IFR, "IDL:m0/i0:1.0"), + [] = get_inh(OE_IFR, "IDL:m1/i1:1.0"), + [] = get_inh(OE_IFR, "IDL:m3/i3:1.0"), %% Interfaces that inherit from other interfaces - ?line ["IDL:m1/i1:1.0"] = get_inh(OE_IFR, "IDL:m2/i2:1.0"), - ?line ["IDL:m1/i1:1.0","IDL:m2/i2:1.0"] = get_inh(OE_IFR, "IDL:m4/i4:1.0"), - ?line ["IDL:m3/i3:1.0"] = get_inh(OE_IFR, "IDL:m4/i5:1.0"), + ["IDL:m1/i1:1.0"] = get_inh(OE_IFR, "IDL:m2/i2:1.0"), + ["IDL:m1/i1:1.0","IDL:m2/i2:1.0"] = get_inh(OE_IFR, "IDL:m4/i4:1.0"), + ["IDL:m3/i3:1.0"] = get_inh(OE_IFR, "IDL:m4/i5:1.0"), %% OE_unregister for all files - ?line ok = 'oe_reg_m8':'oe_unregister'(), - ?line ok = 'oe_reg_m9':'oe_unregister'(), - ?line ok = 'oe_reg_m10':'oe_unregister'(), - ?line ok = 'oe_reg_m11':'oe_unregister'(), - ?line ok = 'oe_reg_m12':'oe_unregister'(), + ok = 'oe_reg_m8':'oe_unregister'(), + ok = 'oe_reg_m9':'oe_unregister'(), + ok = 'oe_reg_m10':'oe_unregister'(), + ok = 'oe_reg_m11':'oe_unregister'(), + ok = 'oe_reg_m12':'oe_unregister'(), code:del_path(OutDir), ok. diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl index 50ea3f43ca..9fe52249ba 100644 --- a/lib/ic/test/java_client_erl_server_SUITE.erl +++ b/lib/ic/test/java_client_erl_server_SUITE.erl @@ -99,7 +99,7 @@ end_per_suite(Config) -> Config. %% Add/remove code path and watchdog before/after each test case. %% init_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:add_patha(DataDir), %% Since other test suites use the module m_i et,al, we have @@ -115,9 +115,9 @@ init_per_testcase(_Case, Config) -> [{watchdog, WatchDog}| Config]. end_per_testcase(_Case, Config) -> - DataDir = ?config(data_dir, Config), + DataDir = proplists:get_value(data_dir, Config), code:del_path(DataDir), - WatchDog = ?config(watchdog, Config), + WatchDog = proplists:get_value(watchdog, Config), test_server:timetrap_cancel(WatchDog). @@ -126,127 +126,104 @@ end_per_testcase(_Case, Config) -> %% %% Test cases -marshal_ll(doc) -> - ["Testing marshalling of IDL long long"]; -marshal_ll(suite) -> []; +%% Testing marshalling of IDL long long marshal_ll(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_ll}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_ll}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_ll]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_ull(doc) -> - ["Testing marshalling of IDL unsigned long long"]; -marshal_ull(suite) -> []; +%% Testing marshalling of IDL unsigned long long marshal_ull(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_ull}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_ull}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_ull]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_l(doc) -> - ["Testing marshalling of IDL long"]; -marshal_l(suite) -> []; +%% Testing marshalling of IDL long marshal_l(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_l}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_l}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_l]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_ul(doc) -> - ["Testing marshalling of IDL unsigned long"]; -marshal_ul(suite) -> []; +%% Testing marshalling of IDL unsigned long marshal_ul(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_ul}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_ul}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_ul]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_s(doc) -> - ["Testing marshalling of IDL short"]; -marshal_s(suite) -> []; +%% Testing marshalling of IDL short marshal_s(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_s}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_s}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_s]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_us(doc) -> - ["Testing marshalling of IDL unsigned short"]; -marshal_us(suite) -> []; +%% Testing marshalling of IDL unsigned short marshal_us(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_us}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_us}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_us]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_c(doc) -> - ["Testing marshalling of IDL char"]; -marshal_c(suite) -> []; +%% Testing marshalling of IDL char marshal_c(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_c}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_c}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_c]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_wc(doc) -> - ["Testing marshalling of IDL char"]; -marshal_wc(suite) -> []; +%% Testing marshalling of IDL char marshal_wc(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_wc}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_wc}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_wc]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_str(doc) -> - ["Testing marshalling of IDL string"]; -marshal_str(suite) -> []; +%% Testing marshalling of IDL string marshal_str(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_str}), - ?line ok = java(?config(java, Config), DataDir, + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_str}), + ok = java(proplists:get_value(java, Config), DataDir, %%% "-DOtpConnection.trace=4 " "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_str]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_any_3(doc) -> - ["Testing marshalling of IDL any"]; -marshal_any_3(suite) -> []; +%% Testing marshalling of IDL any marshal_any_3(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_any_3}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_any_3}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_any_3]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. -marshal_any_2(doc) -> - ["Testing marshalling of IDL any"]; -marshal_any_2(suite) -> []; marshal_any_2(Config) when is_list(Config) -> - ?line DataDir = ?config(data_dir, Config), - ?line {ok,Server} = m_i:oe_create_link([], {local,marshal_any_2}), - ?line ok = java(?config(java, Config), DataDir, "JavaClient", + DataDir = proplists:get_value(data_dir, Config), + {ok,Server} = m_i:oe_create_link([], {local,marshal_any_2}), + ok = java(proplists:get_value(java, Config), DataDir, "JavaClient", ["JavaClient",node(),erlang:get_cookie(),marshal_any_2]), - ?line ok = m_i:stop(Server), + ok = m_i:stop(Server), ok. %%-------------------------------------------------------------------- -- cgit v1.2.3