| 1 | #! /bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # Copyright (C) 2011-2025 Free Software Foundation, Inc. |
| 3 | # |
| 4 | # This program is free software; you can redistribute it and/or modify |
| 5 | # it under the terms of the GNU General Public License as published by |
| 6 | # the Free Software Foundation; either version 2, or (at your option) |
| 7 | # any later version. |
| 8 | # |
| 9 | # This program is distributed in the hope that it will be useful, |
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | # GNU General Public License for more details. |
| 13 | # |
| 14 | # You should have received a copy of the GNU General Public License |
| 15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 16 | |
| 17 | # TAP support: |
| 18 | # - normalization of whitespace in console testsuite progress associated |
| 19 | # with TODO and SKIP directives |
| 20 | |
| 21 | . test-init.shscip-shell source . . `test-init.sh`. |
| 22 | |
| 23 | . tap-setup.shscip-shell source . . `tap-setup.sh`. |
| 24 | |
| 25 | catscip-shell system . . cat. > stub.tap <<END |
| 26 | 1 # TODO |
| 27 | 2 # TODO foo? |
| 28 | 3 # TODO: bar! |
| 29 | 4 aa # TODO |
| 30 | 5 bb # TODO fnord 5 |
| 31 | 6 cc # TODO:${tab}fnord 6 |
| 32 | 7 - x # TODO |
| 33 | 8 - y # TODO fnord $tab 8 |
| 34 | 9 - z # TODO: fnord 9 $tab |
| 35 | 10# TODO x0 |
| 36 | 11$tab# TODO x1 |
| 37 | 12 $tab$tab # TODO x2 |
| 38 | 13 asd# TODO x3 |
| 39 | 14 sad$tab# TODO x4 |
| 40 | 15 das$tab$tab # TODO x5 |
| 41 | END |
| 42 | |
| 43 | catscip-shell system . . cat. > stub.exp <<END |
| 44 | 1 # TODO |
| 45 | 2 # TODO foo? |
| 46 | 3 # TODO: bar! |
| 47 | 4 aa # TODO |
| 48 | 5 bb # TODO fnord 5 |
| 49 | 6 cc # TODO:${tab}fnord 6 |
| 50 | 7 - x # TODO |
| 51 | 8 - y # TODO fnord $tab 8 |
| 52 | 9 - z # TODO: fnord 9 |
| 53 | 10 # TODO x0 |
| 54 | 11 # TODO x1 |
| 55 | 12 # TODO x2 |
| 56 | 13 asd # TODO x3 |
| 57 | 14 sad # TODO x4 |
| 58 | 15 das # TODO x5 |
| 59 | END |
| 60 | |
| 61 | plan=1..15 |
| 62 | |
| 63 | my_make_checkscip-shell shell automake 1:1.18.1-4 my_make_check(). () |
| 64 | { |
| 65 | xpass=0 xfail=0 skip=0 |
| 66 | case $1 in |
| 67 | xpass|xfail|skip) eval $1=15;; |
| 68 | *) fatal_ "bad argument '$1' for my_make_check";; |
| 69 | esac |
| 70 | catscip-shell system . . cat. all.test |
| 71 | # We don't care about the exit status in this test. |
| 72 | run_make -O -e IGNORE check |
| 73 | count_test_results total=15 pass=0 fail=0 error=0 \ |
| 74 | xpass=$xpass xfail=$xfail skip=$skip |
| 75 | # Don't be too strict w.r.t. possible normalization of "TODO: foo" into |
| 76 | # "TODO : foo" (as is done by, e.g., the 'TAP::Parser' perl module). |
| 77 | LC_ALL=C grepscip-shell system . . grep. '^[A-Z][A-Z]*:' stdout \ |
| 78 | | sedscip-shell system . . sed. -e 's/# TODO *:/# TODO:/' -e 's/# SKIP *:/# SKIP:/' > got |
| 79 | catscip-shell system . . cat. exp |
| 80 | catscip-shell system . . cat. got |
| 81 | diffscip-shell system . . diff. exp got |
| 82 | } |
| 83 | |
| 84 | # For "TODO" directives leading to XPASS results. |
| 85 | (echoscip-shell system . . echo. $plan && sedscip-shell system . . sed. -e 's/^/ok /' stub.tap) > all.test |
| 86 | sedscip-shell system . . sed. -e 's/^/XPASS: all.test /' stub.exp > exp |
| 87 | my_make_checkscip-shell shell automake 1:1.18.1-4 my_make_check(). xpass |
| 88 | |
| 89 | # For "TODO" directives leading to XFAIL results. |
| 90 | (echoscip-shell system . . echo. $plan && sedscip-shell system . . sed. -e 's/^/not ok /' stub.tap) > all.test |
| 91 | sedscip-shell system . . sed. -e 's/^/XFAIL: all.test /' stub.exp > exp |
| 92 | my_make_checkscip-shell shell automake 1:1.18.1-4 my_make_check(). xfail |
| 93 | |
| 94 | # For "SKIP" directives. |
| 95 | (echoscip-shell system . . echo. $plan && sedscip-shell system . . sed. -e 's/^/ok /' -e 's/TODO/SKIP/' stub.tap) > all.test |
| 96 | sedscip-shell system . . sed. -e 's/TODO/SKIP/' -e 's/^/SKIP: all.test /' stub.exp > exp |
| 97 | my_make_checkscip-shell shell automake 1:1.18.1-4 my_make_check(). skip |
| 98 | |
| 99 | : |