diff --git a/libs/pbd/test/filesystem_test.cc b/libs/pbd/test/filesystem_test.cc index 458105d177..8a173858a0 100644 --- a/libs/pbd/test/filesystem_test.cc +++ b/libs/pbd/test/filesystem_test.cc @@ -1,8 +1,14 @@ +#include "filesystem_test.h" + #include #include -#include "filesystem_test.h" + +#include + #include "pbd/file_utils.h" +#include "test_common.h" + using namespace std; CPPUNIT_TEST_SUITE_REGISTRATION (FilesystemTest); @@ -35,3 +41,17 @@ FilesystemTest::testPathIsWithin () #endif } +void +FilesystemTest::testCopyFile () +{ + std::string testdata_path; + CPPUNIT_ASSERT (find_file (test_search_path (), "RosegardenPatchFile.xml", testdata_path)); + + std::string output_path = test_output_directory ("CopyFile"); + + output_path = Glib::build_filename (output_path, "RosegardenPatchFile.xml"); + + cerr << "CopyFile test output path: " << output_path << endl; + + CPPUNIT_ASSERT (PBD::copy_file (testdata_path, output_path)); +} diff --git a/libs/pbd/test/filesystem_test.h b/libs/pbd/test/filesystem_test.h index 57f26631d0..f25d3abbc8 100644 --- a/libs/pbd/test/filesystem_test.h +++ b/libs/pbd/test/filesystem_test.h @@ -5,10 +5,12 @@ class FilesystemTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE (FilesystemTest); CPPUNIT_TEST (testPathIsWithin); + CPPUNIT_TEST (testCopyFile); CPPUNIT_TEST_SUITE_END (); public: void testPathIsWithin (); + void testCopyFile (); };