From cfc6bb25d488aedaef6749d274afa536af31e65f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 23 Aug 2012 16:22:47 +0200 Subject: Fix boken spec --- lib/common_test/src/ct_hooks.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl index d0432b604d..1bcc63738e 100644 --- a/lib/common_test/src/ct_hooks.erl +++ b/lib/common_test/src/ct_hooks.erl @@ -48,7 +48,7 @@ %% @doc Called before any suites are started -spec init(State :: term()) -> ok | - {error, Reason :: term()}. + {fail, Reason :: term()}. init(Opts) -> call(get_new_hooks(Opts, undefined) ++ get_builtin_hooks(Opts), ok, init, []). -- cgit v1.2.3 From 0e5190b8970e6514da9100f5664284c786dee6a2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 24 Aug 2012 11:09:35 +0200 Subject: Fix compile warning --- lib/common_test/src/cth_surefire.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common_test/src/cth_surefire.erl b/lib/common_test/src/cth_surefire.erl index e7bd84e51b..76b0f0b5ea 100644 --- a/lib/common_test/src/cth_surefire.erl +++ b/lib/common_test/src/cth_surefire.erl @@ -92,7 +92,7 @@ on_tc_fail(_TC, Res, State) -> {fail,lists:flatten(io_lib:format("~p",[Res]))} }, State#state{ test_cases = [NewTC | tl(TCs)]}. -on_tc_skip(Tc,{Type,Reason} = Res, State) when Type == tc_auto_skip -> +on_tc_skip(Tc,{Type,_Reason} = Res, State) when Type == tc_auto_skip -> do_tc_skip(Res, end_tc(Tc,[],Res,init_tc(State,[]))); on_tc_skip(_Tc, _Res, State = #state{test_cases = []}) -> State; -- cgit v1.2.3 From 74dc5ada9156ed1dd8bb73d6b298b2cdcf3cf3dc Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 24 Aug 2012 11:10:21 +0200 Subject: Generate tags in edoc xml headings --- lib/erl_docgen/src/docgen_edoc_xml_cb.erl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl index 20daae8215..cbaa93a15d 100644 --- a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl +++ b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl @@ -338,7 +338,7 @@ otp_xmlify_e(#xmlElement{name=code} = E) -> % 4) end; otp_xmlify_e(#xmlElement{name=Tag} = E) % 5a when Tag==h1; Tag==h2; Tag==h3; Tag==h4; Tag==h5 -> - Content = text_only(E#xmlElement.content), + Content = text_and_a_name_only(E#xmlElement.content), [E#xmlElement{name=b, content=Content}]; otp_xmlify_e(#xmlElement{name=Tag} = E) % 5b-c) when Tag==center; @@ -1161,6 +1161,18 @@ get_text(#xmlElement{content=[#xmlText{value=Text}]}) -> get_text(#xmlElement{content=[E]}) -> get_text(E). +%% text_and_name_only(Es) -> Ts +text_and_a_name_only([#xmlElement{ + name = a, + attributes = [#xmlAttribute{name=name}]} = Name|Es]) -> + [Name|text_and_a_name_only(Es)]; +text_and_a_name_only([#xmlElement{content = Content}|Es]) -> + text_and_a_name_only(Content) ++ text_and_a_name_only(Es); +text_and_a_name_only([#xmlText{} = E |Es]) -> + [E | text_and_a_name_only(Es)]; +text_and_a_name_only([]) -> + []. + %% text_only(Es) -> Ts %% Takes a list of xmlElement and xmlText and return a lists of xmlText. text_only([#xmlElement{content = Content}|Es]) -> -- cgit v1.2.3 From c9034896271dd9fc8f8e19810e06baf46198336d Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 24 Aug 2012 11:11:40 +0200 Subject: Fix broken links --- lib/stdlib/doc/src/unicode_usage.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stdlib/doc/src/unicode_usage.xml b/lib/stdlib/doc/src/unicode_usage.xml index b7b5d497d0..acd36d2125 100644 --- a/lib/stdlib/doc/src/unicode_usage.xml +++ b/lib/stdlib/doc/src/unicode_usage.xml @@ -212,7 +212,7 @@ Eshell V5.7 (abort with ^G)
Unicode in environment variables and parameters

Environment variables and their interpretation is handled much in the same way as file names. If Unicode file names are enabled, environment variables as well as parameters to the Erlang VM are expected to be in Unicode.

-

If Unicode file names are enabled, the calls to os:getenv/0, os:getenv/1 and os:putenv/2 will handle Unicode strings. On Unix-like platforms, the built-in functions will translate environment variables in UTF-8 to/from Unicode strings, possibly with codepoints > 255. On Windows the Unicode versions of the environment system API will be used, also allowing for codepoints > 255.

+

If Unicode file names are enabled, the calls to os:getenv/0, os:getenv/1 and os:putenv/2 will handle Unicode strings. On Unix-like platforms, the built-in functions will translate environment variables in UTF-8 to/from Unicode strings, possibly with codepoints > 255. On Windows the Unicode versions of the environment system API will be used, also allowing for codepoints > 255.

On Unix-like operating systems, parameters are expected to be UTF-8 without translation if Unicode file names are enabled.

