annotate data/fileio/test/svcore-data-fileio-test.cpp @ 1430:b5283878cca2 streaming-csv-writer

Introduce a TestHelper which contains boiler plate for running a suite of QtTest style objects. Stub CSVStreamWriter and test to integrate into build.
author Lucas Thompson <dev@lucas.im>
date Tue, 17 Apr 2018 10:03:49 +0100
parents 667e369cfeab
children de385fed1197
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
dev@1430 15 #include "../../../test/TestHelper.h"
Chris@756 16 #include "AudioFileReaderTest.h"
Chris@1359 17 #include "AudioFileWriterTest.h"
Chris@1345 18 #include "EncodingTest.h"
Chris@1359 19 #include "MIDIFileReaderTest.h"
dev@1430 20 #include "CSVStreamWriterTest.h"
Chris@756 21
Chris@756 22 int main(int argc, char *argv[])
Chris@756 23 {
Chris@1346 24 QString testDir;
Chris@1346 25
Chris@1346 26 #ifdef Q_OS_WIN
Chris@1346 27 // incredible to have to hardcode this, but I just can't figure out how to
Chris@1346 28 // get QMAKE_POST_LINK to add an arg to its command successfully on Windows
Chris@1346 29 testDir = "../sonic-visualiser/svcore/data/fileio/test";
Chris@1346 30 #endif
Chris@1346 31
Chris@1346 32 if (argc > 1) {
Chris@1346 33 cerr << "argc = " << argc << endl;
Chris@1346 34 testDir = argv[1];
Chris@1346 35 }
Chris@1346 36
Chris@1346 37 if (testDir != "") {
Chris@1346 38 cerr << "Setting test directory base path to \"" << testDir << "\"" << endl;
Chris@1346 39 }
Chris@1346 40
dev@1430 41 return Test::startTestRunner(
dev@1430 42 {
dev@1430 43 Test::createFactory<AudioFileReaderTest>(testDir),
dev@1430 44 Test::createFactory<AudioFileWriterTest>(testDir),
dev@1430 45 Test::createFactory<EncodingTest>(testDir),
dev@1430 46 Test::createFactory<MIDIFileReaderTest>(testDir),
dev@1430 47 Test::createFactory<CSVStreamWriterTest>()
dev@1430 48 },
dev@1430 49 argc,
dev@1430 50 argv,
dev@1430 51 "test-fileio"
dev@1430 52 );
Chris@756 53 }