13
0

Add arg to test function to be able to prefix test output directory

This makes it much easier to find test output from a specific test
This commit is contained in:
Tim Mayberry 2013-08-10 18:49:45 +10:00
parent b91fa19fe7
commit 42b475069b
2 changed files with 3 additions and 2 deletions

View File

@ -37,13 +37,14 @@ test_search_path ()
} }
std::string std::string
new_test_output_dir () new_test_output_dir (std::string prefix)
{ {
std::string tmp_dir = Glib::build_filename (g_get_tmp_dir(), "ardour_test"); std::string tmp_dir = Glib::build_filename (g_get_tmp_dir(), "ardour_test");
std::string dir_name; std::string dir_name;
std::string new_test_dir; std::string new_test_dir;
do { do {
ostringstream oss; ostringstream oss;
oss << prefix;
oss << g_random_int (); oss << g_random_int ();
dir_name = oss.str(); dir_name = oss.str();
new_test_dir = Glib::build_filename (tmp_dir, dir_name); new_test_dir = Glib::build_filename (tmp_dir, dir_name);

View File

@ -23,7 +23,7 @@
PBD::SearchPath test_search_path (); PBD::SearchPath test_search_path ();
std::string new_test_output_dir (); std::string new_test_output_dir (std::string prefix = "");
int get_test_sample_rate (); int get_test_sample_rate ();