BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
folderbasedtest.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/tests/libtestmachinery/folderbasedtest.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #include "folderbasedtest.h"
16 #include "mvvm/utils/fileutils.h"
17 #include "test_utils.h"
18 
19 FolderBasedTest::FolderBasedTest(const std::string& test_dir) : m_test_dir(test_dir)
20 {
22 }
23 
24 std::string FolderBasedTest::testDir() const
25 {
26  return m_test_dir;
27 }
28 
29 //! Return full path to the test folder. Located in CMAKE_BINARY_DIR/test_output/<m_test_dir>.
30 
31 std::string FolderBasedTest::testPath() const
32 {
34 }
35 
36 //! Creates an empty directory in main test folder.
37 //! Remove recursively previous one with the same name, if exist.
38 
39 std::string FolderBasedTest::createEmptyDir(const std::string& subdir) const
40 {
41  auto path = ModelView::Utils::join(testPath(), subdir);
44  return path;
45 }
46 
std::string createEmptyDir(const std::string &subdir) const
Creates an empty directory in main test folder.
std::string testDir() const
std::string m_test_dir
FolderBasedTest(const std::string &test_dir)
std::string testPath() const
Return full path to the test folder. Located in CMAKE_BINARY_DIR/test_output/<m_test_dir>.
Defines class CLASS?
Defines class CLASS?
MVVM_MODEL_EXPORT void remove_all(const std::string &path)
Removes directory with all its content.
Definition: fileutils.cpp:67
MVVM_MODEL_EXPORT std::string join(const std::string &part1, const std::string &part2)
Joins two path elements into the path.
Definition: fileutils.cpp:37
MVVM_MODEL_EXPORT bool create_directory(const std::string &path)
Create directory, parent directory must exist.
Definition: fileutils.cpp:47
std::string TestDirectoryPath(const std::string &test_sub_dir)
Returns full path to the main test folder in CMAKE_BINARY_DIR.
Definition: test_utils.cpp:47
std::string CreateTestDirectory(const std::string &test_sub_dir)
Creates test directory in main test folder and returns full path.
Definition: test_utils.cpp:40
Defines class CLASS?