Private test suites in Elmer

Discussion about building and installing Elmer
Post Reply
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Private test suites in Elmer

Post by raback »

Hi All,

Elmer now has an improved possibility to have private test suites. This is something that could be of interest for people doing development themselves or using Elmer in their production runs. Own tests are the best guarantee that nothing gets broken on the way. The perquisite is that you should be compiling your own version of Elmer to have the testing environment working in the first place.

The private tests suites are made possible by an improvement to on scripts of our ctest system. The possibility to include subdirectories under the "tests" directory of Elmer has now been added.

To illustrate the needed changes compared to the current system look at the CMakeLists.txt example below (modified version of the fluxsolver test
case):

INCLUDE(${CMAKE_SOURCE_DIR}/fem/tests/test_macros.cmake)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/fem/src)
CONFIGURE_FILE(flux.sif flux.sif COPYONLY) file(COPY ELMERSOLVER_STARTINFO angle.grd DESTINATION
"${CMAKE_CURRENT_BINARY_DIR}/")
ADD_ELMER_TEST(mytest1)
ADD_ELMER_LABEL(mytest1 mytests)

The first include is given now as an absolute path which makes it possible to move the test case without modifications between the tests directory and any subdirectory of it.

As already before the user may give a name to the test (here "mytest1") and label (here "mytests").

A handy way to use this new feature is to set symbolic links under the tests directory, for example

~/Source/elmerfem/fem/tests $ ln -s ~/ElmerWrk/MyTestSuite/ .

Now this allows after "make install" to run your own test cases, e.g.

elmeruser@elmeruser-VM64bit ~/Source/builddir $ ctest -L mytests Test project /home/elmeruser/Source/builddir
Start 346: mytest3
1/3 Test #346: mytest3 .......................... Passed 0.76 sec
Start 347: mytest1
2/3 Test #347: mytest1 .......................... Passed 0.38 sec
Start 348: mytest2
3/3 Test #348: mytest2 .......................... Passed 0.40 sec

100% tests passed, 0 tests failed out of 3

The new feature thus makes it possible to easily run private test case with the development version of Elmer. For the developers it allows the possibility to test also contributed tests more easily without too much manual work.

Note that if you add the directory under the tests as a symlink be cautious when including new files and committing files under git. Nobody should use "git add" too carelessly anyway but with these untracked directories one should be even more careful.

You can of course also contribute cases to the main test suite when appropriate. Then the developers can test them even prior to committing code in the first place.

The test don't yet include parallel test cases but this will hopefully be addressed in the autumn.

Best regards,
ElmerTeam
Post Reply