Changeset 802

Show
Ignore:
Timestamp:
08/10/08 14:11:32 (3 months ago)
Author:
liamstask
Message:

- test the clean process

Location:
mcbuilder/trunk/tests
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • mcbuilder/trunk/tests/TestBuilder.cpp

    r801 r802  
    182182} 
    183183 
    184  
     184void TestBuilder::testClean() 
     185{ 
     186  qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus"); 
     187  qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError"); 
     188  QSignalSpy finishedSpy(builder, SIGNAL(finished(int, QProcess::ExitStatus))); 
     189  QSignalSpy errorSpy(builder, SIGNAL(error(QProcess::ProcessError))); 
     190   
     191  builder->clean(currentProjectPath()); 
     192  while(builder->state() != QProcess::NotRunning) // wait until the clean is complete 
     193    QTest::qWait(10); 
     194   
     195  QVERIFY( errorSpy.count() == 0); // make sure we didn't get any errors 
     196  for( int i = 0; i < finishedSpy.count(); i++ ) 
     197  { 
     198    int exitcode = finishedSpy.at(i).at(0).toInt(); 
     199    int exitstatus = finishedSpy.at(i).at(1).toInt(); 
     200    if( exitcode != 0 || exitstatus != QProcess::NormalExit ) 
     201      QFAIL("clean exited unhappily."); 
     202  } 
     203} 
     204 
     205void TestBuilder::testBuild( ) 
     206{ 
     207   
     208} 
     209 
     210 
  • mcbuilder/trunk/tests/TestBuilder.h

    r800 r802  
    4545  void testMakefile(); 
    4646  void testConfigFile(); 
     47  void testClean(); 
     48  void testBuild(); 
    4749}; 
    4850