Mercurial > hg > svcore
changeset 1260:24c0d4c5356e 3.0-integration
Rearrange svcore tests so they can all be built from the top level
author | Chris Cannam |
---|---|
date | Mon, 14 Nov 2016 17:53:16 +0000 |
parents | a4554bf41367 |
children | 968d54d893d2 |
files | base/test/files.pri base/test/main.cpp base/test/svcore-base-test.cpp base/test/test.pro data/fileio/test/files.pri data/fileio/test/main.cpp data/fileio/test/svcore-data-fileio-test.cpp data/fileio/test/test.pro data/model/test/files.pri data/model/test/main.cpp data/model/test/svcore-data-model-test.cpp |
diffstat | 11 files changed, 169 insertions(+), 224 deletions(-) [+] |
line wrap: on
line diff
--- /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
--- 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 <QtTest> - -#include <iostream> - -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; - } -}
--- /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 <QtTest> + +#include <iostream> + +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; + } +}
--- 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 -
--- /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
--- 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 <QtTest> - -#include <iostream> - -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; - } -} -
--- /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 <QtTest> + +#include <iostream> + +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; + } +} +
--- 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 }
--- /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
--- 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 <QtTest> - -#include <iostream> - -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; - } -} -
--- /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 <QtTest> + +#include <iostream> + +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; + } +} +