Use common test function to create temporary session
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 11 Jul 2013 15:11:45 +0000 (11:11 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 8 Aug 2013 19:23:08 +0000 (15:23 -0400)
.gitignore
libs/ardour/test/test_needing_session.cc
libs/ardour/wscript

index 48a95b8e4b602577555accb6d67a2b6f381d1037..f2251ba2043692c4cddc334cfbcf70c168ddb4b1 100644 (file)
@@ -1,7 +1,6 @@
 *.[oa]
 *.o
 *.os
-*.template
 *.binding
 *.so
 *.dylib
index a6220ded1230ff964f8c534277ac5077b13510f3..181d391e01d588ea34b88eb8d82b0c52d21dda9c 100644 (file)
@@ -1,3 +1,5 @@
+#include <glibmm/miscutils.h>
+
 #include "midi++/manager.h"
 #include "pbd/compose.h"
 #include "pbd/enumwriter.h"
@@ -5,6 +7,7 @@
 #include "ardour/audioengine.h"
 #include "test_needing_session.h"
 #include "test_util.h"
+#include "test_common.h"
 
 using namespace std;
 using namespace ARDOUR;
@@ -13,9 +16,9 @@ using namespace PBD;
 void
 TestNeedingSession::setUp ()
 {
-       string const test_session_path = "libs/ardour/test/test_session";
-       system (string_compose ("rm -rf %1", test_session_path).c_str());
-       _session = load_session (test_session_path, "test_session");
+       const string session_name("test_session");
+       std::string new_session_dir = Glib::build_filename (new_test_output_dir(), session_name);
+       _session = load_session (new_session_dir, "test_session");
 }
 
 void
index 2b16ed3a87423d140d6e3c8aa952a2fde4f58b41..131dda520bca5f26952184fc4df956d250d3cb9a 100644 (file)
@@ -483,6 +483,7 @@ def build(bld):
             create_ardour_test_program(bld, obj.includes, 'region_naming', 'test_region_naming', ['test/region_naming_test.cc'])
             create_ardour_test_program(bld, obj.includes, 'control_surface', 'test_control_surfaces', ['test/control_surfaces_test.cc'])
             create_ardour_test_program(bld, obj.includes, 'mtdm_test', 'test_mtdm', ['test/mtdm_test.cc'])
+            create_ardour_test_program(bld, obj.includes, 'session_test', 'test_session', ['test/session_test.cc'])
 
         test_sources  = '''
             test/automation_list_property_test.cc
@@ -499,6 +500,7 @@ def build(bld):
             test/region_naming_test.cc
             test/control_surfaces_test.cc
             test/mtdm_test.cc
+            test/session_test.cc
         '''.split()
 
 # Tests that don't work