BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
test_utils.h File Reference

Defines class CLASS? More...

Include dependency graph for test_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 ModelView
 materialitems.h Collection of materials to populate MaterialModel.
 
 TestUtils
 Various common utils for unit tests.
 

Functions

template<typename T >
void TestUtils::clean_items (T &items)
 Deletes items in the container and cleans container afterwards. More...
 
template<typename T >
auto TestUtils::create_pointers (const std::vector< std::unique_ptr< T >> &vec)
 Creates vector of pointers from vector of unique_ptr. More...
 
template<typename B , typename D >
auto TestUtils::create_row (int ncolumns)
 Creates vector of unique_ptr of given type. More...
 
std::string TestUtils::CreateEmptyFile (const std::string &dirname, const std::string &fileName)
 Helper function to create empty file in a given directory (directory should exist). More...
 
std::string TestUtils::CreateTestDirectory (const std::string &test_sub_dir)
 Creates test directory in main test folder and returns full path. More...
 
std::string TestUtils::CreateTestFile (const std::string &dirname, const std::string &fileName)
 Helper function to create test file in a given directory (directory should exist). More...
 
QString TestUtils::JsonToString (const QJsonObject &object)
 
QJsonDocument TestUtils::LoadJson (const std::string &fileName)
 
QString TestUtils::ModelToJsonString (ModelView::SessionModel &model)
 Returns string representing serialized json content of the model. More...
 
void TestUtils::SaveJson (const QJsonArray &object, const std::string &fileName)
 
void TestUtils::SaveJson (const QJsonObject &object, const std::string &fileName)
 
std::string TestUtils::TestDirectoryPath (const std::string &test_sub_dir)
 Returns full path to the main test folder in CMAKE_BINARY_DIR. More...
 
std::string TestUtils::TestFileName (const std::string &test_sub_dir, const std::string &file_name)
 Returns full path to the file in test directory. More...
 
std::string TestUtils::TestOutputDir ()
 Returns full path to the main test folder, as defined by CMake at compile time. More...
 
template<typename T , typename... Args>
std::vector< T > TestUtils::toVector (Args &&... args)
 Creates vector of T from argument list. Used in EXPECT_EQ macros for convenience. More...
 

Detailed Description

Defines class CLASS?

Collection of utility functions for various unit tests.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file test_utils.h.