Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkTestFixture.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKTESTFIXTURE_H
18 #define MITKTESTFIXTURE_H
19 
20 #include <cppunit/TestFixture.h>
21 #include <mitkTestingConfig.h>
22 
23 #include <itksys/SystemTools.hxx>
24 
25 #include <string>
26 #include <vector>
27 
28 namespace mitk
29 {
90  class TestFixture : public CppUnit::TestFixture
91  {
92  protected:
103  std::vector<std::string> GetTestParameter() const { return m_Parameter; }
111  static std::string GetTestDataFilePath(const std::string &testData)
112  {
113  if (itksys::SystemTools::FileIsFullPath(testData.c_str()))
114  return testData;
115  return std::string(MITK_DATA_DIR) + "/" + testData;
116  }
117 
118  private:
119  template <class P>
120  friend class TestCaller;
121 
122  std::vector<std::string> m_Parameter;
123  };
124 }
125 
126 #endif // MITKTESTFIXTURE_H
#define MITK_DATA_DIR
DataCollection - Class to facilitate loading/accessing structured data.
static std::string GetTestDataFilePath(const std::string &testData)
Get the absolute path for test data.
std::vector< std::string > GetTestParameter() const
Get parameters for this test fixture.
Test fixture for parameterized tests.
A test caller for parameterized tests.