Use test utility function to find evoral test files
either via EVORAL_TEST_PATH env var or on windows via directory relative to dll
This commit is contained in:
parent
f6e15a3b6b
commit
61f9ca9f3c
@ -20,6 +20,7 @@ export ARDOUR_EXPORT_FORMATS_PATH=$TOP/export:.
|
|||||||
export ARDOUR_BACKEND_PATH=$libs/backends/jack:$libs/backends/wavesaudio:$libs/backends/dummy:$libs/backends/alsa
|
export ARDOUR_BACKEND_PATH=$libs/backends/jack:$libs/backends/wavesaudio:$libs/backends/dummy:$libs/backends/alsa
|
||||||
export ARDOUR_TEST_PATH=$TOP/libs/ardour/test/data
|
export ARDOUR_TEST_PATH=$TOP/libs/ardour/test/data
|
||||||
export PBD_TEST_PATH=$TOP/libs/pbd/test
|
export PBD_TEST_PATH=$TOP/libs/pbd/test
|
||||||
|
export EVORAL_TEST_PATH=$TOP/libs/evoral/test/testdata
|
||||||
|
|
||||||
#
|
#
|
||||||
# even though we set the above variables, ardour requires that these
|
# even though we set the above variables, ardour requires that these
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
srcdir=`pwd`
|
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$srcdir/../../build/libs/evoral:$srcdir/../../build/libs/pbd
|
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
|
||||||
if [ ! -f './test/testdata/TakeFive.mid' ]; then
|
TOP="$SCRIPTPATH/../.."
|
||||||
echo "This script must be run from within the libs/evoral directory";
|
LIBS_DIR="$TOP/build/libs"
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make symlink to TakeFive.mid in build directory
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBS_DIR/evoral:$LIBS_DIR/pbd
|
||||||
cd ../../build/libs/evoral
|
|
||||||
mkdir -p ./test/testdata
|
export EVORAL_TEST_PATH="$SCRIPTPATH/test/testdata"
|
||||||
ln -fs $srcdir/test/testdata/TakeFive.mid \
|
|
||||||
./test/testdata/TakeFive.mid
|
cd $LIBS_DIR/evoral
|
||||||
|
|
||||||
lcov -q -d ./src -z
|
lcov -q -d ./src -z
|
||||||
./run-tests
|
./run-tests
|
||||||
|
@ -21,11 +21,24 @@ SMFTest::createNewFileTest ()
|
|||||||
CPPUNIT_ASSERT(Glib::file_test (new_file_path, Glib::FILE_TEST_IS_REGULAR));
|
CPPUNIT_ASSERT(Glib::file_test (new_file_path, Glib::FILE_TEST_IS_REGULAR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PBD::Searchpath
|
||||||
|
test_search_path ()
|
||||||
|
{
|
||||||
|
#ifdef PLATFORM_WINDOWS
|
||||||
|
string wsp(g_win32_get_package_installation_directory_of_module(NULL));
|
||||||
|
return Glib::build_filename (wsp, "evoral_testdata");
|
||||||
|
#else
|
||||||
|
return Glib::getenv("EVORAL_TEST_PATH");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SMFTest::takeFiveTest ()
|
SMFTest::takeFiveTest ()
|
||||||
{
|
{
|
||||||
TestSMF smf;
|
TestSMF smf;
|
||||||
smf.open("./test/testdata/TakeFive.mid");
|
string testdata_path;
|
||||||
|
CPPUNIT_ASSERT (find_file (test_search_path (), "TakeFive.mid", testdata_path));
|
||||||
|
smf.open(testdata_path);
|
||||||
CPPUNIT_ASSERT(!smf.is_empty());
|
CPPUNIT_ASSERT(!smf.is_empty());
|
||||||
|
|
||||||
seq->start_write();
|
seq->start_write();
|
||||||
|
Loading…
Reference in New Issue
Block a user