>From 229c94ebc0c4955a418f6e7348488d9ca28dc593 Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Mon, 1 Apr 2013 17:44:27 -0400 Subject: [PATCH] tests: document CMP/PRE/POST in unit test module *tests/Coreutils.pm: document CMP/PRE/POST keys. --- tests/Coreutils.pm | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/tests/Coreutils.pm b/tests/Coreutils.pm index 71b1516..fd4408a 100644 --- a/tests/Coreutils.pm +++ b/tests/Coreutils.pm @@ -54,7 +54,7 @@ defined $ENV{DJDIR} # I/O spec: a hash ref with the following properties # ================ # - one key/value pair -# - the key must be one of these strings: IN, OUT, ERR, AUX, CMP, EXIT +# - the key must be one of these strings: IN, OUT, ERR, AUX, CMP, EXIT, PRE,POST # - the value must be a file spec # {OUT => 'data'} put data in a temp file and compare it to stdout from cmd # {OUT => {'filename'=>undef}} compare contents of existing filename to @@ -82,6 +82,12 @@ defined $ENV{DJDIR} # {ENV_DEL => 'VAR'} # Remove VAR from the environment just before running the corresponding # command, and restore any value just afterwards. +# {CMP => [ 'data',{'filename'=>undef}} Compare the content of 'filename' +# to 'data' (a string scalar). The program under test is expected to create +# file 'filename'. +# {PRE => sub{} } Execute sub() before running the test. +# {POST => sub{} } Execute sub() after running the test. +# If the PRE/POST sub calls "die", the test will be marked as failed. # # There may be many input file specs. File names from the input specs # are concatenated in order on the command line. -- 1.7.7.4