annotate data/fileio/test/svcore-data-fileio-test.cpp @ 1443:cdb316c6a151 streaming-csv-writer

Fix typo of old name
author Lucas Thompson <dev@lucas.im>
date Tue, 17 Apr 2018 10:03:50 +0100
parents de385fed1197
children a12fd0456f0c
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@1359 16 #include "AudioFileWriterTest.h"
Chris@1345 17 #include "EncodingTest.h"
Chris@1359 18 #include "MIDIFileReaderTest.h"
dev@1430 19 #include "CSVStreamWriterTest.h"
Chris@756 20
dev@1437 21 #include <QtTest>
dev@1437 22
dev@1437 23 #include <iostream>
dev@1437 24
Chris@756 25 int main(int argc, char *argv[])
Chris@756 26 {
dev@1437 27 int good = 0, bad = 0;
dev@1437 28
Chris@1346 29 QString testDir;
Chris@1346 30
Chris@1346 31 #ifdef Q_OS_WIN
Chris@1346 32 // incredible to have to hardcode this, but I just can't figure out how to
Chris@1346 33 // get QMAKE_POST_LINK to add an arg to its command successfully on Windows
Chris@1346 34 testDir = "../sonic-visualiser/svcore/data/fileio/test";
Chris@1346 35 #endif
Chris@1346 36
Chris@1346 37 if (argc > 1) {
Chris@1346 38 cerr << "argc = " << argc << endl;
Chris@1346 39 testDir = argv[1];
Chris@1346 40 }
Chris@1346 41
Chris@1346 42 if (testDir != "") {
Chris@1346 43 cerr << "Setting test directory base path to \"" << testDir << "\"" << endl;
Chris@1346 44 }
Chris@1346 45
dev@1437 46 QCoreApplication app(argc, argv);
dev@1437 47 app.setOrganizationName("sonic-visualiser");
dev@1437 48 app.setApplicationName("test-fileio");
dev@1437 49
dev@1437 50 {
dev@1437 51 AudioFileReaderTest t(testDir);
dev@1437 52 if (QTest::qExec(&t, argc, argv) == 0) ++good;
dev@1437 53 else ++bad;
dev@1437 54 }
dev@1437 55
dev@1437 56 {
dev@1437 57 AudioFileWriterTest t(testDir);
dev@1437 58 if (QTest::qExec(&t, argc, argv) == 0) ++good;
dev@1437 59 else ++bad;
dev@1437 60 }
dev@1437 61
dev@1437 62 {
dev@1437 63 EncodingTest t(testDir);
dev@1437 64 if (QTest::qExec(&t, argc, argv) == 0) ++good;
dev@1437 65 else ++bad;
dev@1437 66 }
dev@1437 67
dev@1437 68 {
dev@1437 69 MIDIFileReaderTest t(testDir);
dev@1437 70 if (QTest::qExec(&t, argc, argv) == 0) ++good;
dev@1437 71 else ++bad;
dev@1437 72 }
dev@1437 73
dev@1437 74 {
dev@1437 75 CSVStreamWriterTest t;
dev@1437 76 if (QTest::qExec(&t, argc, argv) == 0) ++good;
dev@1437 77 else ++bad;
dev@1437 78 }
dev@1437 79
dev@1437 80 if (bad > 0) {
dev@1437 81 cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl;
dev@1437 82 return 1;
dev@1437 83 } else {
dev@1437 84 cerr << "All tests passed" << endl;
dev@1437 85 return 0;
dev@1437 86 }
Chris@756 87 }