Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
compilation:tests [2014/01/30 09:32]
gag created
compilation:tests [2016/02/18 16:15]
ltavard [Run the tests]
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
 ====== Tests ====== ====== Tests ======
 +Recently, Elmer's code-homebase has been moving to GitHub. 
 +
 +Directory with test-cases can be found under ''[ELMER_TRUNK]/elmerice/Tests''.\\
 +\\
 +For some test-cases, more tools (.SIF, grd) are available under ''[ELMER_TRUNK]/elmerice/examples''.
 +===== Run the tests =====
 +After building your installation of Elmer/Ice, you run the tests with the command line
 +<code>
 +ctest -L elmerice (run all Elmer/Ice tests)
 +ctest -L elmerice-fast (set of fast Elmer/Ice tests)
 +ctest -L elmerice-long (set of slow Elmer/Ice tests)
 +</code>
 +or to run only the tests whose names match the given regular expression
 +<code>
 +ctest -R <expression>
 +</code>
 +
 +===== Results =====
 +  * On screen
 +Run the tests will print some informations:\\
 +<code>
 +      Start  1: Teterousse3a
 + 1/36 Test  #1: Teterousse3a .....................***Passed    503.64 sec
 +      Start  2: Dating
 + 2/36 Test  #2: Dating ...........................***Passed    2.73 sec
 +</code>
 +
 +  * In directory ''build/elmerice/Testing/Temporary/''
 +We can find some files:\\
 +**''LastTest.log ''** with all the details about the tests and \\
 +**''LastTestsFailed.log''**  with the list of failed tests.
 +===== How to make cmake test-case =====
 +  * Create new directory under ''elmerice/Tests/''
 +
 +  * Define your analysis: .SIF file, mesh files, f-90 files and ELMERSOLVER_STARTINFO file
 +☛ In order to test a norm resulting from a solver <N>, add those lines at the end of .sif file
 +<code>
 +Solver 4 :: Reference Norm = real <norm>
 +Solver 4 :: Reference Norm Tolerance = Real <tol>
 +$fprintf( stderr, "TEST CASE 1\n");
 +RUN
 +$fprintf( stderr, "END TEST CASE 1: Target NRM=<norm>,EPS=<tol>\n" );
 +</code>
 +Equivalent to those lines inside the solver block to be tested
 +<code>
 +Reference Norm = real <norm>
 +Reference Norm Tolerance = Real <tol>
 +</code>
 +
 +  * Create CMakeLists.txt file in the test directory with
 +<code>
 +INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/../test_macros.cmake)
 +CONFIGURE_FILE(<sif_name>.sif <sif_name>.sif COPYONLY)
 +ADD_ELMERICETEST_MODULE(<test_name> <module_name> <module_source.f90>)
 +FILE(COPY ELMERSOLVER_STARTINFO <file1> <file2> <directory1> ...DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/")
 +ADD_ELMERICE_TEST(<test_name>)
 +ADD_ELMERICE_LABEL(<test_name> <label>)
 +</code>
 +
 +__For label__\\
 +If the test is < 10s, <label>=elmerice-fast \\
 +If the test is > 100s, <label>=slow \\
 +
 +  * Create runTest.cmake with
 +<code>
 +INCLUDE(${TEST_SOURCE}/../test_macros.cmake)
 +EXECUTE_PROCESS(COMMAND <command_name> <arg1> <arg2> ...)
 +RUN_ELMERICE_TEST()
 +</code>
 +
  
compilation/tests.txt · Last modified: 2016/11/10 16:49 by ltavard
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0