| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | ############################################################################## |
| 4 | # small wrapper script to run the STAR/CIF syntax test suite # |
| 5 | ############################################################################## |
| 6 | |
| 7 | CLEAR="tput clear" # command to clear screen |
| 8 | |
| 9 | for F in ciftest[0-9] ciftest[0-9][0-9] |
| 10 | do |
| 11 | ${CLEAR} |
| 12 | echoscip-shell system . . echo. "==============================================================" |
| 13 | # Diplay purpose (with trick for empty file) |
| 14 | echoscip-shell system . . echo. $F |
| 15 | if grepscip-shell system . . grep. "# Purpose" $F |
| 16 | then |
| 17 | truescip-shell system . . true. |
| 18 | else |
| 19 | if [scip-shell system . . `[`. -s $F ] |
| 20 | then |
| 21 | truescip-shell system . . true. |
| 22 | else |
| 23 | echoscip-shell system . . echo. "# Purpose: null file" |
| 24 | fi |
| 25 | fi |
| 26 | |
| 27 | # Test with vcif |
| 28 | echoscip-shell system . . echo. |
| 29 | echoscip-shell system . . echo. "--------------------------------------------------------------" |
| 30 | echoscip-shell system . . echo. "Testing against CIF syntax" |
| 31 | echoscip-shell system . . echo. |
| 32 | |
| 33 | vcif $F > $F.result |
| 34 | if [scip-shell system . . `[`. -s $F.result ] |
| 35 | then |
| 36 | catscip-shell system . . cat. $F.result |
| 37 | else |
| 38 | if [scip-shell system . . `[`. -f $F.result ]; then echoscip-shell system . . echo. "(Valid)"; fi |
| 39 | fi |
| 40 | |
| 41 | # Compare against canonical vcif run |
| 42 | if [scip-shell system . . `[`. -f $F.result -a -f $F.result.canon ] |
| 43 | then |
| 44 | if cmpscip-shell system . . cmp. $F.result $F.result.canon > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 45 | then |
| 46 | truescip-shell system . . true. # got the expected result |
| 47 | else |
| 48 | echoscip-shell system . . echo. "" |
| 49 | echoscip-shell system . . echo. "--------------------------------------------------------------" |
| 50 | echoscip-shell system . . echo. "WARNING!! This is different from the canonical result!" |
| 51 | echoscip-shell system . . echo. "Check your version of vcif" |
| 52 | fi |
| 53 | fi |
| 54 | |
| 55 | echoscip-shell system . . echo. "==============================================================" |
| 56 | echoscip-shell system . . echo. |
| 57 | echoscip-shell system . . echo. "Press ENTER for next test" |
| 58 | read foo |
| 59 | done |
| 60 | |
| 61 | echoscip-shell system . . echo. "End of suite" |
| 62 | exit |