#!/bin/sh

# Test that if .req file has 2 documents, with -stop-after statements,
# then both documents are correctly analysed
. ./envtest
. $srcdir/functions

T=$(basename $0)

# copy input files locally so that their path does not depend on $srcdir
cp -f $srcdir/SPEC.docx .

# build .req file

cat << EOF > $T.req

document SPEC1 -path SPEC.docx -prefix-req SPEC1_ -stop-after Annex -req PRINTF_[-a-zA-Z0-9_]*
document SPEC2 -path SPEC.docx -prefix-req SPEC2_ -stop-after Annex -req PRINTF_[-a-zA-Z0-9_]*

EOF

set -x
echo -n > $T.out
test_run $REQFLOW stat -s -c $T.req
test_run $REQFLOW trac -c $T.req

diff -w $T.out $srcdir/$T.ref
