aboutsummaryrefslogtreecommitdiffstats
path: root/testcases
Commit message (Collapse)AuthorAgeFilesLines
* Implement -E option and <safearg.h> header.Kaz Kylheku2022-07-171-0/+33
| | | | | | | | | | | | | | | The -E option is not passed through to the Awk implementation any more, which is not particularly useful, because the option resembles -f, and its argument requires likewise handling. We achieve the semantics that -E <name> is equivalent to -f <name> --. From the GNU Awk user's perspective, this is a regression in the semantics of -E which also has the effect of suppressing the processing of arguments which look like variable assignments. To make up for that, we provide the <safearg.h> header which suppresses all implicit treatment of the remaining arguments.
* testcases: add missing ! to end here-document.Paul A. Patience2022-07-031-0/+1
|
* Pass -std=c99 to cpp to remove crap like #define linux.Kaz Kylheku2022-03-241-1/+6
|
* New --dump-macros option.Kaz Kylheku2022-03-241-0/+5
|
* Run all test cases with and without --nobash option.Kaz Kylheku2022-03-241-45/+46
|
* If Bash is available, use process substitution.Kaz Kylheku2022-03-241-3/+5
|
* __FILE__ in main program resolves to original name.Kaz Kylheku2022-03-241-0/+5
|
* don't delete hash-bang line; replace with #Kaz Kylheku2022-03-241-0/+9
| | | | This preserves the line numbers.
* bugfix: collapse: don't eat blank lines.Kaz Kylheku2022-03-241-0/+13
|
* test case for --prepro-only with -f.Kaz Kylheku2022-03-241-0/+5
|
* bugfix: execing awk causes temp files to persist.Kaz Kylheku2022-03-241-0/+5
|
* get rid of <stdver.h> header.Kaz Kylheku2022-03-231-5/+2
| | | | cppawk internally defines __cppawk_ver now.
* move mocks into testdir.Kaz Kylheku2022-03-231-2/+2
|
* hygiene: shell escape $awk and $prepro.Kaz Kylheku2022-03-231-3/+3
| | | | | | | | Since $awk and $prepro are now controlled via command line options, and are being fed to eval, we should shell escape them. Two of our test cases rely on the loose interpolation behavior; we fix those using proper external mock programs testawk and testcpp.
* hygiene: what if $awk matches name of function?Kaz Kylheku2022-03-231-0/+5
| | | | | | | | We use the "command" command to make sure we are running an external awk and preprocessor. For instance if someone were to try "cppawk --awk=quote", that would be targetting the quote function inside cppawk and not that users Awk program that happens to be called "quote".
* Add options --prepro and --awk.Kaz Kylheku2022-03-231-0/+20
|
* bugfix: missing space breaks --prepro-only.Kaz Kylheku2022-03-221-0/+8
| | | | | Fix issue with interpolation of $prepro_opts in the case when the awk program is in the command line.
* Handle situations when cpp breaks a line into pieces.Kaz Kylheku2022-03-191-0/+9
| | | | | | | | | | | | | | | | | | | There are situations in which GNU cpp breaks a single line of input into multiple lines. These are indicated by linemarkers that repeat the current line number, for instance: # 3 "file" this # 3 "file" is # 3 "file" all line three line four line five We now remove these repeat linemarkers and collapse the indicated lines back into one line, also eliminating the leading whitespace that tries to preserve the column.
* Add cppawk-include directory and <stdver.h> header.Kaz Kylheku2022-03-181-0/+8
|
* Simplify and revise quoting.Kaz Kylheku2022-03-181-2/+19
|
* Fix broken options quoting system.Kaz Kylheku2022-03-181-0/+10
| | | | | | Unquoting can't just be done with an interpolation into the command line; we have to construct an entire command as shell syntax and eval the whole thing.
* Test -f option.Kaz Kylheku2022-03-181-0/+5
| | | | | | | | | Bugfix: because the preprocessed version of the file is in a temporary directory, #include "..." looks for files in that directory. We must tell the preprocessor to look for include files in the original directory. In the case when the awk script comes from the command line, we already took care of this by pointing the preprocessor to $(pwd).
* Handle quoting properly.Kaz Kylheku2022-03-181-0/+5
| | | | | | | | The problem is that if $var holds escaped syntax, we cannot just use it as command $var; the quotes become part of the argument. We must get the shell to process the quoted syntax, which requires eval. For this we define a function which lets us do command $(syntax "$var").
* Add --prepro-only option.Kaz Kylheku2022-03-181-0/+5
|
* Define __posix__ if -P or --posix option used.Kaz Kylheku2022-03-181-0/+9
|
* Define __bignum__ if -M or --bignum option used.Kaz Kylheku2022-03-181-0/+9
|
* Add __gawk__ predefined preprocessor symbol.Kaz Kylheku2022-03-181-0/+10
|
* Fix missing: pass -I to preprocessor.Kaz Kylheku2022-03-181-0/+14
|
* Basic preprocessor test.Kaz Kylheku2022-03-181-0/+12
|
* More invocation error test cases.Kaz Kylheku2022-03-181-0/+45
|
* Check that -f without argument fails.Kaz Kylheku2022-03-181-0/+5
|
* Allow gawk -M option.Kaz Kylheku2022-03-181-0/+4
|
* Start test case implementation.Kaz Kylheku2022-03-181-0/+5