merge changes from gramps20
svn: r5482
This commit is contained in:
3
test/.cvsignore
Normal file
3
test/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
data
|
||||
reports
|
||||
tools
|
55
test/impex.sh
Executable file
55
test/impex.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Import/export test for GRAMPS: Import example XML data and create GRDB,
|
||||
# check data for integrity, output in all formats, check resulting XML for
|
||||
# well-formedness and validate it against DTD and RelaxNG schema.
|
||||
|
||||
# $Id$
|
||||
|
||||
TOP_DIR=`dirname $PWD`
|
||||
TEST_DIR=$TOP_DIR/test
|
||||
SRC_DIR=$TOP_DIR/src
|
||||
PRG="python gramps.py"
|
||||
EXAMPLE_XML=$TOP_DIR/example/gramps/example.gramps
|
||||
|
||||
OUT_FMT="gedcom gramps-xml gramps-pkg wft geneweb"
|
||||
DATA_DIR=$TEST_DIR/data
|
||||
mkdir -p $DATA_DIR
|
||||
if [ -f $DATA_DIR/example.grdb ]; then
|
||||
rm $DATA_DIR/example.grdb
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "+--------------------------------------------------------------"
|
||||
echo "| Import XML, write GRDB"
|
||||
echo "+--------------------------------------------------------------"
|
||||
OPTS="-i $EXAMPLE_XML -o $DATA_DIR/example.grdb"
|
||||
(cd $SRC_DIR; $PRG $OPTS)
|
||||
|
||||
echo ""
|
||||
echo "+--------------------------------------------------------------"
|
||||
echo "| Check GRDB for errors"
|
||||
echo "+--------------------------------------------------------------"
|
||||
OPTS="-O $DATA_DIR/example.grdb -a tool -p name=check"
|
||||
(cd $SRC_DIR; $PRG $OPTS)
|
||||
|
||||
echo ""
|
||||
echo "+--------------------------------------------------------------"
|
||||
echo "| Open GRDB, write all other formats"
|
||||
echo "+--------------------------------------------------------------"
|
||||
OPTS="-O $DATA_DIR/example.grdb"
|
||||
for fmt in $OUT_FMT; do
|
||||
OPTS="$OPTS -o $DATA_DIR/example.$fmt -f $fmt"
|
||||
done
|
||||
(cd $SRC_DIR; $PRG $OPTS)
|
||||
|
||||
echo ""
|
||||
echo "+--------------------------------------------------------------"
|
||||
echo "| Validate produced XML"
|
||||
echo "+--------------------------------------------------------------"
|
||||
echo "* Regular well-formedness and DTD validation"
|
||||
xmllint --noout --valid $DATA_DIR/example.gramps-xml
|
||||
echo "* Post-parsing DTD validation"
|
||||
xmllint --noout --postvalid $DATA_DIR/example.gramps-xml
|
||||
echo "* Validate against RelaxNG schema"
|
||||
xmllint --noout --relaxng $TOP_DIR/doc/grampsxml.rng $DATA_DIR/example.gramps-xml
|
55
test/runtest.sh
Executable file
55
test/runtest.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Report test for GRAMPS: Generate every report in every format.
|
||||
#
|
||||
# The results of this test set depend on what options were used
|
||||
# previously with the reports, because this test set is not
|
||||
# specifying all possible options and their combinations.
|
||||
# Instead, this is a general test for all formats.
|
||||
|
||||
# $Id$
|
||||
|
||||
TOP_DIR=`dirname $PWD`
|
||||
TEST_DIR=$TOP_DIR/test
|
||||
SRC_DIR=$TOP_DIR/src
|
||||
PRG="python gramps.py"
|
||||
EXAMPLE_XML=$TOP_DIR/example/gramps/example.gramps
|
||||
|
||||
REP_DIR=$TEST_DIR/reports
|
||||
mkdir -p $REP_DIR
|
||||
|
||||
OPTS="-i $EXAMPLE_XML"
|
||||
|
||||
GRPH_FMT="sxw ps pdf svg"
|
||||
TEXT_FMT="sxw pdf kwd abw rtf txt html tex"
|
||||
|
||||
GRPH_REP="ancestor_chart2 descend_chart2 fan_chart statistics_chart timeline"
|
||||
TEXT_REP="ancestor_report ancestors_report descend_report det_ancestor_report det_descendant_report family_group"
|
||||
|
||||
# Single run with all graphical reports in all formats
|
||||
echo ""
|
||||
echo "+--------------------------------------------------------------"
|
||||
echo "| Graphical Reports: "$GRPH_REP
|
||||
echo "| Graphical Formats: "$GRPH_FMT
|
||||
echo "+--------------------------------------------------------------"
|
||||
action=
|
||||
for report in $GRPH_REP; do
|
||||
for fmt in $GRPH_FMT; do
|
||||
action="$action -a report -p name=$report,id=I44,off=$fmt,of=$REP_DIR/$report.$fmt"
|
||||
done
|
||||
done
|
||||
(cd $SRC_DIR; $PRG $OPTS $action)
|
||||
|
||||
# Single run with all textual reports in all formats
|
||||
echo ""
|
||||
echo "+--------------------------------------------------------------"
|
||||
echo "| Text Reports: "$TEXT_REP
|
||||
echo "| Text Formats: "$TEXT_FMT
|
||||
echo "+--------------------------------------------------------------"
|
||||
action=
|
||||
for report in $TEXT_REP; do
|
||||
for fmt in $TEXT_FMT; do
|
||||
action="$action -a report -p name=$report,id=I44,off=$fmt,of=$REP_DIR/$report.$fmt"
|
||||
done
|
||||
done
|
||||
(cd $SRC_DIR; $PRG $OPTS $action)
|
51
test/tools.sh
Executable file
51
test/tools.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Tool test for GRAMPS: Run tools with the default options.
|
||||
#
|
||||
# The results of this test set depend on what options were used
|
||||
# previously with the tools, because this test set is not
|
||||
# specifying all possible options and their combinations.
|
||||
# Instead, this is a general test for all tools.
|
||||
|
||||
# $Id$
|
||||
|
||||
TOP_DIR=`dirname $PWD`
|
||||
TEST_DIR=$TOP_DIR/test
|
||||
SRC_DIR=$TOP_DIR/src
|
||||
PRG="python gramps.py"
|
||||
EXAMPLE_XML=$TOP_DIR/example/gramps/example.gramps
|
||||
|
||||
TOOL_DIR=$TEST_DIR/tools
|
||||
mkdir -p $TOOL_DIR
|
||||
|
||||
OPTS="-i $EXAMPLE_XML"
|
||||
|
||||
TOOLS1="reorder_ids verify chkpoint rebuild dgenstats check"
|
||||
TOOLS2="chtype cmdref testcasegenerator"
|
||||
|
||||
# Run all tools on the example data, check at the end
|
||||
echo ""
|
||||
echo "+--------------------------------------------------------------"
|
||||
echo "| Tools: chtype cmdref $TOOLS1"
|
||||
echo "+--------------------------------------------------------------"
|
||||
action=
|
||||
action="$action -a tool -p name=chtype,fromtype=Burial,totype=WeirdType"
|
||||
action="$action -a tool -p name=cmdref,include=1,target=$TOOL_DIR/junk.xml"
|
||||
for tool in $TOOLS1; do
|
||||
action="$action -a tool -p name=$tool"
|
||||
done
|
||||
(cd $SRC_DIR; $PRG $OPTS $action)
|
||||
|
||||
# Run random test generator on an empty db, preserve the result.
|
||||
echo ""
|
||||
echo "+--------------------------------------------------------------"
|
||||
echo "| Tool: testcasegenerator"
|
||||
echo "+--------------------------------------------------------------"
|
||||
TEST_DATA=$TOOL_DIR/junk.grdb
|
||||
if [ -f $TEST_DATA ]; then
|
||||
rm $TEST_DATA
|
||||
fi
|
||||
touch $TEST_DATA
|
||||
OPTS="-O $TEST_DATA"
|
||||
action="-a tool -p name=testcasegenerator"
|
||||
(cd $SRC_DIR; $PRG $OPTS $action)
|
Reference in New Issue
Block a user