Commit 1a02868f authored by malossi's avatar malossi
Browse files

A new Template Test has been placed in the testsuite. You can use it to create...

A new Template Test has been placed in the testsuite. You can use it to create new tests in the testsuite. Please note that this test is executed during the night compilation. You can type:

grep "test_TemplateTest" *

in your lifev-cvs folder to see which files have been modified to setup the test.
Read the README.txt for more information.
parent c78d80c7
......@@ -25,6 +25,7 @@ SUFFIXES = .cpp .hpp .idl .c .h .f .F .o .moc
DO_NOT_COMPILE=
SUBDIRS = data \
test_TemplateTest \
test_cylinder \
test_getpot \
test_heart \
......@@ -37,10 +38,11 @@ SUBDIRS = data \
test_meshReorder \
test_ML \
test_laplacian \
test_filters \
test_filters
$(DO_NOT_COMPILE)
TESTSUITES=$(srcdir)/test_cylinder/testsuite.at \
TESTSUITES=$(srcdir)/test_TemplateTest/testsuite.at \
$(srcdir)/test_cylinder/testsuite.at \
$(srcdir)/test_structure/testsuite.at \
$(srcdir)/test_ethiersteinman/testsuite.at\
$(srcdir)/test_fsi/testsuite.at \
......
# -*- makefile -*-
###################################################################################################
#
# This file is part of the LifeV Applications
# Copyright (C) 2001-2010 EPFL, Politecnico di Milano, INRIA
#
# Author(s): Name Surname <name.surname@epfl.ch>
# Date: 00-00-0000
# License Terms: GNU GPL
#
###################################################################################################
include $(top_srcdir)/testsuite/Makefile.testsuite
SUFFIXES = .cpp .hpp .idl .c .h .f .F .o .moc
check_HEADERS = # List of all the hpp files
check_PROGRAMS = test_TemplateTest
test_TemplateTest_SOURCES = main.cpp # List of all the cpp files
EXTRA_DIST = data.txt testsuite.at
link:
test -a data || ln -s $(srcdir)/data.txt
test -a Mesh || ln -s $(top_srcdir)/testsuite/data/mesh/inria/ Mesh
recheck: clean_PROGRAMS check
clean_PROGRAMS:
-rm $(check_PROGRAMS)
clean-results:
-rm *.vct *.scl *.case *.geo
TESTSUITE README:
This folder contains the template files for creating a new test in the testsuite.
Suppose that we want to create a new test with the name "MyTest", than we have to:
1) create a new folder with the name "test_MyTest" in the testsuite main directory;
2) copy/paste all the files from "test_TemplateTest" to "test_MyTest";
3) modify the main.cpp and Makefile.am for running the new test;
4) modify the data.txt and testsuite.at, adding the parameters;
5) check that the test is correctly executed when typing "make check".
To do it edit the following files:
testsuite/Makefile.am
testsuite/testsuite.at
6) add the test to the global doxygen documentation by inserting
$(top_srcdir)/testsuite/test_MyTest
in the INPUT section of admin/Doxyfile.am
For any additional information about this procedure, please read the "LifeV Development Guidelines"
or contact the LifeV administrator.
\ No newline at end of file
###################################################################################################
#
# This file is part of the LifeV Applications
# Copyright (C) 2001-2010 EPFL, Politecnico di Milano, INRIA
#
# Author(s): Name Surname <name.surname@epfl.ch>
# Date: 00-00-0000
# License Terms: GNU GPL
#
###################################################################################################
### DATA FILE #####################################################################################
###################################################################################################
//@HEADER
/*
************************************************************************
This file is part of the LifeV Applications.
Copyright (C) 2001-2010 EPFL, Politecnico di Milano, INRIA
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
************************************************************************
*/
//@HEADER
/*!
@file
@brief A short description of the test content
@author Name Surname <name.surname@email.org>
@date 00-00-0000
Here write a long and detailed description of the test.
Please note that the test should be quick (maximum 5 minutes)
and should not be an application.
Remember to add and configure a testsuite.at file to allow
night execution of the test inside the testsuite.
*/
#include <Epetra_ConfigDefs.h>
#ifdef EPETRA_MPI
#include <mpi.h>
#include <Epetra_MpiComm.h>
#else
#include <Epetra_SerialComm.h>
#endif
#include <life/lifecore/application.hpp>
#include <life/lifecore/life.hpp>
LifeV::AboutData
makeAbout()
{
LifeV::AboutData about( "Name of the application" ,
"Name of the test" ,
"Test version 0.0",
"Short description",
LifeV::AboutData::License_GPL,
"Copyright (c) 2009 EPFL");
about.addAuthor("Name Surname", "Developer", "name.surname@epfl.ch", "");
about.addAuthor("Name Surname", "Developer", "name.surname@epfl.ch", "");
return about;
}
using namespace LifeV;
int
main( int argc, char** argv )
{
//MPI communicator initialization
boost::shared_ptr<Epetra_Comm> comm;
#ifdef HAVE_MPI
std::cout << "MPI Initialization" << std::endl;
MPI_Init( &argc, &argv );
#endif
//MPI Preprocessing
#ifdef EPETRA_MPI
int nprocs;
int rank;
MPI_Comm_size( MPI_COMM_WORLD, &nprocs );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
if ( rank == 0 )
{
std::cout << "MPI processes: " << nprocs << std::endl;
std::cout << "MPI Epetra Initialization ... " << std::endl;
}
comm.reset( new Epetra_MpiComm( MPI_COMM_WORLD ) );
comm->Barrier();
#else
std::cout << "MPI SERIAL Epetra Initialization ... " << std::endl;
comm.reset( new Epetra_SerialComm() );
#endif
// ----- Test calls -----
//
// The test should return a result (for tolerance comparison)
// or a flag (0: EXIT_SUCCESS, 1:EXIT_FAILURE).
//
// The test must verify if tolerance is satisfied!
Real result(0);
Real tolerance(1e-10);
if ( result > tolerance)
return EXIT_FAILURE;
// ----- End of test calls -----
#ifdef HAVE_MPI
std::cout << "MPI Finalization" << std::endl;
MPI_Finalize();
#endif
// If everything runs correctly we return EXIT_SUCCESS flag
return EXIT_SUCCESS;
}
###################################################################################################
#
# This file is part of the LifeV Applications
# Copyright (C) 2001-2010 EPFL, Politecnico di Milano, INRIA
#
# Author(s): Name Surname <name.surname@epfl.ch>
# Date: 00-00-0000
# License Terms: GNU GPL
#
###################################################################################################
### TEST: TEST NAME ###############################################################################
###################################################################################################
AT_SETUP([test_TemplateTest])
AT_KEYWORDS([])
AT_DATA([data],[[
# Place here the content of the GetPot data file for the night test.
]])
AT_CHECK([ln -sf ../../data/mesh/inria/Mesh &&
mpirun -n 1 ../../test_TemplateTest/test_TemplateTest -c],[0],[ignore],[ignore])
AT_CLEANUP([FilesCreatedByTheTest1.txt FilesCreatedByTheTest2.txt ...])
......@@ -43,7 +43,7 @@ AT_INIT([lifev testsuite])
# solver tests
AT_BANNER([life/lifesolver testsuite ...])
#m4_include([test_bdf/testsuite.at])
m4_include([test_TemplateTest/testsuite.at])
m4_include([test_cylinder/testsuite.at])
m4_include([test_ethiersteinman/testsuite.at])
m4_include([test_structure/testsuite.at])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment