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@1345
|
16 #include "EncodingTest.h"
|
Chris@756
|
17
|
Chris@756
|
18 #include <QtTest>
|
Chris@756
|
19
|
Chris@756
|
20 #include <iostream>
|
Chris@756
|
21
|
Chris@756
|
22 int main(int argc, char *argv[])
|
Chris@756
|
23 {
|
Chris@756
|
24 int good = 0, bad = 0;
|
Chris@756
|
25
|
Chris@1346
|
26 QString testDir;
|
Chris@1346
|
27
|
Chris@1346
|
28 #ifdef Q_OS_WIN
|
Chris@1346
|
29 // incredible to have to hardcode this, but I just can't figure out how to
|
Chris@1346
|
30 // get QMAKE_POST_LINK to add an arg to its command successfully on Windows
|
Chris@1346
|
31 testDir = "../sonic-visualiser/svcore/data/fileio/test";
|
Chris@1346
|
32 #endif
|
Chris@1346
|
33
|
Chris@1346
|
34 if (argc > 1) {
|
Chris@1346
|
35 cerr << "argc = " << argc << endl;
|
Chris@1346
|
36 testDir = argv[1];
|
Chris@1346
|
37 }
|
Chris@1346
|
38
|
Chris@1346
|
39 if (testDir != "") {
|
Chris@1346
|
40 cerr << "Setting test directory base path to \"" << testDir << "\"" << endl;
|
Chris@1346
|
41 }
|
Chris@1346
|
42
|
Chris@756
|
43 QCoreApplication app(argc, argv);
|
Chris@756
|
44 app.setOrganizationName("Sonic Visualiser");
|
Chris@756
|
45 app.setApplicationName("test-fileio");
|
Chris@756
|
46
|
Chris@756
|
47 {
|
Chris@1346
|
48 AudioFileReaderTest t(testDir);
|
Chris@1346
|
49 if (QTest::qExec(&t, argc, argv) == 0) ++good;
|
Chris@1346
|
50 else ++bad;
|
Chris@756
|
51 }
|
Chris@756
|
52
|
Chris@1345
|
53 {
|
Chris@1346
|
54 EncodingTest t(testDir);
|
Chris@1346
|
55 if (QTest::qExec(&t, argc, argv) == 0) ++good;
|
Chris@1346
|
56 else ++bad;
|
Chris@1345
|
57 }
|
Chris@1345
|
58
|
Chris@756
|
59 if (bad > 0) {
|
Chris@843
|
60 cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl;
|
Chris@756
|
61 return 1;
|
Chris@756
|
62 } else {
|
Chris@843
|
63 cerr << "All tests passed" << endl;
|
Chris@756
|
64 return 0;
|
Chris@756
|
65 }
|
Chris@756
|
66 }
|
Chris@756
|
67
|