Menu

[r3]: / MainTest / Build / TestCompTest  Maximize  Restore  History

Download this file

81 lines (57 with data), 1.6 kB

#!/bin/ksh -u
#!/bin/ksh -uvx
#§
#§  Compiler2 - TestCompTest
#§
#§  (C) IPN - Ingenieurbuero fuer Praezisionsnumerik
#§
#§  Dipl.-Ing. Andreas Otto
#§  Ulmenstrasse 3
#§  D-34289 Zierenberg
#§  mailto:aotto@t-online.de
#§
#§  Alle Rechte vorbehalten
#§
#§

##
## ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
##

. $STDLIB

##
## ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
##

(( $# != 0 )) && Error "usage: TestCompTest"

##
## ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
##

TEST() {

    OPT=$1
    FILE=$2
    DIR=build/CompTest.CVS

    (   
	cd $DIR
	cct -a test $OPT 2>&1 | tee $FILE
    )                           || Error "test $OPT"

    FILE=$DIR/$FILE

    print "1) test number of \"Failed\""

    typeset -i FN1=$(grep Failed $FILE | wc | cut --bytes=5-7)

    (( FN1 != 119)) && Error "not all test's processed ($FN1)"

    print "1) OK"

    print "2) test number of \"Failed\" != 0"

    typeset -i FN2=$(grep Failed $FILE | grep -v "Failed.*0" | wc | cut --bytes=6-7)

    (( FN2 != 0 )) && {
	grep Failed $FILE | grep -v "Failed.*0"
	Error "got \"Failed\""
    }

    print "2) OK"
    true
}

##
Head TestCompTest ------------------------------------------
##

Unpack  CompTest    CompTest.CVS    NO      || Error "Unpack CompTest"

[[ -d build/CompTest.CVS ]]         || Error "dir \"build/CompTest.CVS\" not available"

TEST    -n .N.out               || Error "test -n"
TEST    -t .T.out               || Error "test -t"
TEST    -c .C.out               || Error "test -c"

exit 0

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.