Testing icgrep flags -A, -B, -C
The QA/greptest.py performs combinatorial testing of icgrep with the possibility
of adding various random flags. Based on the flags added, it implements an oracle that
can check whether the produced output matches expectations.
In the program, random flags and values are chosen from the following structure:
flag_map = {'-CarryMode' : ['Compressed', 'BitBlock'],
'counting_choices' : ["-c", "-l", "-L"],
'-v' : [],
'-n' : [],
'-m' : ['2', '5'],
'-match-coordinates' : ['2', '8'],
'-DisableMatchStar' : [],
'-segment-size' : ['8192', '16384', '32768'],
'-ccc-type' : ['ternary'],
'-colors' : ['always', 'never'],
'-EnableTernaryOpt' : [],
'-maxlimit-termination-mode' : ['report', 'terminate', 'zero']}
However, this does not currently implement any tests involving the -A, -B, -C flags.
These flags are used to print additional context lines either after (A), before (B) or
surrounding (C) each group of consecutive matched lines.
Note that the grepcase data in the test data file such as greptest.xml often
includes greplines attributes that list the individual lines that match. Using this
information it should be possible to implement an oracle that confirms correct output for
randomly added context line flags.