Path: blob/devel/elmerice/Tests/ElmerIceSolver_test_how-to.txt
3204 views
ElmerIce Solver test case "How-to"1==================================23This How-to describes how to create and use test cases in software4development and case definition.56The test cases are used to check for possible bugs, and to ensure7backward compatibility. For that purpose they are currently around830 repertories (Dec 2013) . The tests should be located in directory910fem/elmerice/Tests1112To run the cases in Unix you can go the the directory tests, update13script with command line:1415runTest.sh (with options or not)1617A. Options18===========19See details for the 4 options and one default option ( "", --help , --all,20--selection, --solvers).21221) --all or -a23it runs all tests with possibility to send results by e-mail.24252) --selection or -s26it runs only selection of repertory with "space-separator" with27possibility to send results by e-mail.28293) --solvers or -so30You choose one ElmerIceSolver keyword and it runs all repertories with this31solver (possibility to send results by e-mail).32334) Default case: all test cases without mail option.3435B. How to create a test36========================3738When a new feature has been verified it is often a good idea to39create a test case that ensures the feature will be40maintained also in the future versions of Elmer. To do this:41421) Create new directory in the "tests" directory under fem/elmerice. The folders43in this directory will be automatically scanned and tests run.44452) Define your analysis write your .sif file, mesh files46etc. necessary to run the test analysis ELMERSOLVER_STARTINFO4748******49! Note, for the outputs, files named "results.dat" and "result.dat.names" have to be created50! If do not exist, you can write a script to configure their creation51! see /tests/InvMeth_AdjBeta for example).52******53543) Define how to run the test write a Makefile (named Makefile), that55details two targets:56+ run: how to run the test57+ clean: how to clean up if successful58594) Define expected results and create repertory /DATA in which will be put expected60results in a file named "valid_$NameRepertory.txt" (See description in the template above:6162Step1Data1 [space] Step1Data2 [space] Step1Data3 ....63Step2Data1 [space] Step2Data2 [space] Step2Data3 ....6465Create a file named version to describe author and date of the test, Research Institute & Cluster, Elmer(/Ice) version:66Example file established:6730.01.201468Laure Tavard,LGGE69LGGE Lachouf cluster70Revision 651571725 ) If you have access right to the svn you may also7374svn add mytestcase75svn commit mytestcase7677Note, test failed in case where difference between results are upper 1E-6.78You can define your own TARGET in your *.sif with line:79$fprintf( stderr, "TARGET=<target>\n" );808182D. Results83=====================84On screen85---------86Test will print some information for each test-case:87<Test Number> <Test Name> [<Result>]88In <Result>, [FAILED] in case where difference between results are upper 1E-689[PASSED] in case where there is no difference90[PASSED - Diff Time-] where there is a difference with time CPU9192In repertory File_log/93----------------------94We will found 2 files per test if there is difference between results:95one is the resume of your simulation (OutputSIF_<name>.log) and the other the96resume of difference between results (Output_<name>).log979899E. How to use the test case as starting point100==============================================101102One can take these tests as a starting point or copy-paste103appropriate solver sections from there. These tests do not include104any ElmerGUI project file and therefore the graphical user interface105cannot be used to view these cases. You can look at the Makefile in106each test to see what sequence of command is usually needed. Typically107some simple ascii definition for the mesh is used and the running of108the case could be something like109110ElmerGrid 1 2 square111ElmerSolver mytest.sif112113114