diff options
author | Erlang/OTP <[email protected]> | 2016-05-03 10:10:54 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2016-05-03 10:10:54 +0200 |
commit | f8ff2711258e4b30f9a984dfc27fd66cffe26b5f (patch) | |
tree | 673411519fca4794cecee3fd97668f59eee4c114 /lib/common_test/test/ct_test_support.erl | |
parent | 8c01f80cb349b202ad71e12c40efafa7f83f617a (diff) | |
parent | b7ced331aa797567c4e180eec0b59e59f7227044 (diff) | |
download | otp-f8ff2711258e4b30f9a984dfc27fd66cffe26b5f.tar.gz otp-f8ff2711258e4b30f9a984dfc27fd66cffe26b5f.tar.bz2 otp-f8ff2711258e4b30f9a984dfc27fd66cffe26b5f.zip |
Merge branch 'peppe/ct_misc_18_patches' into maint-18
* peppe/ct_misc_18_patches:
Add flag/option for disabling the character escaping functionality
Fix bug using the wrong lists search function
Fix bug with clashing timestamp values
Fix problem with stylesheet tags getting escaped
Skip pre/post test IO suite if cover or debug is running
Tweak pre_post_io test case to run without failing
Fix various log related problems
Diffstat (limited to 'lib/common_test/test/ct_test_support.erl')
-rw-r--r-- | lib/common_test/test/ct_test_support.erl | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl index 8e7ac9395c..493fa82c79 100644 --- a/lib/common_test/test/ct_test_support.erl +++ b/lib/common_test/test/ct_test_support.erl @@ -43,6 +43,8 @@ -export([random_error/1]). +-export([unique_timestamp/0]). + -include_lib("kernel/include/file.hrl"). %%%----------------------------------------------------------------- @@ -110,7 +112,8 @@ start_slave(NodeName, Config, Level) -> undefined -> []; Ds -> Ds end, - PathDirs = [PrivDir,TSDir | AddPathDirs], + TestSupDir = filename:dirname(code:which(?MODULE)), + PathDirs = [PrivDir,TSDir,TestSupDir | AddPathDirs], [true = rpc:call(CTNode, code, add_patha, [D]) || D <- PathDirs], test_server:format(Level, "Dirs added to code path (on ~w):~n", [CTNode]), @@ -1430,7 +1433,21 @@ rm_files([F | Fs]) -> end; rm_files([]) -> ok. - + +unique_timestamp() -> + unique_timestamp(os:timestamp(), 100000). + +unique_timestamp(TS, 0) -> + TS; +unique_timestamp(TS0, N) -> + case os:timestamp() of + TS0 -> + timer:sleep(1), + unique_timestamp(TS0, N-1); + TS1 -> + TS1 + end. + %%%----------------------------------------------------------------- %%% slave_stop(Node) -> |