42 std::string dirname = testPath() + std::string(
"/") +
"subdir";
51 std::string dirname = testPath() + std::string(
"/") +
"subdir2";
61 std::string
filename = testPath() + std::string(
"/testmodel/fileutils.test.cpp");
75 ASSERT_EQ(found_files.size(), 2);
76 EXPECT_NE(found_files.end(), std::find(found_files.begin(), found_files.end(),
78 EXPECT_NE(found_files.end(), std::find(found_files.begin(), found_files.end(),
96 std::string dirname = testPath() + std::string(
"/") +
"subdir_is_empty";
Convenience class which creates a directory on disk for test content.
TEST_F(FileUtilsTest, exists)
std::string filename(const std::string &path)
Returns path without directory part ("Foo/Bar/Doz.int.gz" -> "Doz.int.gz")
MVVM_MODEL_EXPORT std::string base_name(const std::string &path)
Provide the filename of a file path.
MVVM_MODEL_EXPORT std::vector< std::string > FindFiles(const std::string &dirname, const std::string &ext)
Returns list of files with given extention found in given directory.
MVVM_MODEL_EXPORT bool is_empty(const std::string &path)
Returns true if the file indicated by 'path' refers to empty file or directory.
MVVM_MODEL_EXPORT bool remove(const std::string &path)
Removes file or empty directory.
MVVM_MODEL_EXPORT void remove_all(const std::string &path)
Removes directory with all its content.
MVVM_MODEL_EXPORT std::string parent_path(const std::string &path)
Returns the path to the parent directory.
MVVM_MODEL_EXPORT std::string join(const std::string &part1, const std::string &part2)
Joins two path elements into the path.
MVVM_MODEL_EXPORT bool exists(const std::string &fileName)
Returns true if file exists.
MVVM_MODEL_EXPORT bool create_directory(const std::string &path)
Create directory, parent directory must exist.
materialitems.h Collection of materials to populate MaterialModel.
bool exists(const QString &fileName)
Returns true if file exists.
std::string CreateEmptyFile(const std::string &dirname, const std::string &fileName)
Helper function to create empty file in a given directory (directory should exist).
std::string CreateTestFile(const std::string &dirname, const std::string &fileName)
Helper function to create test file in a given directory (directory should exist).
std::string TestOutputDir()
Returns full path to the main test folder, as defined by CMake at compile time.