-- cgit v1.2.3 From 7a57b91fd08f3ca9bffb8d5a02ab797a10a21ec8 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 28 Aug 2012 16:50:41 +0200 Subject: Do not verify del_path as it is not always there --- lib/asn1/test/asn1_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 56f31de638..b0c37d79e7 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -248,7 +248,7 @@ init_per_testcase(Func, Config) -> [{case_dir, CaseDir}, {watchdog, Dog}|Config]. end_per_testcase(_Func, Config) -> - true = code:del_path(?config(case_dir, Config)), + code:del_path(?config(case_dir, Config)), test_server:timetrap_cancel(?config(watchdog, Config)). %%------------------------------------------------------------------------------ -- cgit v1.2.3 From 92ecb763b778617af7211c6c062c1b41489bf49c Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 29 Aug 2012 10:29:59 +0200 Subject: Ignore calls to dialyzer_timing when checking deprecated --- erts/test/otp_SUITE.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl index 332733e075..5f28f22606 100644 --- a/erts/test/otp_SUITE.erl +++ b/erts/test/otp_SUITE.erl @@ -181,6 +181,7 @@ dialyzer_filter(Undef) -> ({_,{dialyzer_codeserver,_,_}}) -> false; ({_,{dialyzer_contracts,_,_}}) -> false; ({_,{dialyzer_cl_parse,_,_}}) -> false; + ({_,{dialyzer_timing,_,_}}) -> false; ({_,{dialyzer_plt,_,_}}) -> false; ({_,{dialyzer_succ_typings,_,_}}) -> false; ({_,{dialyzer_utils,_,_}}) -> false; -- cgit v1.2.3 From c0ef28d5eecffc56b72a281a6d73f5ad1504bf0a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 29 Aug 2012 15:12:51 +0200 Subject: Document that CTHs can get fail/skip as Config OTP-10077 --- lib/common_test/doc/src/ct_hooks.xml | 20 +++++++++++++------- lib/common_test/doc/src/ct_hooks_chapter.xml | 7 +++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/common_test/doc/src/ct_hooks.xml b/lib/common_test/doc/src/ct_hooks.xml index b98c04a850..b3e713c77f 100644 --- a/lib/common_test/doc/src/ct_hooks.xml +++ b/lib/common_test/doc/src/ct_hooks.xml @@ -5,7 +5,7 @@
- 20102011 + 20102012 Ericsson AB. All Rights Reserved. @@ -111,11 +111,12 @@ - Module:pre_init_per_suite(SuiteName, Config, CTHState) -> + Module:pre_init_per_suite(SuiteName, InitData, CTHState) -> Result Called before init_per_suite SuiteName = atom() + InitData = Config | SkipOrFail Config = NewConfig = [{Key,Value}] CTHState = NewCTHState = term() Result = {Return, NewCTHState} @@ -140,7 +141,8 @@

SuiteName is the name of the suite to be run.

-

Config is the original config list of the test suite.

+

InitData is the original config list of the test suite, or + a SkipOrFail tuple if a previous CTH has returned this.

CTHState is the current internal state of the CTH.

@@ -212,11 +214,12 @@
- Module:pre_init_per_group(GroupName, Config, CTHState) -> + Module:pre_init_per_group(GroupName, InitData, CTHState) -> Result Called before init_per_group GroupName = atom() + InitData = Config | SkipOrFail Config = NewConfig = [{Key,Value}] CTHState = NewCTHState = term() Result = {NewConfig | SkipOrFail, NewCTHState} @@ -269,11 +272,12 @@ - Module:pre_init_per_testcase(TestcaseName, Config, CTHState) -> + Module:pre_init_per_testcase(TestcaseName, InitData, CTHState) -> Result Called before init_per_testcase TestcaseName = atom() + InitData = Config | SkipOrFail Config = NewConfig = [{Key,Value}] CTHState = NewCTHState = term() Result = {NewConfig | SkipOrFail, NewCTHState} @@ -330,11 +334,12 @@ - Module:pre_end_per_group(GroupName, Config, CTHState) -> + Module:pre_end_per_group(GroupName, EndData, CTHState) -> Result Called before end_per_group GroupName = atom() + EndData = Config | SkipOrFail Config = NewConfig = [{Key,Value}] CTHState = NewCTHState = term() Result = {NewConfig | SkipOrFail, NewCTHState} @@ -387,11 +392,12 @@ - Module:pre_end_per_suite(SuiteName, Config, CTHState) -> + Module:pre_end_per_suite(SuiteName, EndData, CTHState) -> Result Called before end_per_suite SuiteName = atom() + EndData = Config | SkipOrFail Config = NewConfig = [{Key,Value}] CTHState = NewCTHState = term() Result = {NewConfig | SkipOrFail, NewCTHState} diff --git a/lib/common_test/doc/src/ct_hooks_chapter.xml b/lib/common_test/doc/src/ct_hooks_chapter.xml index c938851e0e..86237f5fc1 100644 --- a/lib/common_test/doc/src/ct_hooks_chapter.xml +++ b/lib/common_test/doc/src/ct_hooks_chapter.xml @@ -252,6 +252,13 @@ {ok, Handle} -> {[{db_handle, Handle} | Config], CTHState#state{ handle = Handle }} end. + If using multiple CTHs, the first part of the return tuple will be + used as input for the next CTH. So in the case above the next CTH might + get {fail,Reason} as the second parameter. If you have many CTHs + which interact, it might be a good idea to not let each CTH return + fail or skip. Instead return that an action should be taken + through the Config list and implement a CTH which at the end takes + the correct action.
-- cgit v1.2.3