Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
mia
internal
autotest.hh
Go to the documentation of this file.
1
/* -*- mia-c++ -*-
2
*
3
* This file is part of MIA - a toolbox for medical image analysis
4
* Copyright (c) Leipzig, Madrid 1999-2013 Gert Wollny
5
*
6
* MIA is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
18
*
19
*/
20
21
#ifndef mia_internal_autotest_hh
22
#define mia_internal_autotest_hh
23
24
#ifdef HAVE_CONFIG_H
25
#include <config.h>
26
#endif
27
28
#include <climits>
29
30
#ifndef BOOST_TEST_DYN_LINK
31
#define BOOST_TEST_DYN_LINK
32
#endif
33
//#define BOOST_TEST_ALTERNATIVE_INIT_API
34
#define BOOST_TEST_MAIN
35
#define BOOST_TEST_NO_MAIN
36
#include <boost/test/unit_test.hpp>
37
#include <boost/test/floating_point_comparison.hpp>
38
39
#include <miaconfig.h>
40
#include <
mia/core/cmdlineparser.hh
>
41
#include <
mia/internal/main.hh
>
42
43
const
mia::SProgramDescription
description
= {
44
{
mia::pdi_group
,
"Test"
},
45
{
mia::pdi_short
,
"Unit test."
},
46
{
mia::pdi_description
,
"This program runs a set of tests."
},
47
{
mia::pdi_example_descr
,
"Example text"
},
48
{
mia::pdi_example_code
,
""
}
49
};
50
51
52
int
BOOST_TEST_CALL_DECL
53
do_main
(
int
argc,
char
* argv[] )
54
{
55
// set the plug-in path for tests
56
setenv(
"MIA_PLUGIN_TESTPATH"
, MIA_BUILD_ROOT
"/plugintest/"
PLUGIN_INSTALL_PATH ,1);
57
#ifdef WIN32
58
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
59
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG );
60
#endif
61
if
(mia::CCmdOptionList(
description
).parse(argc, argv,
"boost-test-option"
) != mia::CCmdOptionList::hr_no)
62
return
0;
63
mia::cvdebug
() <<
"Initialize test ...\n"
;
64
return ::boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
65
}
66
67
MIA_MAIN
(
do_main
);
68
69
#endif
pdi_description
Definition:
cmdlineparser.hh:61
main.hh
SProgramDescription
std::map< EProgramDescriptionEntry, const char * > SProgramDescription
the map that holds a basic program description
Definition:
cmdlineparser.hh:83
pdi_short
Definition:
cmdlineparser.hh:60
description
const mia::SProgramDescription description
Definition:
autotest.hh:43
cvdebug
vstream & cvdebug()
Short for debug output in non-debug build output send to this will be ignored.
Definition:
msgstream.hh:213
pdi_example_code
Definition:
cmdlineparser.hh:63
do_main
int BOOST_TEST_CALL_DECL do_main(int argc, char *argv[])
Definition:
autotest.hh:53
cmdlineparser.hh
pdi_group
Definition:
cmdlineparser.hh:59
MIA_MAIN
#define MIA_MAIN(callback)
Definition:
main.hh:27
pdi_example_descr
Definition:
cmdlineparser.hh:62
Generated on Thu Nov 28 2013 13:45:02 by
1.8.5