4 #ifndef DP3_COMMON_TEST_UNIT_FIXTURES_FDIRECTORY_H
5 #define DP3_COMMON_TEST_UNIT_FIXTURES_FDIRECTORY_H
10 #include <boost/filesystem.hpp>
12 #include "test_config.h"
28 boost::filesystem::create_directories(kPath);
29 boost::filesystem::current_path(kPath);
38 boost::filesystem::current_path(kWorkDir);
39 boost::filesystem::remove_all(kPath);
44 const std::string command =
"tar xfz " DP3_RESOURCE_DIR
"/" + tgz;
45 const int status = std::system(command.c_str());
46 if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
47 throw std::runtime_error(
"Error while extracting " + tgz);
52 const boost::filesystem::path kPath = boost::filesystem::unique_path();
53 const boost::filesystem::path kWorkDir = boost::filesystem::current_path();
Definition: fDirectory.h:24
FixtureDirectory & operator=(const FixtureDirectory &)=delete
FixtureDirectory(const FixtureDirectory &)=delete
FixtureDirectory()
Create the temporary directory and set it as working directory.
Definition: fDirectory.h:27
static void ExtractResource(const std::string &tgz)
Extracts a test resource tgz file into the current directory.
Definition: fDirectory.h:43
~FixtureDirectory()
Definition: fDirectory.h:37
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53