diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-05-20 18:52:30 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-05-20 18:52:30 +0200 |
commit | 3b5bfab5235cb045c4c24d076006ded3e5d1a423 (patch) | |
tree | 8ea9c51c72d26807d4887f5c06aa3a686fb1874c /lib/xmerl | |
parent | 6d1458814b1d9b3030f4823461e22a2be8d3fc68 (diff) | |
download | otp-3b5bfab5235cb045c4c24d076006ded3e5d1a423.tar.gz otp-3b5bfab5235cb045c4c24d076006ded3e5d1a423.tar.bz2 otp-3b5bfab5235cb045c4c24d076006ded3e5d1a423.zip |
Modernize timetraps
Diffstat (limited to 'lib/xmerl')
-rw-r--r-- | lib/xmerl/test/xmerl_SUITE.erl | 28 | ||||
-rw-r--r-- | lib/xmerl/test/xmerl_sax_std_SUITE.erl | 4 | ||||
-rw-r--r-- | lib/xmerl/test/xmerl_std_SUITE.erl | 41 | ||||
-rw-r--r-- | lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl | 21 | ||||
-rw-r--r-- | lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl | 22 | ||||
-rw-r--r-- | lib/xmerl/test/xmerl_xsd_SUITE.erl | 26 | ||||
-rw-r--r-- | lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl | 36 |
7 files changed, 54 insertions, 124 deletions
diff --git a/lib/xmerl/test/xmerl_SUITE.erl b/lib/xmerl/test/xmerl_SUITE.erl index 75d602dd53..25b8aaa870 100644 --- a/lib/xmerl/test/xmerl_SUITE.erl +++ b/lib/xmerl/test/xmerl_SUITE.erl @@ -63,19 +63,16 @@ groups() -> {app_test, [], [{xmerl_app_test, all}]}, {appup_test, [], [{xmerl_appup_test, all}]}]. -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. +suite() -> + [{timetrap,{minutes,10}}]. %%---------------------------------------------------------------------- %% Initializations %%---------------------------------------------------------------------- + init_per_suite(doc) -> ["Starts the test suite"]; init_per_suite(Config) -> - Dog=test_server:timetrap({minutes,10}), file:set_cwd(?config(data_dir,Config)), ok=erl_tar:extract("cpd.tar.gz",[compressed]), ok=erl_tar:extract("misc.tar.gz",[compressed]), @@ -85,7 +82,7 @@ init_per_suite(Config) -> {ok, xpath_lib} = compile:file(xpath_lib, [{i, TestServerIncludeDir}]), {ok, xpath_text} = compile:file(xpath_text, [{i, TestServerIncludeDir}]), {ok, xpath_abbrev} = compile:file(xpath_abbrev, [{i, TestServerIncludeDir}]), - [{watchdog, Dog}|Config]. + Config. -ifndef(dont_rm_test_dirs). @@ -93,18 +90,14 @@ end_per_suite(doc) -> ["Stops the test suite"]; end_per_suite(Config) -> file:set_cwd(?config(data_dir,Config)), - ok=rm_files(["cpd", "misc"]), - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), - lists:keydelete(watchdog,1,Config). + ok = rm_files(["cpd", "misc"]), + ok. -else. end_per_suite(doc) -> ["Stops the test suite"]; end_per_suite(Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), - lists:keydelete(watchdog,1,Config). + ok. -endif. @@ -113,14 +106,11 @@ init_per_testcase(_TestCase,Config) -> io:format("Config:~n~p",[Config]), {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])), code:add_patha(?config(priv_dir,Config)), - Dog=test_server:timetrap({minutes,10}), - [{watchdog, Dog}|Config]. + Config. %% clean up after each testcase -end_per_testcase(_Func,Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), +end_per_testcase(_Func,_Config) -> ok. diff --git a/lib/xmerl/test/xmerl_sax_std_SUITE.erl b/lib/xmerl/test/xmerl_sax_std_SUITE.erl index fec6150a8d..f2f88f62a6 100644 --- a/lib/xmerl/test/xmerl_sax_std_SUITE.erl +++ b/lib/xmerl/test/xmerl_sax_std_SUITE.erl @@ -74,14 +74,10 @@ init_per_testcase(_TestCase,Config) -> io:format("Config:\n~p\n",[Config]), {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])), code:add_patha(?config(priv_dir,Config)), -% Dog=test_server:timetrap({minutes,10}), -% [{watchdog, Dog}|Config]. Config. %% clean up after each testcase end_per_testcase(_Func,_Config) -> -% Dog=?config(watchdog, Config), -% test_server:timetrap_cancel(Dog), ok. %%---------------------------------------------------------------------- diff --git a/lib/xmerl/test/xmerl_std_SUITE.erl b/lib/xmerl/test/xmerl_std_SUITE.erl index 635cfc2137..c502a28e02 100644 --- a/lib/xmerl/test/xmerl_std_SUITE.erl +++ b/lib/xmerl/test/xmerl_std_SUITE.erl @@ -62,12 +62,8 @@ groups() -> {japanese_test_cases, [], 'xerox-japanese'(suite)}, {oasis_test_cases, [], 'nist-oasis'(suite)}]. -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - +suite() -> + [{timetrap,{minutes,10}}]. 'sun-valid'(suite) -> %% 28 test cases @@ -758,35 +754,29 @@ end_per_group(_GroupName, Config) -> init_per_suite(doc) -> ["Starts the test suite"]; init_per_suite(Config) -> - Dog=test_server:timetrap({minutes,10}), file:set_cwd(?config(data_dir,Config)), - ok=erl_tar:extract("ibm.tgz",[compressed]), - ok=erl_tar:extract("japanese.tgz",[compressed]), - ok=erl_tar:extract("oasis.tgz",[compressed]), - ok=erl_tar:extract("sun.tgz",[compressed]), - ok=erl_tar:extract("xmltest.tgz",[compressed]), + ok = erl_tar:extract("ibm.tgz",[compressed]), + ok = erl_tar:extract("japanese.tgz",[compressed]), + ok = erl_tar:extract("oasis.tgz",[compressed]), + ok = erl_tar:extract("sun.tgz",[compressed]), + ok = erl_tar:extract("xmltest.tgz",[compressed]), ok = change_mode(["ibm","japanese","oasis", - "sun","xmltest"]), - [{watchdog, Dog}|Config]. - + "sun","xmltest"]), + Config. -ifndef(dont_rm_test_dirs). end_per_suite(doc) -> ["Stops the test suite"]; end_per_suite(Config) -> file:set_cwd(?config(data_dir,Config)), - ok=rm_files(["ibm","japanese","oasis","sun","xmltest"]), - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), - lists:keydelete(watchdog,1,Config). + ok = rm_files(["ibm","japanese","oasis","sun","xmltest"]), + ok. -else. end_per_suite(doc) -> ["Stops the test suite"]; end_per_suite(Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), - lists:keydelete(watchdog,1,Config). + ok. -endif. %% initialization before each testcase @@ -794,14 +784,11 @@ init_per_testcase(_TestCase,Config) -> io:format("Config:~n~p",[Config]), {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])), code:add_patha(?config(priv_dir,Config)), - Dog=test_server:timetrap({minutes,10}), - [{watchdog, Dog}|Config]. + Config. %% clean up after each testcase -end_per_testcase(_Func,Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), +end_per_testcase(_Func,_Config) -> ok. diff --git a/lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl b/lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl index c998887a3b..32ec380597 100644 --- a/lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl +++ b/lib/xmerl/test/xmerl_xsd_MS2002-01-16_SUITE.erl @@ -39,22 +39,14 @@ all() -> particlesKOSRTQUVW, stABCDE, stFGH, stIJK, stZ, wildABCDEF, wildGHI, wildJKLMNQOP, wildZ]. -groups() -> - []. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - +suite() -> + [{timetrap,{minutes,3}}]. %% initialization before the test suite init_per_suite(Config) -> - Dog=test_server:timetrap({minutes,10}), + ct:timetrap({minutes,10}), xmerl_xsd_lib:unpack(Config,msx), {ok,LogFile} = xmerl_xsd_lib:create_error_log_file(Config,msx), - test_server:timetrap_cancel(Dog), [{suite,msx},{xmerl_error_log,LogFile}|Config]. end_per_suite(Config) -> @@ -64,13 +56,10 @@ end_per_suite(Config) -> %% initialization before each testcase init_per_testcase(TestCase,Config) -> - Dog=test_server:timetrap({minutes,3}), - [{testcase,TestCase},{watchdog, Dog}|Config]. + [{testcase,TestCase}|Config]. %% clean up after each testcase -end_per_testcase(_Func,Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), +end_per_testcase(_Func,_Config) -> ok. %% Syntax Checking for Attribute Declaration diff --git a/lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl b/lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl index 86e41e8a79..d9df8687d9 100644 --- a/lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl +++ b/lib/xmerl/test/xmerl_xsd_NIST2002-01-16_SUITE.erl @@ -54,23 +54,14 @@ all() -> 'NISTSchema-unsignedByte', 'NISTSchema-unsignedInt', 'NISTSchema-unsignedLong', 'NISTSchema-unsignedShort']. -groups() -> - []. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - - +suite() -> + [{timetrap,{minutes,3}}]. %% initialization before the test suite init_per_suite(Config) -> - Dog=test_server:timetrap({minutes,10}), + ct:timetrap({minutes,10}), xmerl_xsd_lib:unpack(Config,nist), {ok,LogFile} = xmerl_xsd_lib:create_error_log_file(Config,nist), - test_server:timetrap_cancel(Dog), [{suite,nist},{xmerl_error_log,LogFile}|Config]. end_per_suite(Config) -> @@ -80,13 +71,10 @@ end_per_suite(Config) -> %% initialization before each testcase init_per_testcase(TestCase,Config) -> - Dog=test_server:timetrap({minutes,3}), - [{testcase,TestCase},{watchdog, Dog}|Config]. + [{testcase,TestCase}|Config]. %% clean up after each testcase -end_per_testcase(_Func,Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), +end_per_testcase(_Func,_Config) -> ok. %% Data type derived by restriction of anyURI by facets diff --git a/lib/xmerl/test/xmerl_xsd_SUITE.erl b/lib/xmerl/test/xmerl_xsd_SUITE.erl index d0676809bd..cd3ecaa3bd 100644 --- a/lib/xmerl/test/xmerl_xsd_SUITE.erl +++ b/lib/xmerl/test/xmerl_xsd_SUITE.erl @@ -74,30 +74,22 @@ groups() -> {misc_block_tests, [], [compare_dateTime, compare_duration]}]. -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. +suite() -> + [{timetrap,{minutes,10}}]. init_per_testcase(_TestCase,Config) -> - {ok, _} = - file:read_file_info(filename:join([?config(priv_dir,Config)])), + {ok,_} = file:read_file_info(filename:join([?config(priv_dir,Config)])), code:add_patha(?config(priv_dir,Config)), - Dog=test_server:timetrap({minutes,10}), - [{watchdog, Dog}|Config]. + Config. -end_per_testcase(_Func,Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), +end_per_testcase(_Func,_Config) -> ok. string(suite) -> []; string(_Config) -> %% #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] - Str = [16#9,16#A,16#D,16#20,16#D7FF,16#E000,16#FFFD,16#10000, - 16#10FFFF], + Str = [16#9,16#A,16#D,16#20,16#D7FF,16#E000,16#FFFD,16#10000, 16#10FFFF], {ok,_} = check_simpleType(string,Str,dummy). boolean(suite) -> []; @@ -1025,9 +1017,9 @@ ticket_6910(Config) -> ticket_7165(suite) -> []; ticket_7165(Config) -> %% The validation option seems not to work - {E,_} = xmerl_scan:file(filename:join([?config(data_dir,Config), - "ticket_7288.xml"]), - [{validation, schema}]), + {_E,_} = xmerl_scan:file(filename:join([?config(data_dir,Config), + "ticket_7288.xml"]), + [{validation, schema}]), %% The option xsdbase gave {error, enoent}. {ok,_} = xmerl_xsd:process_schema("CxDataType_Rel5.xsd", [{xsdbase, ?config(data_dir,Config)}]). diff --git a/lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl b/lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl index 83729879f9..2af6165ee6 100644 --- a/lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl +++ b/lib/xmerl/test/xmerl_xsd_Sun2002-01-16_SUITE.erl @@ -48,40 +48,28 @@ all() -> 'Sun-xsiType-block-2', 'Sun-xsiType-block-3', 'Sun-xsiType-block-4', 'Sun-type-and-subst-1']. -groups() -> - []. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - - +suite() -> + [{timetrap,{minutes,3}}]. %% initialization before the test suite init_per_suite(Config) -> - Dog=test_server:timetrap({minutes,10}), - xmerl_xsd_lib:unpack(Config,sun), - {ok,LogFile} = xmerl_xsd_lib:create_error_log_file(Config,sun), - test_server:timetrap_cancel(Dog), - [{suite,sun},{xmerl_error_log,LogFile}|Config]. + ct:timetrap({minutes,10}), + xmerl_xsd_lib:unpack(Config,sun), + {ok,LogFile} = xmerl_xsd_lib:create_error_log_file(Config,sun), + [{suite,sun},{xmerl_error_log,LogFile}|Config]. end_per_suite(Config) -> - xmerl_xsd_lib:rmdir(Config,sun), - xmerl_xsd_lib:close_error_log_file(Config), - ok. + xmerl_xsd_lib:rmdir(Config,sun), + xmerl_xsd_lib:close_error_log_file(Config), + ok. %% initialization before each testcase init_per_testcase(TestCase,Config) -> - Dog=test_server:timetrap({minutes,3}), - [{testcase,TestCase},{watchdog, Dog}|Config]. + [{testcase,TestCase}|Config]. %% clean up after each testcase -end_per_testcase(_Func,Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), - ok. +end_per_testcase(_Func,_Config) -> + ok. %% ID Constranints. Very naive test of identity constraint 'Sun-idc001.nogen'(Config) when is_list(Config) -> |