Mercurial > hg > svcore
comparison data/fileio/test/svcore-data-fileio-test.cpp @ 1346:75ad55315db4 3.0-integration
More work on getting tests (especially file encoding ones) running on Windows. Various problems here to do with interaction with test filenames in Hg repos
author | Chris Cannam |
---|---|
date | Fri, 06 Jan 2017 15:44:55 +0000 |
parents | c0cdacc47f4e |
children | 1c9bbbb6116a |
comparison
equal
deleted
inserted
replaced
1345:c0cdacc47f4e | 1346:75ad55315db4 |
---|---|
21 | 21 |
22 int main(int argc, char *argv[]) | 22 int main(int argc, char *argv[]) |
23 { | 23 { |
24 int good = 0, bad = 0; | 24 int good = 0, bad = 0; |
25 | 25 |
26 QString testDir; | |
27 | |
28 #ifdef Q_OS_WIN | |
29 // incredible to have to hardcode this, but I just can't figure out how to | |
30 // get QMAKE_POST_LINK to add an arg to its command successfully on Windows | |
31 testDir = "../sonic-visualiser/svcore/data/fileio/test"; | |
32 #endif | |
33 | |
34 if (argc > 1) { | |
35 cerr << "argc = " << argc << endl; | |
36 testDir = argv[1]; | |
37 } | |
38 | |
39 if (testDir != "") { | |
40 cerr << "Setting test directory base path to \"" << testDir << "\"" << endl; | |
41 } | |
42 | |
26 QCoreApplication app(argc, argv); | 43 QCoreApplication app(argc, argv); |
27 app.setOrganizationName("Sonic Visualiser"); | 44 app.setOrganizationName("Sonic Visualiser"); |
28 app.setApplicationName("test-fileio"); | 45 app.setApplicationName("test-fileio"); |
29 | 46 |
30 { | 47 { |
31 AudioFileReaderTest t; | 48 AudioFileReaderTest t(testDir); |
32 if (QTest::qExec(&t, argc, argv) == 0) ++good; | 49 if (QTest::qExec(&t, argc, argv) == 0) ++good; |
33 else ++bad; | 50 else ++bad; |
34 } | 51 } |
35 | 52 |
36 { | 53 { |
37 EncodingTest t; | 54 EncodingTest t(testDir); |
38 if (QTest::qExec(&t, argc, argv) == 0) ++good; | 55 if (QTest::qExec(&t, argc, argv) == 0) ++good; |
39 else ++bad; | 56 else ++bad; |
40 } | 57 } |
41 | 58 |
42 if (bad > 0) { | 59 if (bad > 0) { |
43 cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl; | 60 cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl; |
44 return 1; | 61 return 1; |