From a219c06f31e082449a1e001c051661370fa00a5d Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Wed, 11 Mar 2015 09:41:11 +0100 Subject: Replace all calls to now/0 in CT with new time API functions --- .../cth/tests/update_config_cth.erl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl') diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl index 2ee0d7da9c..55a1b9a130 100644 --- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl @@ -24,6 +24,7 @@ -include_lib("common_test/src/ct_util.hrl"). -include_lib("common_test/include/ct_event.hrl"). +-define(now, os:timestamp()). %% CT Hooks -compile(export_all). @@ -33,44 +34,44 @@ init(Id, Opts) -> pre_init_per_suite(Suite, Config, State) -> empty_cth:pre_init_per_suite(Suite,Config,State), - {[{pre_init_per_suite,now()}|Config],State}. + {[{pre_init_per_suite,?now}|Config],State}. post_init_per_suite(Suite,Config,Return,State) -> empty_cth:post_init_per_suite(Suite,Config,Return,State), - {[{post_init_per_suite,now()}|Return],State}. + {[{post_init_per_suite,?now}|Return],State}. pre_end_per_suite(Suite,Config,State) -> empty_cth:pre_end_per_suite(Suite,Config,State), - {[{pre_end_per_suite,now()}|Config],State}. + {[{pre_end_per_suite,?now}|Config],State}. post_end_per_suite(Suite,Config,Return,State) -> empty_cth:post_end_per_suite(Suite,Config,Return,State), - NewConfig = [{post_end_per_suite,now()}|Config], + NewConfig = [{post_end_per_suite,?now}|Config], {NewConfig,NewConfig}. pre_init_per_group(Group,Config,State) -> empty_cth:pre_init_per_group(Group,Config,State), - {[{pre_init_per_group,now()}|Config],State}. + {[{pre_init_per_group,?now}|Config],State}. post_init_per_group(Group,Config,Return,State) -> empty_cth:post_init_per_group(Group,Config,Return,State), - {[{post_init_per_group,now()}|Return],State}. + {[{post_init_per_group,?now}|Return],State}. pre_end_per_group(Group,Config,State) -> empty_cth:pre_end_per_group(Group,Config,State), - {[{pre_end_per_group,now()}|Config],State}. + {[{pre_end_per_group,?now}|Config],State}. post_end_per_group(Group,Config,Return,State) -> empty_cth:post_end_per_group(Group,Config,Return,State), - {[{post_end_per_group,now()}|Config],State}. + {[{post_end_per_group,?now}|Config],State}. pre_init_per_testcase(TC,Config,State) -> empty_cth:pre_init_per_testcase(TC,Config,State), - {[{pre_init_per_testcase,now()}|Config],State}. + {[{pre_init_per_testcase,?now}|Config],State}. post_end_per_testcase(TC,Config,Return,State) -> empty_cth:post_end_per_testcase(TC,Config,Return,State), - {[{post_end_per_testcase,now()}|Config],State}. + {[{post_end_per_testcase,?now}|Config],State}. on_tc_fail(TC, Reason, State) -> empty_cth:on_tc_fail(TC,Reason,State). -- cgit v1.2.1 From 738c34d4bb8f1a3811acd00af8c6c12107f8315b Mon Sep 17 00:00:00 2001 From: Bruce Yinhe Date: Thu, 18 Jun 2015 11:31:02 +0200 Subject: Change license text to APLv2 --- .../cth/tests/update_config_cth.erl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl') diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl index 55a1b9a130..0202201eed 100644 --- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl @@ -3,16 +3,17 @@ %% %% Copyright Ericsson AB 2010-2011. All Rights Reserved. %% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. %% %% %CopyrightEnd% %% -- cgit v1.2.1 From a99c84bf251e21f23c77f1026e32e63cf552143e Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Mon, 29 Feb 2016 15:42:08 +0100 Subject: Update ct_hooks test suites --- .../cth/tests/update_config_cth.erl | 154 +++++++++++---------- 1 file changed, 81 insertions(+), 73 deletions(-) (limited to 'lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl') diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl index 0202201eed..5503bf85ae 100644 --- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl @@ -1,8 +1,8 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010-2011. All Rights Reserved. -%% +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010-2011. All Rights Reserved. +%% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at @@ -14,71 +14,79 @@ %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -%% -%% %CopyrightEnd% -%% - - --module(update_config_cth). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - --define(now, os:timestamp()). - -%% CT Hooks --compile(export_all). - -init(Id, Opts) -> - empty_cth:init(Id, Opts). - -pre_init_per_suite(Suite, Config, State) -> - empty_cth:pre_init_per_suite(Suite,Config,State), - {[{pre_init_per_suite,?now}|Config],State}. - -post_init_per_suite(Suite,Config,Return,State) -> - empty_cth:post_init_per_suite(Suite,Config,Return,State), - {[{post_init_per_suite,?now}|Return],State}. - -pre_end_per_suite(Suite,Config,State) -> - empty_cth:pre_end_per_suite(Suite,Config,State), - {[{pre_end_per_suite,?now}|Config],State}. - -post_end_per_suite(Suite,Config,Return,State) -> - empty_cth:post_end_per_suite(Suite,Config,Return,State), - NewConfig = [{post_end_per_suite,?now}|Config], - {NewConfig,NewConfig}. - -pre_init_per_group(Group,Config,State) -> - empty_cth:pre_init_per_group(Group,Config,State), - {[{pre_init_per_group,?now}|Config],State}. - -post_init_per_group(Group,Config,Return,State) -> - empty_cth:post_init_per_group(Group,Config,Return,State), - {[{post_init_per_group,?now}|Return],State}. - -pre_end_per_group(Group,Config,State) -> - empty_cth:pre_end_per_group(Group,Config,State), - {[{pre_end_per_group,?now}|Config],State}. - -post_end_per_group(Group,Config,Return,State) -> - empty_cth:post_end_per_group(Group,Config,Return,State), - {[{post_end_per_group,?now}|Config],State}. - -pre_init_per_testcase(TC,Config,State) -> - empty_cth:pre_init_per_testcase(TC,Config,State), - {[{pre_init_per_testcase,?now}|Config],State}. - -post_end_per_testcase(TC,Config,Return,State) -> - empty_cth:post_end_per_testcase(TC,Config,Return,State), - {[{post_end_per_testcase,?now}|Config],State}. - -on_tc_fail(TC, Reason, State) -> - empty_cth:on_tc_fail(TC,Reason,State). - -on_tc_skip(TC, Reason, State) -> - empty_cth:on_tc_skip(TC,Reason,State). - -terminate(State) -> - empty_cth:terminate(State). +%% +%% %CopyrightEnd% +%% + + +-module(update_config_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + +-define(now, os:timestamp()). + +%% CT Hooks +-compile(export_all). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_cth:pre_init_per_suite(Suite,Config,State), + {[{pre_init_per_suite,?now}|Config],State}. + +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State), + {[{post_init_per_suite,?now}|Return],State}. + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State), + {[{pre_end_per_suite,?now}|Config],State}. + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State), + NewConfig = [{post_end_per_suite,?now}|Config], + {NewConfig,NewConfig}. + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State), + {[{pre_init_per_group,?now}|Config],State}. + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State), + {[{post_init_per_group,?now}|Return],State}. + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State), + {[{pre_end_per_group,?now}|Config],State}. + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State), + {[{post_end_per_group,?now}|Config],State}. + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State), + {[{pre_init_per_testcase,?now}|Config],State}. + +post_init_per_testcase(TC,Config,Return,State) -> + empty_cth:post_init_per_testcase(TC,Config,Return,State), + {[{post_init_per_testcase,?now}|Config],State}. + +pre_end_per_testcase(TC,Config,State) -> + empty_cth:pre_end_per_testcase(TC,Config,State), + {[{pre_end_per_testcase,?now}|Config],State}. + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State), + {[{post_end_per_testcase,?now}|Config],State}. + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_cth:terminate(State). -- cgit v1.2.1 From 6664eed554974336909d3ffe03f20349cc4c38fd Mon Sep 17 00:00:00 2001 From: Henrik Nord Date: Tue, 15 Mar 2016 15:19:56 +0100 Subject: update copyright-year --- .../test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl') diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl index 5503bf85ae..02f7fa7564 100644 --- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2011. All Rights Reserved. +%% Copyright Ericsson AB 2010-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. -- cgit v1.2.1 From 44082e24cf0b649792b83c6e5c8f07b17586aeaf Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Fri, 29 Apr 2016 14:00:14 +0200 Subject: Fix bug with clashing timestamp values --- .../test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl') diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl index 5503bf85ae..928bedfed1 100644 --- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl @@ -25,7 +25,7 @@ -include_lib("common_test/src/ct_util.hrl"). -include_lib("common_test/include/ct_event.hrl"). --define(now, os:timestamp()). +-define(now, ct_test_support:unique_timestamp()). %% CT Hooks -compile(export_all). -- cgit v1.2.1