# HG changeset patch # User Chris Cannam # Date 1479145996 0 # Node ID 24c0d4c5356ec2257cd96d80452458089cc394c7 # Parent a4554bf41367d1d30e78081d846bc816dba25b64 Rearrange svcore tests so they can all be built from the top level diff -r a4554bf41367 -r 24c0d4c5356e base/test/files.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/base/test/files.pri Mon Nov 14 17:53:16 2016 +0000 @@ -0,0 +1,8 @@ +TEST_HEADERS = \ + TestRangeMapper.h \ + TestPitch.h \ + TestRealTime.h \ + TestStringBits.h + +TEST_SOURCES += \ + svcore-base-test.cpp diff -r a4554bf41367 -r 24c0d4c5356e base/test/main.cpp --- a/base/test/main.cpp Mon Nov 14 15:00:29 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ -/* - Sonic Visualiser - An audio file viewer and annotation editor. - Centre for Digital Music, Queen Mary, University of London. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. See the file - COPYING included with this distribution for more information. -*/ - -#include "TestRangeMapper.h" -#include "TestPitch.h" -#include "TestRealTime.h" -#include "TestStringBits.h" - -#include - -#include - -int main(int argc, char *argv[]) -{ - int good = 0, bad = 0; - - QCoreApplication app(argc, argv); - app.setOrganizationName("Sonic Visualiser"); - app.setApplicationName("test-svcore-base"); - - { - TestRangeMapper t; - if (QTest::qExec(&t, argc, argv) == 0) ++good; - else ++bad; - } - { - TestPitch t; - if (QTest::qExec(&t, argc, argv) == 0) ++good; - else ++bad; - } - { - TestRealTime t; - if (QTest::qExec(&t, argc, argv) == 0) ++good; - else ++bad; - } - { - TestStringBits t; - if (QTest::qExec(&t, argc, argv) == 0) ++good; - else ++bad; - } - - if (bad > 0) { - cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl; - return 1; - } else { - cerr << "All tests passed" << endl; - return 0; - } -} diff -r a4554bf41367 -r 24c0d4c5356e base/test/svcore-base-test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/base/test/svcore-base-test.cpp Mon Nov 14 17:53:16 2016 +0000 @@ -0,0 +1,59 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ +/* + Sonic Visualiser + An audio file viewer and annotation editor. + Centre for Digital Music, Queen Mary, University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include "TestRangeMapper.h" +#include "TestPitch.h" +#include "TestRealTime.h" +#include "TestStringBits.h" + +#include + +#include + +int main(int argc, char *argv[]) +{ + int good = 0, bad = 0; + + QCoreApplication app(argc, argv); + app.setOrganizationName("Sonic Visualiser"); + app.setApplicationName("test-svcore-base"); + + { + TestRangeMapper t; + if (QTest::qExec(&t, argc, argv) == 0) ++good; + else ++bad; + } + { + TestPitch t; + if (QTest::qExec(&t, argc, argv) == 0) ++good; + else ++bad; + } + { + TestRealTime t; + if (QTest::qExec(&t, argc, argv) == 0) ++good; + else ++bad; + } + { + TestStringBits t; + if (QTest::qExec(&t, argc, argv) == 0) ++good; + else ++bad; + } + + if (bad > 0) { + cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl; + return 1; + } else { + cerr << "All tests passed" << endl; + return 0; + } +} diff -r a4554bf41367 -r 24c0d4c5356e base/test/test.pro --- a/base/test/test.pro Mon Nov 14 15:00:29 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ - -TEMPLATE = app - -INCLUDEPATH += ../../../vamp-plugin-sdk - -LIBS += -L../.. -L../../../dataquay -L../../release -L../../../dataquay/release -lsvcore -ldataquay - -win32-g++ { - INCLUDEPATH += ../../../sv-dependency-builds/win32-mingw/include - LIBS += -L../../../sv-dependency-builds/win32-mingw/lib -} -win32-msvc* { - INCLUDEPATH += ../../../sv-dependency-builds/win32-msvc/include - LIBS += -L../../../sv-dependency-builds/win32-msvc/lib -} -mac* { - INCLUDEPATH += ../../../sv-dependency-builds/osx/include - LIBS += -L../../../sv-dependency-builds/osx/lib -} - -exists(../../config.pri) { - include(../../config.pri) -} - -!exists(../../config.pri) { - - CONFIG += release - DEFINES += NDEBUG BUILD_RELEASE NO_TIMING - - DEFINES += HAVE_BZ2 HAVE_FFTW3 HAVE_FFTW3F HAVE_SNDFILE HAVE_SAMPLERATE HAVE_VAMP HAVE_VAMPHOSTSDK HAVE_DATAQUAY HAVE_LIBLO HAVE_MAD HAVE_ID3TAG HAVE_PORTAUDIO - - LIBS += -lbz2 -lfftw3 -lfftw3f -lsndfile -lFLAC -logg -lvorbis -lvorbisenc -lvorbisfile -logg -lmad -lid3tag -lportaudio -lsamplerate -lz -lsord-0 -lserd-0 - - win* { - LIBS += -llo -lwinmm -lws2_32 - } - macx* { - DEFINES += HAVE_COREAUDIO - LIBS += -framework CoreAudio -framework CoreMidi -framework AudioUnit -framework AudioToolbox -framework CoreFoundation -framework CoreServices -framework Accelerate - } -} - -CONFIG += qt thread warn_on stl rtti exceptions console c++11 -QT += network xml testlib -QT -= gui - -TARGET = svcore-base-test - -DEPENDPATH += ../.. -INCLUDEPATH += ../.. -OBJECTS_DIR = o -MOC_DIR = o - -HEADERS += TestRangeMapper.h TestPitch.h TestRealTime.h TestStringBits.h -SOURCES += main.cpp - -win* { -//PRE_TARGETDEPS += ../../svcore.lib -} -!win* { -PRE_TARGETDEPS += ../../libsvcore.a -} - -!win32 { - !macx* { - QMAKE_POST_LINK=./$${TARGET} - } - macx* { - QMAKE_POST_LINK=./$${TARGET}.app/Contents/MacOS/$${TARGET} - } -} - -win32:QMAKE_POST_LINK=./release/$${TARGET}.exe - diff -r a4554bf41367 -r 24c0d4c5356e data/fileio/test/files.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/fileio/test/files.pri Mon Nov 14 17:53:16 2016 +0000 @@ -0,0 +1,7 @@ + +TEST_HEADERS += \ + AudioFileReaderTest.h \ + AudioTestData.h + +TEST_SOURCES += \ + svcore-data-fileio-test.cpp diff -r a4554bf41367 -r 24c0d4c5356e data/fileio/test/main.cpp --- a/data/fileio/test/main.cpp Mon Nov 14 15:00:29 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ -/* - Sonic Visualiser - An audio file viewer and annotation editor. - Centre for Digital Music, Queen Mary, University of London. - This file copyright 2013 Chris Cannam. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. See the file - COPYING included with this distribution for more information. -*/ - -#include "AudioFileReaderTest.h" - -#include - -#include - -int main(int argc, char *argv[]) -{ - int good = 0, bad = 0; - - QCoreApplication app(argc, argv); - app.setOrganizationName("Sonic Visualiser"); - app.setApplicationName("test-fileio"); - - { - AudioFileReaderTest t; - if (QTest::qExec(&t, argc, argv) == 0) ++good; - else ++bad; - } - - if (bad > 0) { - cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl; - return 1; - } else { - cerr << "All tests passed" << endl; - return 0; - } -} - diff -r a4554bf41367 -r 24c0d4c5356e data/fileio/test/svcore-data-fileio-test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/fileio/test/svcore-data-fileio-test.cpp Mon Nov 14 17:53:16 2016 +0000 @@ -0,0 +1,43 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ +/* + Sonic Visualiser + An audio file viewer and annotation editor. + Centre for Digital Music, Queen Mary, University of London. + This file copyright 2013 Chris Cannam. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include "AudioFileReaderTest.h" + +#include + +#include + +int main(int argc, char *argv[]) +{ + int good = 0, bad = 0; + + QCoreApplication app(argc, argv); + app.setOrganizationName("Sonic Visualiser"); + app.setApplicationName("test-fileio"); + + { + AudioFileReaderTest t; + if (QTest::qExec(&t, argc, argv) == 0) ++good; + else ++bad; + } + + if (bad > 0) { + cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl; + return 1; + } else { + cerr << "All tests passed" << endl; + return 0; + } +} + diff -r a4554bf41367 -r 24c0d4c5356e data/fileio/test/test.pro --- a/data/fileio/test/test.pro Mon Nov 14 15:00:29 2016 +0000 +++ b/data/fileio/test/test.pro Mon Nov 14 17:53:16 2016 +0000 @@ -54,10 +54,6 @@ OBJECTS_DIR = o MOC_DIR = o -HEADERS += AudioFileReaderTest.h \ - AudioTestData.h -SOURCES += main.cpp - win* { //PRE_TARGETDEPS += ../../../svcore.lib } diff -r a4554bf41367 -r 24c0d4c5356e data/model/test/files.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/model/test/files.pri Mon Nov 14 17:53:16 2016 +0000 @@ -0,0 +1,8 @@ +TEST_HEADERS += \ + Compares.h \ + MockWaveModel.h \ + TestFFTModel.h + +TEST_SOURCES += \ + MockWaveModel.cpp \ + svcore-data-model-test.cpp diff -r a4554bf41367 -r 24c0d4c5356e data/model/test/main.cpp --- a/data/model/test/main.cpp Mon Nov 14 15:00:29 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ -/* - Sonic Visualiser - An audio file viewer and annotation editor. - Centre for Digital Music, Queen Mary, University of London. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. See the file - COPYING included with this distribution for more information. -*/ - -#include "TestFFTModel.h" - -#include - -#include - -using namespace std; - -int main(int argc, char *argv[]) -{ - int good = 0, bad = 0; - - QCoreApplication app(argc, argv); - app.setOrganizationName("Sonic Visualiser"); - app.setApplicationName("test-model"); - - { - TestFFTModel t; - if (QTest::qExec(&t, argc, argv) == 0) ++good; - else ++bad; - } - - if (bad > 0) { - cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl; - return 1; - } else { - cerr << "All tests passed" << endl; - return 0; - } -} - diff -r a4554bf41367 -r 24c0d4c5356e data/model/test/svcore-data-model-test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/model/test/svcore-data-model-test.cpp Mon Nov 14 17:53:16 2016 +0000 @@ -0,0 +1,44 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ +/* + Sonic Visualiser + An audio file viewer and annotation editor. + Centre for Digital Music, Queen Mary, University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include "TestFFTModel.h" + +#include + +#include + +using namespace std; + +int main(int argc, char *argv[]) +{ + int good = 0, bad = 0; + + QCoreApplication app(argc, argv); + app.setOrganizationName("Sonic Visualiser"); + app.setApplicationName("test-model"); + + { + TestFFTModel t; + if (QTest::qExec(&t, argc, argv) == 0) ++good; + else ++bad; + } + + if (bad > 0) { + cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl; + return 1; + } else { + cerr << "All tests passed" << endl; + return 0; + } +} +