#!/bin/sh -e
# You can consider this file as being in the public domain.
#
# Run the tests against an existing GNU_BUILD

# Run a build first
make -C ../BUILD/zipios

# Go in the tests directory
if test -z "$1"
then
    make -C ../BUILD/zipios run_zipios_tests
elif test "$1" = "-o"
then
    # run tests one at a time
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: BackBuffer read a file"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: CollectionCollection with various tests"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: Vector append"
    ../BUILD/zipios/tests/zipios_tests -d yes "Verify the g_separator"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: Read from file"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: Read from buffer"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: Write to file"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: DirectoryCollection with invalid paths"
    ../BUILD/zipios/tests/zipios_tests -d yes "DirectoryCollection with a valid file, but not a directory"
    ../BUILD/zipios/tests/zipios_tests -d yes "DirectoryCollection with valid trees of files"
    ../BUILD/zipios/tests/zipios_tests -d yes "DirectoryCollection with an existing directory that gets deleted"
    ../BUILD/zipios/tests/zipios_tests -d yes "DirectoryCollection with an empty directory"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: DirectoryEntry with invalid paths"
    ../BUILD/zipios/tests/zipios_tests -d yes "DirectoryEntry with one valid file"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: DirectoryEntry for a valid directory"
    ../BUILD/zipios/tests/zipios_tests -d yes "DOS Date & Time Min/Max"
    ../BUILD/zipios/tests/zipios_tests -d yes "Invalid DOS Date & Time"
    ../BUILD/zipios/tests/zipios_tests -d yes "Small DOS Date & Time"
    ../BUILD/zipios/tests/zipios_tests -d yes "Large DOS Date & Time"
    ../BUILD/zipios/tests/zipios_tests -d yes "Random DOS Date & Time"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: FilePath that does not represent a file on disk"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: FilePath against existing files on disk"
    ../BUILD/zipios/tests/zipios_tests -d yes "Test with regular files of various sizes"
    ../BUILD/zipios/tests/zipios_tests -d yes "An input filter"
    ../BUILD/zipios/tests/zipios_tests -d yes "An output filter"
    ../BUILD/zipios/tests/zipios_tests -d yes "VirtualSeeker tests"
    ../BUILD/zipios/tests/zipios_tests -d yes "An Empty ZipFile"
    ../BUILD/zipios/tests/zipios_tests -d yes "A ZipFile with an invalid name"
    ../BUILD/zipios/tests/zipios_tests -d yes "A ZipFile with an invalid file"
    ../BUILD/zipios/tests/zipios_tests -d yes "An empty ZipFile"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: ZipFile with a valid zip archive"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: use Zipios to create a zip archive"
    ../BUILD/zipios/tests/zipios_tests -d yes "Scenario: use Zipios to create zip archives with 1 or 3 files each"
    ../BUILD/zipios/tests/zipios_tests -d yes "Simple Valid and Invalid ZipFile Archives"
    ../BUILD/zipios/tests/zipios_tests -d yes "Valid and Invalid ZipFile Archives"
else
    if test "$1" = "--seed"
    then
        shift
        seed="--seed $1"
        shift
    fi
    echo "../BUILD/zipios/tests/zipios_tests $*"
    ../BUILD/zipios/tests/zipios_tests $seed "$*"
fi

# vim: ts=4 sw=4 et
