diff options
-rwxr-xr-x | test-suite/standalone/test-guile-snarf | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test-suite/standalone/test-guile-snarf b/test-suite/standalone/test-guile-snarf index 41a9dc64a..e31479149 100755 --- a/test-suite/standalone/test-guile-snarf +++ b/test-suite/standalone/test-guile-snarf @@ -1,7 +1,23 @@ #!/bin/sh + +# Test the `guile-snarf' tool. + +# Strip the first line, like GNU `tail -n +2' does, but in a portable +# way (`tail' on Solaris 10 doesn't support `-n +2' for instance.) +strip_first_line () +{ + read line + while read line + do + echo "$line" + done +} + snarf () { - echo "$1" | guile-snarf - | tail -n +2 | tr -d ' \t\n' + # GNU cpp emits a comment on the first line, which shows what + # arguments it was passed. Strip this line. + echo "$1" | guile-snarf - | strip_first_line | tr -d ' \t\n' } snarf_test () |