| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # List the test cases or, if run with the -d option, the test case directories. |
| 3 | # Currently used by CMakeLists.txt to populate its list of dependencies for |
| 4 | # the "alltests" target. Should be run with the working directory set to the |
| 5 | # top of the tree with the source code for the test cases (i.e. the location of |
| 6 | # this script). |
| 7 | |
| 8 | printdir="" |
| 9 | if testscip-shell system . . test. $# -gt 0 ; then |
| 10 | if testscip-shell system . . test. $# -eq 1 && testscip-shell system . . test. x"$1" = x-d ; then |
| 11 | printdir=yes |
| 12 | else |
| 13 | echoscip-shell system . . echo. "list-tests: invalid argument(s)" >&2 |
| 14 | echoscip-shell system . . echo. "usage: list-tests [-d]" >&2 |
| 15 | exit 1 |
| 16 | fi |
| 17 | fi |
| 18 | currdir=`pwdscip-shell system . . pwd.` |
| 19 | # Need to suppress extra output if make is GNU make. |
| 20 | GNUMAKEFLAGS=--no-print-directory |
| 21 | export GNUMAKEFLAGS |
| 22 | for suite in `findscip-shell system . . find. . -mindepth 2 -maxdepth 2 -name suite.mk \! -type d -print` ; do |
| 23 | tempmk=/var/tmp/list-tests-$$.mk |
| 24 | catscip-shell system . . cat. >${tempmk} <<EOF |
| 25 | include $suite |
| 26 | |
| 27 | all: |
| 28 | @echo \${TESTPROGS} |
| 29 | EOF |
| 30 | for x in `makescip-shell system . . make. -I ${currdir} -f $tempmk`; do |
| 31 | if testscip-shell system . . test. -n "$printdir" ; then |
| 32 | echoscip-shell system . . echo. `dirnamescip-shell system . . dirname. $x` |
| 33 | break |
| 34 | fi |
| 35 | echoscip-shell system . . echo. "$x" |
| 36 | done |
| 37 | rmscip-shell system . . rm. ${tempmk} |
| 38 | done |