annotate data/fileio/test/svcore-data-fileio-test.cpp @ 1886:f803d3c33f76 tip

Switch off copious debug in soft synth driving
author Chris Cannam
date Fri, 14 Aug 2020 10:44:44 +0100
parents 2654bf447a84
children
rev   line source
Chris@756 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 This file copyright 2013 Chris Cannam.
Chris@879 7
Chris@879 8 This program is free software; you can redistribute it and/or
Chris@879 9 modify it under the terms of the GNU General Public License as
Chris@879 10 published by the Free Software Foundation; either version 2 of the
Chris@879 11 License, or (at your option) any later version. See the file
Chris@879 12 COPYING included with this distribution for more information.
Chris@879 13 */
Chris@756 14
Chris@756 15 #include "AudioFileReaderTest.h"
Chris@1698 16 #include "BogusAudioFileReaderTest.h"
Chris@1359 17 #include "AudioFileWriterTest.h"
Chris@1345 18 #include "EncodingTest.h"
Chris@1359 19 #include "MIDIFileReaderTest.h"
Chris@1524 20 #include "CSVFormatTest.h"
Chris@1867 21 #include "CSVReaderTest.h"
dev@1430 22 #include "CSVStreamWriterTest.h"
Chris@756 23
Chris@1601 24 #include "system/Init.h"
Chris@1601 25
Chris@756 26 #include <QtTest>
Chris@756 27
Chris@756 28 #include <iostream>
Chris@756 29
Chris@756 30 int main(int argc, char *argv[])
Chris@756 31 {
Chris@756 32 int good = 0, bad = 0;
Chris@756 33
Chris@1601 34 svSystemSpecificInitialisation();
Chris@1601 35
Chris@1346 36 QString testDir;
Chris@1346 37
Chris@1346 38 #ifdef Q_OS_WIN
Chris@1346 39 // incredible to have to hardcode this, but I just can't figure out how to
Chris@1346 40 // get QMAKE_POST_LINK to add an arg to its command successfully on Windows
Chris@1716 41 testDir = "svcore/data/fileio/test";
Chris@1346 42 #endif
Chris@1346 43
Chris@756 44 QCoreApplication app(argc, argv);
Chris@1392 45 app.setOrganizationName("sonic-visualiser");
Chris@1524 46 app.setApplicationName("test-svcore-data-fileio");
Chris@756 47
Chris@1607 48 if (argc == 3 && string(argv[1]) == "--testdir") {
Chris@1607 49 testDir = argv[2];
Chris@1607 50 argc = 1;
Chris@1607 51 }
Chris@1607 52
Chris@1504 53 if (testDir != "") {
Chris@1504 54 SVCERR << "Setting test directory base path to \"" << testDir << "\"" << endl;
Chris@1504 55 }
Chris@1504 56
Chris@756 57 {
Chris@1346 58 AudioFileReaderTest t(testDir);
Chris@1346 59 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1346 60 else ++bad;
Chris@756 61 }
Chris@756 62
Chris@1345 63 {
Chris@1359 64 AudioFileWriterTest t(testDir);
Chris@1359 65 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1359 66 else ++bad;
Chris@1359 67 }
Chris@1359 68
Chris@1359 69 {
Chris@1698 70 BogusAudioFileReaderTest t;
Chris@1698 71 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1698 72 else ++bad;
Chris@1698 73 }
Chris@1698 74
Chris@1698 75 {
Chris@1346 76 EncodingTest t(testDir);
Chris@1346 77 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1346 78 else ++bad;
Chris@1345 79 }
Chris@1345 80
Chris@1359 81 {
Chris@1359 82 MIDIFileReaderTest t(testDir);
Chris@1359 83 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1359 84 else ++bad;
Chris@1359 85 }
Chris@1359 86
dev@1437 87 {
Chris@1524 88 CSVFormatTest t(testDir);
Chris@1524 89 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1524 90 else ++bad;
Chris@1524 91 }
Chris@1524 92
Chris@1524 93 {
Chris@1867 94 CSVReaderTest t(testDir);
Chris@1867 95 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1867 96 else ++bad;
Chris@1867 97 }
Chris@1867 98
Chris@1867 99 {
dev@1437 100 CSVStreamWriterTest t;
dev@1437 101 if (QTest::qExec(&t, argc, argv) == 0) ++good;
dev@1437 102 else ++bad;
dev@1437 103 }
dev@1437 104
Chris@756 105 if (bad > 0) {
Chris@1524 106 SVCERR << "\n********* " << bad << " test suite(s) failed!\n" << endl;
Chris@1429 107 return 1;
Chris@756 108 } else {
Chris@1524 109 SVCERR << "All tests passed" << endl;
Chris@1429 110 return 0;
Chris@756 111 }
Chris@756 112 }
Chris@1714 113