annotate base/test/svcore-base-test.cpp @ 1368:d163b04c3ec4

Set abandoned flag when bailing out of run() because init failed at the start; then check that flag in awaitOutputModels() so as not to get stuck on a wait condition
author Chris Cannam
date Wed, 18 Jan 2017 14:21:39 +0000
parents e2e66bfd4a88
children 667e369cfeab
rev   line source
Chris@879 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@879 2 /*
Chris@879 3 Sonic Visualiser
Chris@879 4 An audio file viewer and annotation editor.
Chris@879 5 Centre for Digital Music, Queen Mary, University of London.
Chris@879 6
Chris@879 7 This program is free software; you can redistribute it and/or
Chris@879 8 modify it under the terms of the GNU General Public License as
Chris@879 9 published by the Free Software Foundation; either version 2 of the
Chris@879 10 License, or (at your option) any later version. See the file
Chris@879 11 COPYING included with this distribution for more information.
Chris@879 12 */
Chris@879 13
Chris@883 14 #include "TestRangeMapper.h"
Chris@892 15 #include "TestPitch.h"
Chris@1022 16 #include "TestStringBits.h"
Chris@1262 17 #include "TestOurRealTime.h"
Chris@1262 18 #include "TestVampRealTime.h"
Chris@1265 19 #include "TestColumnOp.h"
Chris@879 20
Chris@879 21 #include <QtTest>
Chris@879 22
Chris@879 23 #include <iostream>
Chris@879 24
Chris@879 25 int main(int argc, char *argv[])
Chris@879 26 {
Chris@879 27 int good = 0, bad = 0;
Chris@879 28
Chris@879 29 QCoreApplication app(argc, argv);
Chris@879 30 app.setOrganizationName("Sonic Visualiser");
Chris@879 31 app.setApplicationName("test-svcore-base");
Chris@879 32
Chris@879 33 {
Chris@883 34 TestRangeMapper t;
Chris@879 35 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@879 36 else ++bad;
Chris@879 37 }
Chris@892 38 {
Chris@892 39 TestPitch t;
Chris@892 40 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@892 41 else ++bad;
Chris@892 42 }
Chris@1012 43 {
Chris@1262 44 TestOurRealTime t;
Chris@1262 45 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1262 46 else ++bad;
Chris@1262 47 }
Chris@1262 48 {
Chris@1262 49 TestVampRealTime t;
Chris@1012 50 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1012 51 else ++bad;
Chris@1012 52 }
Chris@1022 53 {
Chris@1022 54 TestStringBits t;
Chris@1022 55 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1022 56 else ++bad;
Chris@1022 57 }
Chris@1265 58 {
Chris@1265 59 TestColumnOp t;
Chris@1265 60 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1265 61 else ++bad;
Chris@1265 62 }
Chris@879 63
Chris@879 64 if (bad > 0) {
Chris@879 65 cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl;
Chris@879 66 return 1;
Chris@879 67 } else {
Chris@879 68 cerr << "All tests passed" << endl;
Chris@879 69 return 0;
Chris@879 70 }
Chris@879 71 }