diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-05-20 23:47:14 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-05-20 23:47:14 +0100 |
commit | fa7e06da82bdf46cfbf10eacfe0740e8dbbf096d (patch) | |
tree | 3031090d542914f5b8dc7ce52cda935d176e5f5a | |
parent | Work around the fact that webapp-config [might] tear down and replace in its ... (diff) | |
download | project2-fa7e06da82bdf46cfbf10eacfe0740e8dbbf096d.tar.bz2 project2-fa7e06da82bdf46cfbf10eacfe0740e8dbbf096d.tar.xz project2-fa7e06da82bdf46cfbf10eacfe0740e8dbbf096d.zip |
Use a less generic tmp folder
-rw-r--r-- | project2/xml/unittests/testxml.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/project2/xml/unittests/testxml.cpp b/project2/xml/unittests/testxml.cpp index 539c0a0..52dda4b 100644 --- a/project2/xml/unittests/testxml.cpp +++ b/project2/xml/unittests/testxml.cpp @@ -16,6 +16,14 @@ systembf(const char * fmt, const T & ... params) return system(stringbf(fmt, params...).c_str()); } +const boost::filesystem::path tmpdir = "/tmp/ut/project2.xml"; + +BOOST_AUTO_TEST_CASE( before ) +{ + boost::filesystem::remove_all(tmpdir); + boost::filesystem::create_directories(tmpdir); +} + BOOST_AUTO_TEST_CASE( rawview ) { TestOptionsSource::LoadTestOptions({ }); @@ -24,11 +32,12 @@ BOOST_AUTO_TEST_CASE( rawview ) h->executeViews(NULL); auto p = boost::dynamic_pointer_cast<XmlPresenter>(h->getPresenter(NULL)); BOOST_REQUIRE(p); - std::fstream strm("/tmp/out.xml", std::ios::out); + const auto out = tmpdir / "rawview.xml"; + std::fstream strm(out.string(), std::ios::out); BOOST_REQUIRE(strm.is_open()); p->writeTo(strm, "utf-8", NULL); BOOST_REQUIRE_EQUAL(0, systembf("diff -w --unified %s %s", - "/tmp/out.xml", + out, RootDir / "expected" / "rawview.xml")); } |