BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
JsonDocumentTest Class Reference

Tests JsonDocument class. More...

Inheritance diagram for JsonDocumentTest:
[legend]
Collaboration diagram for JsonDocumentTest:
[legend]

Classes

class  TestModel1
 
class  TestModel2
 

Public Member Functions

 JsonDocumentTest ()
 
 ~JsonDocumentTest ()
 
std::string createEmptyDir (const std::string &subdir) const
 Creates an empty directory in main test folder. More...
 
std::string testDir () const
 
std::string testPath () const
 Return full path to the test folder. Located in CMAKE_BINARY_DIR/test_output/<m_test_dir>. More...
 

Protected Attributes

std::string m_test_dir
 

Detailed Description

Tests JsonDocument class.

Definition at line 30 of file jsondocument.test.cpp.

Constructor & Destructor Documentation

◆ JsonDocumentTest()

JsonDocumentTest::JsonDocumentTest ( )
inline

Definition at line 32 of file jsondocument.test.cpp.

32 : FolderBasedTest("test_JsonDocument") {}
FolderBasedTest(const std::string &test_dir)

◆ ~JsonDocumentTest()

JsonDocumentTest::~JsonDocumentTest ( )
default

Member Function Documentation

◆ createEmptyDir()

std::string FolderBasedTest::createEmptyDir ( const std::string &  subdir) const
inherited

Creates an empty directory in main test folder.

Remove recursively previous one with the same name, if exist.

Definition at line 39 of file folderbasedtest.cpp.

40 {
41  auto path = ModelView::Utils::join(testPath(), subdir);
44  return path;
45 }
std::string testPath() const
Return full path to the test folder. Located in CMAKE_BINARY_DIR/test_output/<m_test_dir>.
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

References ModelView::Utils::create_directory(), ModelView::Utils::join(), ModelView::Utils::remove_all(), and FolderBasedTest::testPath().

Here is the call graph for this function:

◆ testDir()

std::string FolderBasedTest::testDir ( ) const
inherited

Definition at line 24 of file folderbasedtest.cpp.

25 {
26  return m_test_dir;
27 }
std::string m_test_dir

References FolderBasedTest::m_test_dir.

◆ testPath()

std::string FolderBasedTest::testPath ( ) const
inherited

Return full path to the test folder. Located in CMAKE_BINARY_DIR/test_output/<m_test_dir>.

Definition at line 31 of file folderbasedtest.cpp.

32 {
34 }
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

References FolderBasedTest::m_test_dir, and TestUtils::TestDirectoryPath().

Referenced by FolderBasedTest::createEmptyDir().

Here is the call graph for this function:

Member Data Documentation

◆ m_test_dir

std::string FolderBasedTest::m_test_dir
protectedinherited

The documentation for this class was generated from the following file: