1 /*=============================================================================
2 
3   Library: CTK
4 
5   Copyright (c) German Cancer Research Center,
6     Division of Medical and Biological Informatics
7 
8   Licensed under the Apache License, Version 2.0 (the "License");
9   you may not use this file except in compliance with the License.
10   You may obtain a copy of the License at
11 
12     http://www.apache.org/licenses/LICENSE-2.0
13 
14   Unless required by applicable law or agreed to in writing, software
15   distributed under the License is distributed on an "AS IS" BASIS,
16   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   See the License for the specific language governing permissions and
18   limitations under the License.
19 
20 =============================================================================*/
21 
22 
23 #include <QCoreApplication>
24 
25 #include <ctkConfig.h>
26 #include <ctkPluginConstants.h>
27 
28 #include <Testing/Cpp/ctkPluginFrameworkTestRunner.h>
29 
30 
main(int argc,char ** argv)31 int main(int argc, char** argv)
32 {
33   QCoreApplication app(argc, argv);
34 
35   ctkPluginFrameworkTestRunner testRunner;
36 
37   app.setOrganizationName("CTK");
38   app.setOrganizationDomain("commontk.org");
39   app.setApplicationName("ctkMetaTypeImplCppTests");
40 
41   QString pluginDir;
42 #ifdef CMAKE_INTDIR
43   pluginDir = CTK_PLUGIN_DIR CMAKE_INTDIR "/";
44 #else
45   pluginDir = CTK_PLUGIN_DIR;
46 #endif
47 
48   QString testpluginDir;
49 #ifdef CMAKE_INTDIR
50   testpluginDir = qApp->applicationDirPath() + "/../test_plugins/" CMAKE_INTDIR "/";
51 #else
52   testpluginDir = qApp->applicationDirPath() + "/test_plugins/";
53 #endif
54 
55   testRunner.addPluginPath(pluginDir, false);
56   testRunner.addPlugin(testpluginDir, "org_commontk_metatypetest");
57   testRunner.addPlugin(pluginDir, "org_commontk_metatype");
58   testRunner.startPluginOnRun("org.commontk.metatypetest");
59 
60   ctkProperties fwProps;
61   fwProps.insert(ctkPluginConstants::FRAMEWORK_STORAGE_CLEAN, ctkPluginConstants::FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
62   fwProps.insert("pluginfw.testDir", testpluginDir);
63   fwProps.insert("metatype.impl", "org.commontk.metatype");
64 
65   testRunner.init(fwProps);
66   return testRunner.run(argc, argv);
67 }
68