- added a test in create-testsuite that checks whether all testcases needed for

the testsuite are really submitted to the SVN repository
- fixed documentation of testsuite in README
This commit is contained in:
Kaspar Fischer 2006-02-20 14:25:48 +00:00
parent 1b666993c1
commit 1033cbada1
2 changed files with 77 additions and 44 deletions

View File

@ -1,62 +1,75 @@
OVERVIEW OVERVIEW
This file explains the structure of the testsuite directory of package This file explains the structure of the testsuite directory of package
QP_engine. QP_solver.
THE CGAL TESTSUITE PROCESS THE CGAL TESTSUITE PROCESS
The CGAL testsuite calls the QP_engine testsuite via The CGAL testsuite calls the QP_solver testsuite via
./test_suite_QPE_solver < test_suite_QPE_solver.cin ./test_suite_QPE_solver < test_suite_QPE_solver.cin
./test_solver < test_solver.cin
The latter file contains the filenames of individual test cases to be The latter files contain the filenames of individual test cases to be solved
solved (so test_suite_QPE_solver.cin does NOT contain the test data (so test_suite_QPE_solver.cin and test_solver.cin do NOT contain the test data
itself). The executable ./test_suite_QPE_solver reads these filenames itself). The executables ./test_suite_QPE_solver and ./test_solver read these
(and some further options that specifying what pricing strategy filenames (and some further options specifying what pricing strategy etc. is
etc. is to be used for each test case) and processes them one after to be used for each test case) and processes them one after the other. All
the other. All these test data files are contained in the directory these test data files are contained in the directory data/ and end in
data/ and end in ".data_f", ".data_i", or ".data_r". ".data_f", ".data_i", or ".data_r" in case of ./test_suite_QPE_solver, and in
the directory testsuite-data/ and end in ".mps" in case of ./test_solver,
respectively.
WHERE THE .data_* FILES COME FROM WHERE THE .data_* AND .mps FILES COME FROM
The above .data_* files could be written by hand, but we generate them The above .data_* and .mps files could be written by hand, but we generate
from Maple worksheets. (This makes it easier to play around with the them from Maple worksheets. (This makes it easier to play around with the
data and to verify results in Maple if need be.) Thus, every .data_* data and to verify results in Maple if need be.) Thus, every .data_* file is
file is in fact produced by some Maple worksheet and all these Maple in fact produced by some Maple worksheet and all these Maple worksheets are
worksheets are stored in the directory Maple/data/ and end in ".mema". stored in the directory Maple/data/ and end in ".mema". (For most .mps files,
If you open one of these mema-files, you can see that this is a simple this is also true, but the directories
ASCII file consisting of Maple commands. Executing a mema-file via
testsuite-data/additional-for-cgal
testsuite-data/additional-not-for-cgal
contain additional .mps files that are NOT generated from mema's.) If you
open one of these mema-files, you can see that this is a simple ASCII file
consisting of Maple commands. Executing a mema-file via
maple mema-file-name maple mema-file-name
creates the corresponding .data_* files in the data/ directory. creates the corresponding .data_* and .mps files in the data/ directory.
Notice that every .data_* file has a corresponding mema-file and that Notice that every .data_* file has a corresponding mema-file and that some
some mema-files produce multiple .data_* files. mema-files produce multiple .data_* files. (The same holds for all .mps files
except the ones in the above "additional-..." directories.)
THE CGAL TESTSUITE AND THE COMPLETE TESTSUITE THE CGAL TESTSUITE AND THE COMPLETE TESTSUITE
In order to create the .data_* files from the mema-files, you can use In order to create the .data_* and .mps files from the mema-files, you can use
the script ./create-testsuite which you either invoke as the script ./create-testsuite which you either invoke as
./create-testsuite CGAL ./create-testsuite CGAL <verbosity (i.e., 0, 1, 2, 3, 4, or 5)>
or as or as
./create-testsuite all ./create-testsuite all <verbosity (i.e., 0, 1, 2, 3, 4, or 5)>
We make this distinction because we have a very large testsuite and do We make this distinction because we have a very large testsuite and do not
not want to put all tests contained in it into the CGAL testsuite (it want to put all tests contained in it into the CGAL testsuite (it would take
would take hours to run this testsuite). Thus, the former of the hours to run this testsuite). Thus, the former of the above commands only
above commands only converts a small subset of all the mema-files to converts a small subset of all the mema-files to .data_* files and produces
.data_* files and produces the file test_suide_QPE_solver.cin (see the files test_suide_QPE_solver.cin and test_solver.cin (see above) with the
above) with the corresponding commands to execute these tests. corresponding commands to execute these tests. (In case of test_solver.cin,
the files from testsuite-data/additional-for-cgal are always included, and, in
addition if ./create-testsuite is called with argument "all", also the files
from testsuite-data/additional-not-for-cgal are included.)
If you wand that the command "./test_suite_QPE_solver < If you want that the commands "./test_solver < test_solver.cin" and
test_suite_QPE_solver.cin" executes all tests contained in our "./test_suite_QPE_solver < test_suite_QPE_solver.cin" execute ALL tests
testsuite then you need to do a "./create-testsuite all". contained in our testsuite then you need to do a "./create-testsuite all".
How does the ./create-testsuite script know which test case is part of How does the ./create-testsuite script know which test case is part of
the CGAL testsuite (i.e., which test case to convert if you pass the CGAL testsuite (i.e., which test case to convert if you pass
@ -65,24 +78,20 @@ there is a command
is_part_of_CGAL_testsuite:= true is_part_of_CGAL_testsuite:= true
in it, it considers the test as part of the CGAL testsuite. Observe in it, it considers the test as part of the CGAL testsuite. Observe here that
here that all .data_* files originating from such mema-files NEED TO all .data_* files originating from such mema-files NEED TO BE PRESENT IN THE
BE PRESENT IN THE REPOSITORY (the script ./create-testsuite will warn REPOSITORY (the script ./create-testsuite will warn you if such a file is
you if such a file is missing in the repository). missing in the repository).
VIEWING mema-FILES IN MAPLE VIEWING mema-FILES IN MAPLE
If you want to play around with a specific mema-file in Maple then you If you want to play around with a specific mema-file in Maple then you
can use the script Maple/data2mw which converts a mema-file to a can use the script Maple/data2mw which converts a mema-file to a
"pretty" Maple worksheet. For instance, do a "pretty" Maple worksheet. Call the script
g++ data2mw.C -o data2mw
./data2mw data/QP_Bounded_QPE_solver.mema QP_Bounded_QPE_solver.mw
in the Maple/ directory. Even simpler, call the script
./generate-worksheets ./generate-worksheets
which converts all mema-files in Maple/data/ to nicely formatted Maple which converts all mema-files in Maple/data/ to nicely formatted Maple
worksheets (which you can then find in Maple/). worksheets (which you can then find in Maple/). (Internally,
./generate-worksheets uses the program data2mw.C to do the conversion.)

View File

@ -86,6 +86,7 @@ function createTestsuite()
bailout "Internal error." bailout "Internal error."
fi fi
LIST="" LIST=""
MISSINGFILES=""
for file in $TESTFILES for file in $TESTFILES
do do
tmp=`basename "$file"` tmp=`basename "$file"`
@ -102,6 +103,12 @@ function createTestsuite()
LIST="${LIST} $level fe $f" LIST="${LIST} $level fe $f"
fi fi
tmp=`basename "$f"` tmp=`basename "$f"`
#echo "grep -q \"\\\"$tmp\\\"\" \"$dataDir/.svn/entries\""
if grep -q "name=\\\"$tmp\\\"" "$dataDir/.svn/entries"; then
echo -n "";
else
MISSINGFILES="$f $MISSINGFILES"
fi
done done
done done
if [ $oldFormat == "false" ]; then if [ $oldFormat == "false" ]; then
@ -129,7 +136,24 @@ function createTestsuite()
fi fi
fi fi
echo $LIST > ${dataFile} echo $LIST > ${dataFile}
}
# check that all $dataDir/*.data_* files that are part of the CGAL
# testsuite indeed exist in the SVN repository:
if [ "x$MISSINGFILES" != "x" ]; then
if [ "x$cgalOrNot" == "xCGAL" ]; then
echo ""
echo "WARNING: Some files in $dataDir/ that are part of the CGAL"
echo "testsuite do not exist in the repository. This means that if"
echo "you commit test_suite_QP_solver.cin or test_solver.cin, the"
echo "testsuite will not succeed because files will be missing."
echo "Please check them in. Here is the list of these files:"
echo ""
echo $MISSINGFILES
echo ""
warnUser=1
fi
fi
}
# check arguments # check arguments
if [ "x$1" == "xCGAL" ]; then if [ "x$1" == "xCGAL" ]; then