-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
38 lines (37 loc) · 1.11 KB
/
main.cpp
File metadata and controls
38 lines (37 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <QString>
#include "manualtester.h"
#include <QFile>
#include <stdio.h>
int main(int argc, char *argv[])
{
QString launcher;
QString testDir;
QString pwd;
QFile file("manualtester.conf");
if ( argc == 3 ) {
launcher = QString( argv[1] );
testDir = QString( argv[2] );
}
QApplication a(argc, argv);
a.setQuitOnLastWindowClosed(false);
QStringList fileList;
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)){
std::cout << argv[3] <<": No such file or directory!\n\nRun ./generateTestFile.sh before running this!";
return 1;
}
QTextStream in(&file);
pwd = in.readLine();
if (launcher.isEmpty()) launcher = in.readLine();
else in.readLine();
if (testDir.isEmpty()) testDir = in.readLine();
else in.readLine();
while (!in.atEnd()){
fileList << in.readLine();
}
fprintf(stderr,"launcher = %s\n",launcher.toAscii().data());
fprintf(stderr,"testDir = %s\n",testDir.toAscii().data());
ManualTester tester(&a);
tester.setup(pwd, launcher,testDir,fileList);
tester.start();
return a.exec();
}