| 207 | | |
| 208 | | } |
| 209 | | |
| 210 | | |
| | 214 | QSignalSpy finishedSpy(builder, SIGNAL(finished(int, QProcess::ExitStatus))); |
| | 215 | QSignalSpy errorSpy(builder, SIGNAL(error(QProcess::ProcessError))); |
| | 216 | |
| | 217 | builder->build(currentProjectPath()); |
| | 218 | while(builder->state() != QProcess::NotRunning) // wait until the build is complete |
| | 219 | QTest::qWait(100); |
| | 220 | |
| | 221 | QVERIFY( errorSpy.count() == 0); // make sure we didn't get any errors |
| | 222 | for( int i = 0; i < finishedSpy.count(); i++ ) |
| | 223 | { |
| | 224 | int exitcode = finishedSpy.at(i).at(0).toInt(); |
| | 225 | int exitstatus = finishedSpy.at(i).at(1).toInt(); |
| | 226 | if( exitcode != 0 || exitstatus != QProcess::NormalExit ) |
| | 227 | { |
| | 228 | qWarning("exit code: %d, exit status: %d", exitcode, exitstatus); |
| | 229 | QFAIL("make/build exited unhappily."); |
| | 230 | } |
| | 231 | } |
| | 232 | |
| | 233 | // now let's make sure our .bin and friends are where we expect them |
| | 234 | QDir projDir(currentProjectPath()); |
| | 235 | QString shortname = projDir.dirName().toLower(); |
| | 236 | projDir.cd("build"); |
| | 237 | QVERIFY(projDir.exists(shortname + ".bin")); |
| | 238 | QVERIFY(projDir.exists(shortname + ".elf")); |
| | 239 | QVERIFY(projDir.exists(shortname + "_o.map")); |
| | 240 | } |
| | 241 | |
| | 242 | |