>From 309fd6398558b6e85ae2b2fa1cee6b5e2f492dde Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Mon, 1 Apr 2013 17:44:27 -0400 Subject: [PATCH] tests: document more test keys in unit test module * tests/Coreutils.pm: document IN/IN_PIPE/CMP/PRE/POST keys. --- tests/Coreutils.pm | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/tests/Coreutils.pm b/tests/Coreutils.pm index 71b1516..661fce4 100644 --- a/tests/Coreutils.pm +++ b/tests/Coreutils.pm @@ -54,8 +54,12 @@ 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, IN_PIPE, OUT, ERR, AUX, CMP, +# EXIT, PRE, POST # - the value must be a file spec +# {IN => 'data'} Create file containing 'data'. The filename will be +# appended as the last parameter on the command-line. +# {IN_PIPE => 'data'} Send 'data' as input from stdin. # {OUT => 'data'} put data in a temp file and compare it to stdout from cmd # {OUT => {'filename'=>undef}} compare contents of existing filename to # stdout from cmd @@ -82,6 +86,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