head	1.2;
access;
symbols
	last-version-before-change-to-ossp-style:1.1.1.1
	VAR_0_0_0:1.1.1.1
	VENDOR:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2001.11.13.12.08.32;	author simons;	state dead;
branches;
next	1.1;

1.1
date	2001.11.09.17.01.37;	author rse;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.11.09.17.01.37;	author rse;	state Exp;
branches;
next	;


desc
@@


1.2
log
@- Moved all routines into a single source file var.c.
- Renamed varexp.h to var.h.
- Removed odin-based build system.
- Moved test cases into var_test.c.
- Adapted build system.
@
text
@# Regression tests for libvarexp.

%test == () +cmd='sh' (%run-tests) \
                      (expand-named-characters.exe) \
                      (expand-character-class.exe) \
                      (expand1.exe) \
                      (expand2.exe) \
                      (force-expand.exe) \
                      (expand3.exe) \
                      (expand4.exe) \
                      (expand5.exe) \
                      (expand6.exe) \
                      (empty-search-pattern.exe) \
                      (offset-failure.exe) \
                      +output_show \
                      :stdout

expand-named-characters.exe == expand-named-characters.c +(%test.flags) :exe
expand-character-class.exe == expand-character-class.c +(%test.flags) :exe
expand1.exe == expand1.c +(%test.flags) :exe
expand2.exe == expand2.c +(%test.flags) :exe
force-expand.exe == force-expand.c +(%test.flags) :exe
expand3.exe == expand3.c +(%test.flags) :exe
expand4.exe == expand4.c +(%test.flags) :exe
expand5.exe == expand5.c +(%test.flags) :exe
expand6.exe == expand6.c +(%test.flags) :exe
empty-search-pattern.exe == empty-search-pattern.c +(%test.flags) :exe
offset-failure.exe == offset-failure.c +(%test.flags) :exe

%test.flags == <<
    +lib=(../libvarexp.a)
    +cc='gcc -Wall -pedantic'
    +debug

%run-tests == <<[eof]
    if [ $# -lt 1 ]; then
        echo "Usage: $0 test1.exe [...]"
        exit 1
    fi

    RESCOLUMN=50
    numTests=0
    numFails=0

    echo "Running test suite:"

    pad=''
    n=$RESCOLUMN
    while [ $n -gt 0 ]; do
        pad="$pad."
        n=`expr $n - 1`
    done
    for suite in "$@@"; do
        name=`basename "${suite}"`
        name=`expr "${name}" : '\(.*\)\.exe$'`
        echo "$name$pad" | awk '{ printf("%s ", substr($0, 0, n)); }' n=$RESCOLUMN
        export DMALLOC_OPTIONS=debug=0x4f47d03,inter=1,log=/tmp/$name.dmalloc
        numTests=`expr $numTests + 1`
        eval $suite >/dev/null 2>&1
        if [ $? -eq 0 ]; then
            echo "OK"
        else
            numFails=`expr $numFails + 1`
            echo "FAILED"
        fi
    done

    echo
    if [ $numFails -eq 0 ]; then
        echo "Summary: All tests succeeded."
        exit 0
    else
        percent=`expr $numFails \* 100`
        percent=`expr $percent / $numTests`
        echo "Summary: $numFails of $numTests tests failed ($percent%)."
        exit 1
    fi
[eof]

%clean ! == !<<
    rm -f *.exe
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@import first cut of OSSP var

@
text
@@
