From d7101fd2c2ce8bf609670043585c57010a3707c6 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 14 Mar 2017 11:18:46 +0100 Subject: [ct] Add 'keep_logs' option If setting the value for this option to an integer, N, common_test will remove all ct_run.* directories in the current log directory, except the N newest. The default value for the 'keep_logs' option is 'all', which means that no logs will be deleted. 'keep_logs' can be used in combination with refresh_logs, or in a normal common_test test run. --- lib/common_test/doc/src/ct.xml | 3 ++- lib/common_test/doc/src/ct_run.xml | 8 ++++++-- lib/common_test/doc/src/run_test_chapter.xml | 12 ++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) (limited to 'lib/common_test/doc/src') diff --git a/lib/common_test/doc/src/ct.xml b/lib/common_test/doc/src/ct.xml index ea9f956271..cd1e51a9a9 100644 --- a/lib/common_test/doc/src/ct.xml +++ b/lib/common_test/doc/src/ct.xml @@ -1190,7 +1190,7 @@ Opts. Opts = [OptTuples] - OptTuples = {dir, TestDirs} | {suite, Suites} | {group, Groups} | {testcase, Cases} | {spec, TestSpecs} | {join_specs, Bool} | {label, Label} | {config, CfgFiles} | {userconfig, UserConfig} | {allow_user_terms, Bool} | {logdir, LogDir} | {silent_connections, Conns} | {stylesheet, CSSFile} | {cover, CoverSpecFile} | {cover_stop, Bool} | {step, StepOpts} | {event_handler, EventHandlers} | {include, InclDirs} | {auto_compile, Bool} | {abort_if_missing_suites, Bool} | {create_priv_dir, CreatePrivDir} | {multiply_timetraps, M} | {scale_timetraps, Bool} | {repeat, N} | {duration, DurTime} | {until, StopTime} | {force_stop, ForceStop} | {decrypt, DecryptKeyOrFile} | {refresh_logs, LogDir} | {logopts, LogOpts} | {verbosity, VLevels} | {basic_html, Bool} | {esc_chars, Bool} | {ct_hooks, CTHs} | {enable_builtin_hooks, Bool} | {release_shell, Bool} + OptTuples = {dir, TestDirs} | {suite, Suites} | {group, Groups} | {testcase, Cases} | {spec, TestSpecs} | {join_specs, Bool} | {label, Label} | {config, CfgFiles} | {userconfig, UserConfig} | {allow_user_terms, Bool} | {logdir, LogDir} | {silent_connections, Conns} | {stylesheet, CSSFile} | {cover, CoverSpecFile} | {cover_stop, Bool} | {step, StepOpts} | {event_handler, EventHandlers} | {include, InclDirs} | {auto_compile, Bool} | {abort_if_missing_suites, Bool} | {create_priv_dir, CreatePrivDir} | {multiply_timetraps, M} | {scale_timetraps, Bool} | {repeat, N} | {duration, DurTime} | {until, StopTime} | {force_stop, ForceStop} | {decrypt, DecryptKeyOrFile} | {refresh_logs, LogDir} | {logopts, LogOpts} | {verbosity, VLevels} | {basic_html, Bool} | {esc_chars, Bool} | {keep_logs,KeepSpec} | {ct_hooks, CTHs} | {enable_builtin_hooks, Bool} | {release_shell, Bool} TestDirs = [string()] | string() Suites = [string()] | [atom()] | string() | atom() Cases = [atom()] | atom() @@ -1226,6 +1226,7 @@ VLevels = VLevel | [{Category, VLevel}] VLevel = integer() Category = atom() + KeepSpec = all | pos_integer() CTHs = [CTHModule | {CTHModule, CTHInitArgs}] CTHModule = atom() CTHInitArgs = term() diff --git a/lib/common_test/doc/src/ct_run.xml b/lib/common_test/doc/src/ct_run.xml index 9e6229f1dd..af30550719 100644 --- a/lib/common_test/doc/src/ct_run.xml +++ b/lib/common_test/doc/src/ct_run.xml @@ -125,6 +125,7 @@ [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]] [-basic_html] [-no_esc_chars] + [-keep_logs all | NLogs] [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and .. CTHModuleN CTHOptsN] [-exit_status ignore_config] @@ -164,6 +165,7 @@ [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]] [-basic_html] [-no_esc_chars] + [-keep_logs all | NLogs] [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and .. CTHModuleN CTHOptsN] [-exit_status ignore_config] @@ -189,13 +191,15 @@ [-scale_timetraps] [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc] [-basic_html] - [-no_esc_chars] + [-no_esc_chars] + [-keep_logs all | NLogs]
Refresh HTML Index Files
- ct_run -refresh_logs [-logdir LogDir] [-basic_html]
+ ct_run -refresh_logs [-logdir LogDir] [-basic_html] + [-keep_logs all | NLogs]
diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index 76e306c4ed..aea4d05867 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -1353,6 +1353,18 @@ only works when Common Test is running. Printouts with ct:pal/2 are however always displayed on screen.

+ +
+ + Delete Old Logs +

Common Test can automatically delete old log. This + is specified with the keep_logs option. The default + value for this option is all, which means that no + logs are deleted. If the value is set to an + integer, N, Common Test deletes + all ct_run.<timestamp> directories, except + the N newest.

+
-- cgit v1.2.3