annotate base/test/svcore-base-test.cpp @ 1675:6804af71b7be osc-script

Write path points
author Chris Cannam
date Thu, 28 Mar 2019 10:39:02 +0000
parents 172bd3374adf
children 52705a328b34
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@1392 14 #include "TestLogRange.h"
Chris@883 15 #include "TestRangeMapper.h"
Chris@892 16 #include "TestPitch.h"
Chris@1407 17 #include "TestScaleTickIntervals.h"
Chris@1022 18 #include "TestStringBits.h"
Chris@1262 19 #include "TestOurRealTime.h"
Chris@1262 20 #include "TestVampRealTime.h"
Chris@1265 21 #include "TestColumnOp.h"
Chris@1573 22 #include "TestMovingMedian.h"
Chris@1615 23 #include "TestEventSeries.h"
Chris@1622 24 #include "StressEventSeries.h"
Chris@879 25
Chris@1601 26 #include "system/Init.h"
Chris@1601 27
Chris@879 28 #include <QtTest>
Chris@879 29
Chris@879 30 #include <iostream>
Chris@879 31
Chris@879 32 int main(int argc, char *argv[])
Chris@879 33 {
Chris@879 34 int good = 0, bad = 0;
Chris@879 35
Chris@1601 36 // This is necessary to ensure correct behaviour of snprintf with
Chris@1601 37 // older MinGW implementations
Chris@1601 38 svSystemSpecificInitialisation();
Chris@1601 39
Chris@879 40 QCoreApplication app(argc, argv);
Chris@1392 41 app.setOrganizationName("sonic-visualiser");
Chris@879 42 app.setApplicationName("test-svcore-base");
Chris@879 43
Chris@879 44 {
Chris@1429 45 TestRangeMapper t;
Chris@1429 46 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1429 47 else ++bad;
Chris@879 48 }
Chris@892 49 {
Chris@1429 50 TestPitch t;
Chris@1429 51 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1429 52 else ++bad;
Chris@892 53 }
Chris@1012 54 {
Chris@1262 55 TestOurRealTime t;
Chris@1429 56 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1429 57 else ++bad;
Chris@1262 58 }
Chris@1262 59 {
Chris@1262 60 TestVampRealTime t;
Chris@1429 61 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1429 62 else ++bad;
Chris@1012 63 }
Chris@1022 64 {
Chris@1429 65 TestStringBits t;
Chris@1429 66 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1429 67 else ++bad;
Chris@1022 68 }
Chris@1265 69 {
Chris@1429 70 TestColumnOp t;
Chris@1429 71 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1429 72 else ++bad;
Chris@1265 73 }
Chris@1392 74 {
Chris@1429 75 TestLogRange t;
Chris@1429 76 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1429 77 else ++bad;
Chris@1392 78 }
Chris@1407 79 {
Chris@1429 80 TestScaleTickIntervals t;
Chris@1429 81 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1429 82 else ++bad;
Chris@1407 83 }
Chris@1573 84 {
Chris@1573 85 TestMovingMedian t;
Chris@1573 86 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1573 87 else ++bad;
Chris@1573 88 }
Chris@1612 89 {
Chris@1615 90 TestEventSeries t;
Chris@1612 91 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1612 92 else ++bad;
Chris@1612 93 }
Chris@1622 94 /*
Chris@1622 95 {
Chris@1622 96 StressEventSeries t;
Chris@1622 97 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1622 98 else ++bad;
Chris@1622 99 }
Chris@1622 100 */
Chris@1622 101
Chris@879 102 if (bad > 0) {
Chris@1428 103 SVCERR << "\n********* " << bad << " test suite(s) failed!\n" << endl;
Chris@1428 104 return 1;
Chris@879 105 } else {
Chris@1428 106 SVCERR << "All tests passed" << endl;
Chris@1428 107 return 0;
Chris@879 108 }
Chris@879 109 }