Changeset 803 for mcbuilder/trunk/tests/TestBuilder.cpp
- Timestamp:
- 08/10/08 14:55:36 (5 months ago)
- Files:
-
- 1 modified
-
mcbuilder/trunk/tests/TestBuilder.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mcbuilder/trunk/tests/TestBuilder.cpp
r802 r803 191 191 builder->clean(currentProjectPath()); 192 192 while(builder->state() != QProcess::NotRunning) // wait until the clean is complete 193 QTest::qWait(10 );193 QTest::qWait(100); 194 194 195 195 QVERIFY( errorSpy.count() == 0); // make sure we didn't get any errors … … 199 199 int exitstatus = finishedSpy.at(i).at(1).toInt(); 200 200 if( exitcode != 0 || exitstatus != QProcess::NormalExit ) 201 QFAIL("clean exited unhappily."); 202 } 201 QFAIL("make/clean exited unhappily."); 202 } 203 204 QDir projDir(currentProjectPath()); 205 QString shortname = projDir.dirName().toLower(); 206 projDir.cd("build"); 207 QVERIFY(!projDir.exists(shortname + ".bin")); 208 QVERIFY(!projDir.exists(shortname + ".elf")); 209 QVERIFY(!projDir.exists(shortname + "_o.map")); 203 210 } 204 211 205 212 void TestBuilder::testBuild( ) 206 213 { 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
