Changeset 799
- Timestamp:
- 08/09/08 21:44:20 (3 months ago)
- Location:
- mcbuilder/trunk
- Files:
-
- 10 modified
-
include/Builder.h (modified) (3 diffs)
-
include/MainWindow.h (modified) (2 diffs)
-
mcbuilder.pro (modified) (1 diff)
-
resources/examples/Input-Output/AinToServo/AinToServo.xml (modified) (1 diff)
-
src/Builder.cpp (modified) (9 diffs)
-
tests/TestBuilder.cpp (modified) (1 diff)
-
tests/TestBuilder.h (modified) (3 diffs)
-
tests/TestProjectManager.cpp (modified) (1 diff)
-
tests/TestProjectManager.h (modified) (2 diffs)
-
tests/main.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mcbuilder/trunk/include/Builder.h
r721 r799 26 26 #include "BuildLog.h" 27 27 28 #ifdef MCBUILDER_TEST_SUITE 29 #include "TestBuilder.h" 30 #endif 31 28 32 class MainWindow; 29 33 class ProjectInfo; … … 32 36 { 33 37 Q_OBJECT 38 39 #ifdef MCBUILDER_TEST_SUITE 40 friend class TestBuilder; 41 #endif 42 34 43 public: 35 Builder( MainWindow *mainWindow, ProjectInfo *projInfo, BuildLog *buildLog);44 Builder( MainWindow *mainWindow, ProjectInfo *projInfo, BuildLog *buildLog ); 36 45 void build(QString projectName); 37 46 void clean(QString projectName); … … 63 72 bool matchInFunction(QString msg); 64 73 bool matchUndefinedRef(QString msg); 65 voidensureBuildDirExists(QString projPath);74 QString ensureBuildDirExists(QString projPath); 66 75 bool parseVersionNumber( int *maj, int *min, int *bld ); 67 void loadDependencies(QString project);76 void loadDependencies(QString libsDir, QString project); 68 77 void getLibrarySources(QString libdir, QStringList *thmb, QStringList *arm); 69 78 QString filteredPath(QString path); -
mcbuilder/trunk/include/MainWindow.h
r730 r799 34 34 #include "BuildLog.h" 35 35 #include "ProjectManager.h" 36 37 #ifdef MCBUILDER_TEST_SUITE 38 #include "TestBuilder.h" 39 #endif 36 40 37 41 class Preferences; … … 136 140 void onUpdate(); 137 141 void onVisitForum(); 142 143 #ifdef MCBUILDER_TEST_SUITE 144 friend class TestBuilder; 145 #endif 138 146 }; 139 147 -
mcbuilder/trunk/mcbuilder.pro
r798 r799 98 98 99 99 test_suite { 100 TARGET = mcbuilder_test101 DEFINES += MCBUILDER_TEST_SUITE102 CONFIG += qtestlib103 CONFIG -= release # always, no matter what it's set to above104 DESTDIR = tests100 TARGET = mcbuilder_test 101 DEFINES += MCBUILDER_TEST_SUITE 102 CONFIG += qtestlib 103 CONFIG -= release # always, no matter what it's set to above 104 DESTDIR = tests 105 105 INCLUDEPATH += tests 106 106 107 SOURCES -= src/main.cpp107 SOURCES -= src/main.cpp 108 108 109 109 SOURCES += tests/main.cpp \ -
mcbuilder/trunk/resources/examples/Input-Output/AinToServo/AinToServo.xml
r728 r799 16 16 Most normal files are THUMB, while ISRs and startup code are usually ARM. --> 17 17 <files> 18 <file type="thumb" >resources/cores/makecontroller/freertos/tasks.c</file> 19 <file type="thumb" >resources/cores/makecontroller/freertos/queue.c</file> 20 <file type="thumb" >resources/cores/makecontroller/freertos/list.c</file> 21 <file type="thumb" >resources/cores/makecontroller/freertos/portable/GCC/ARM7_AT91SAM7S/port.c</file> 22 <file type="thumb" >resources/cores/makecontroller/startup/extras.c</file> 23 <file type="thumb" >resources/cores/makecontroller/freertos/portable/MemMang/heap_2.c</file> 24 <file type="thumb" >resources/cores/makecontroller/makingthings/main.c</file> 25 <file type="thumb" >resources/cores/makecontroller/makingthings/eeprom.c</file> 26 <file type="thumb" >resources/cores/makecontroller/makingthings/analogin.c</file> 27 <file type="thumb" >resources/cores/makecontroller/makingthings/serial.c</file> 28 <file type="thumb" >resources/cores/makecontroller/makingthings/pwm.c</file> 29 <file type="thumb" >resources/cores/makecontroller/makingthings/spi.c</file> 30 <file type="thumb" >resources/cores/makecontroller/makingthings/USB-CDC.c</file> 31 <file type="thumb" >resources/cores/makecontroller/makingthings/rtos.c</file> 32 <file type="thumb" >resources/cores/makecontroller/makingthings/usb.c</file> 33 <file type="thumb" >resources/cores/makecontroller/makingthings/network.c</file> 34 <file type="thumb" >resources/cores/makecontroller/makingthings/system.c</file> 35 <file type="thumb" >resources/cores/makecontroller/makingthings/io.c</file> 36 <file type="thumb" >resources/cores/makecontroller/makingthings/led.c</file> 37 <file type="thumb" >resources/cores/makecontroller/makingthings/timer.c</file> 38 <file type="thumb" >resources/cores/makecontroller/makingthings/fasttimer.c</file> 39 <file type="thumb" >resources/cores/makecontroller/makingthings/debugosc.c</file> 40 <file type="thumb" >resources/cores/makecontroller/makingthings/can.c</file> 41 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/tcp_out.c</file> 42 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/inet.c</file> 43 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/mem.c</file> 44 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/memp.c</file> 45 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/netif.c</file> 46 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/pbuf.c</file> 47 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/raw.c</file> 48 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/stats.c</file> 49 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/sys.c</file> 50 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/tcp.c</file> 51 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/tcp_in.c</file> 52 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/ipv4/ip.c</file> 53 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/ipv4/ip_addr.c</file> 54 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/ipv4/icmp.c</file> 55 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/dhcp.c</file> 56 <file type="thumb" >resources/cores/makecontroller/lwip/src/api/tcpip.c</file> 57 <file type="thumb" >resources/cores/makecontroller/lwip/src/api/api_msg.c</file> 58 <file type="thumb" >resources/cores/makecontroller/lwip/src/api/err.c</file> 59 <file type="thumb" >resources/cores/makecontroller/lwip/src/api/api_lib.c</file> 60 <file type="thumb" >resources/cores/makecontroller/lwip/src/netif/etharp.c</file> 61 <file type="thumb" >resources/cores/makecontroller/lwip/contrib/port/FreeRTOS/AT91SAM7X/sys_arch.c</file> 62 <file type="thumb" >resources/cores/makecontroller/lwip/src/netif/ethernetif.c</file> 63 <file type="thumb" >resources/cores/makecontroller/makingthings/SAM7_EMAC.c</file> 64 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/udp.c</file> 65 <file type="thumb" >resources/cores/makecontroller/lwip/src/core/ipv4/ip_frag.c</file> 66 <file type="thumb" >resources/cores/makecontroller/makingthings/osc.c</file> 67 <file type="thumb" >resources/cores/makecontroller/makingthings/osc_patternmatch.c</file> 68 <file type="arm" >resources/cores/makecontroller/freertos/portable/GCC/ARM7_AT91SAM7S/portISR.c</file> 69 <file type="arm" >resources/cores/makecontroller/makingthings/SAM7_EMAC_ISR.c</file> 70 <file type="arm" >resources/cores/makecontroller/makingthings/USBIsr.c</file> 71 <file type="arm" >resources/cores/makecontroller/startup/Cstartup_SAM7.c</file> 72 <file type="arm" >resources/cores/makecontroller/makingthings/analogin_isr.c</file> 73 <file type="arm" >resources/cores/makecontroller/makingthings/fasttimer_isr.c</file> 74 <file type="arm" >resources/cores/makecontroller/makingthings/serial_isr.c</file> 75 <file type="arm" >resources/cores/makecontroller/makingthings/timer_isr.c</file> 76 <file type="arm" >resources/cores/makecontroller/makingthings/can_isr.c</file> 18 <file type="thumb" >cores/makecontroller/core/freertos/tasks.c</file> 19 <file type="thumb" >cores/makecontroller/core/freertos/queue.c</file> 20 <file type="thumb" >cores/makecontroller/core/freertos/list.c</file> 21 <file type="thumb" >cores/makecontroller/core/freertos/portable/GCC/ARM7_AT91SAM7S/port.c</file> 22 <file type="thumb" >cores/makecontroller/core/startup/extras.c</file> 23 <file type="thumb" >cores/makecontroller/core/freertos/portable/MemMang/heap_2.c</file> 24 <file type="thumb" >cores/makecontroller/core/makingthings/main.c</file> 25 <file type="thumb" >cores/makecontroller/core/makingthings/eeprom.c</file> 26 <file type="thumb" >cores/makecontroller/core/makingthings/analogin.c</file> 27 <file type="thumb" >cores/makecontroller/core/makingthings/serial.c</file> 28 <file type="thumb" >cores/makecontroller/core/makingthings/pwm.c</file> 29 <file type="thumb" >cores/makecontroller/core/makingthings/spi.c</file> 30 <file type="thumb" >cores/makecontroller/core/makingthings/USB-CDC.c</file> 31 <file type="thumb" >cores/makecontroller/core/makingthings/rtos.c</file> 32 <file type="thumb" >cores/makecontroller/core/makingthings/usb.c</file> 33 <file type="thumb" >cores/makecontroller/core/makingthings/network.c</file> 34 <file type="thumb" >cores/makecontroller/core/makingthings/system.c</file> 35 <file type="thumb" >cores/makecontroller/core/makingthings/io.c</file> 36 <file type="thumb" >cores/makecontroller/core/makingthings/led.c</file> 37 <file type="thumb" >cores/makecontroller/core/makingthings/timer.c</file> 38 <file type="thumb" >cores/makecontroller/core/makingthings/fasttimer.c</file> 39 <file type="thumb" >cores/makecontroller/core/makingthings/debugosc.c</file> 40 <file type="thumb" >cores/makecontroller/core/lwip/src/core/tcp_out.c</file> 41 <file type="thumb" >cores/makecontroller/core/lwip/src/core/ipv4/inet.c</file> 42 <file type="thumb" >cores/makecontroller/core/lwip/src/core/mem.c</file> 43 <file type="thumb" >cores/makecontroller/core/lwip/src/core/memp.c</file> 44 <file type="thumb" >cores/makecontroller/core/lwip/src/core/netif.c</file> 45 <file type="thumb" >cores/makecontroller/core/lwip/src/core/pbuf.c</file> 46 <file type="thumb" >cores/makecontroller/core/lwip/src/core/raw.c</file> 47 <file type="thumb" >cores/makecontroller/core/lwip/src/core/stats.c</file> 48 <file type="thumb" >cores/makecontroller/core/lwip/src/core/sys.c</file> 49 <file type="thumb" >cores/makecontroller/core/lwip/src/core/tcp.c</file> 50 <file type="thumb" >cores/makecontroller/core/lwip/src/core/tcp_in.c</file> 51 <file type="thumb" >cores/makecontroller/core/lwip/src/core/init.c</file> 52 <file type="thumb" >cores/makecontroller/core/lwip/src/core/ipv4/ip.c</file> 53 <file type="thumb" >cores/makecontroller/core/lwip/src/core/ipv4/ip_addr.c</file> 54 <file type="thumb" >cores/makecontroller/core/lwip/src/core/ipv4/icmp.c</file> 55 <file type="thumb" >cores/makecontroller/core/lwip/src/core/ipv4/inet_chksum.c</file> 56 <file type="thumb" >cores/makecontroller/core/lwip/src/core/dhcp.c</file> 57 <file type="thumb" >cores/makecontroller/core/lwip/src/core/dns.c</file> 58 <file type="thumb" >cores/makecontroller/core/lwip/src/api/tcpip.c</file> 59 <file type="thumb" >cores/makecontroller/core/lwip/src/api/api_msg.c</file> 60 <file type="thumb" >cores/makecontroller/core/lwip/src/api/err.c</file> 61 <file type="thumb" >cores/makecontroller/core/lwip/src/api/api_lib.c</file> 62 <file type="thumb" >cores/makecontroller/core/lwip/src/netif/etharp.c</file> 63 <file type="thumb" >cores/makecontroller/core/lwip/contrib/port/FreeRTOS/AT91SAM7X/sys_arch.c</file> 64 <file type="thumb" >cores/makecontroller/core/lwip/src/netif/ethernetif.c</file> 65 <file type="thumb" >cores/makecontroller/core/makingthings/SAM7_EMAC.c</file> 66 <file type="thumb" >cores/makecontroller/core/lwip/src/core/udp.c</file> 67 <file type="thumb" >cores/makecontroller/core/lwip/src/core/ipv4/ip_frag.c</file> 68 <file type="thumb" >cores/makecontroller/core/makingthings/osc.c</file> 69 <file type="thumb" >cores/makecontroller/core/makingthings/osc_patternmatch.c</file> 70 <file type="arm" >cores/makecontroller/core/freertos/portable/GCC/ARM7_AT91SAM7S/portISR.c</file> 71 <file type="arm" >cores/makecontroller/core/makingthings/SAM7_EMAC_ISR.c</file> 72 <file type="arm" >cores/makecontroller/core/makingthings/USBIsr.c</file> 73 <file type="arm" >cores/makecontroller/core/startup/Cstartup_SAM7.c</file> 74 <file type="arm" >cores/makecontroller/core/makingthings/analogin_isr.c</file> 75 <file type="arm" >cores/makecontroller/core/makingthings/fasttimer_isr.c</file> 76 <file type="arm" >cores/makecontroller/core/makingthings/serial_isr.c</file> 77 <file type="arm" >cores/makecontroller/core/makingthings/timer_isr.c</file> 77 78 <file type="thumb" >AinToServo.c</file> 78 79 </files> 79 80 <!-- Directories to include in the build process --> 80 81 <include_dirs> 81 <dir> resources/cores/makecontroller/makingthings</dir>82 <dir> resources/cores/makecontroller/lwip/src/include</dir>83 <dir> resources/cores/makecontroller/lwip/contrib/port/FreeRTOS/AT91SAM7X</dir>84 <dir> resources/cores/makecontroller/freertos/include</dir>85 <dir> resources/cores/makecontroller/freertos/portable/GCC/ARM7_AT91SAM7S</dir>86 <dir> resources/cores/makecontroller/lwip/src/include/ipv4</dir>82 <dir>cores/makecontroller/core/makingthings</dir> 83 <dir>cores/makecontroller/core/lwip/src/include</dir> 84 <dir>cores/makecontroller/core/lwip/contrib/port/FreeRTOS/AT91SAM7X</dir> 85 <dir>cores/makecontroller/core/freertos/include</dir> 86 <dir>cores/makecontroller/core/freertos/portable/GCC/ARM7_AT91SAM7S</dir> 87 <dir>cores/makecontroller/core/lwip/src/include/ipv4</dir> 87 88 </include_dirs> 88 89 </project> -
mcbuilder/trunk/src/Builder.cpp
r797 r799 23 23 #include "ConsoleItem.h" 24 24 25 #define LIBRARIES_DIR "cores/makecontroller/libraries" 26 25 27 /* 26 28 Builder takes a project and turns it into a binary executable. … … 28 30 and Properties for this project. 29 31 */ 30 Builder::Builder( MainWindow *mainWindow, ProjectInfo *projInfo, BuildLog *buildLog) : QProcess( 0 )32 Builder::Builder( MainWindow *mainWindow, ProjectInfo *projInfo, BuildLog *buildLog ) : QProcess( 0 ) 31 33 { 32 34 this->mainWindow = mainWindow; 33 35 this->projInfo = projInfo; 34 36 this->buildLog = buildLog; 37 35 38 connect(this, SIGNAL(readyReadStandardOutput()), this, SLOT(filterOutput())); 36 39 connect(this, SIGNAL(readyReadStandardError()), this, SLOT(filterErrorOutput())); … … 54 57 } 55 58 currentProjectPath = projectName; 56 ensureBuildDirExists(currentProjectPath); // make sure we have a build dir57 59 setWorkingDirectory(QDir(currentProjectPath).filePath("build")); 58 loadDependencies( currentProjectPath); // this loads up the list of libraries this project depends on60 loadDependencies(LIBRARIES_DIR, currentProjectPath); // this loads up the list of libraries this project depends on 59 61 createMakefile(currentProjectPath); // create a Makefile for this project, given the dependencies 60 62 createConfigFile(currentProjectPath); // create a config file based on the Properties for this project … … 107 109 /* 108 110 If there's no build directory within a project, create one. 109 */ 110 void Builder::ensureBuildDirExists(QString projPath) 111 Return the build dir's path. 112 */ 113 QString Builder::ensureBuildDirExists(QString projPath) 111 114 { 112 115 QDir dir(projPath); 113 116 if(!dir.exists("build")) 114 117 dir.mkdir("build"); 118 return dir.filePath("build"); 115 119 } 116 120 … … 184 188 { 185 189 bool retval = true; 186 QDir buildDir( projectPath + "/build");190 QDir buildDir( ensureBuildDirExists(projectPath) ); 187 191 QFile makefile(buildDir.filePath("Makefile")); 188 192 if(makefile.open(QIODevice::WriteOnly | QFile::Text)) … … 250 254 251 255 // add in the directories for the required libraries 252 QDir libdir(QDir::current().filePath( "cores/makecontroller/libraries"));256 QDir libdir(QDir::current().filePath(LIBRARIES_DIR)); 253 257 foreach(Library lib, libraries) 254 258 tofile << " -I" << filteredPath(libdir.filePath(lib.name)) << " \\" << endl; … … 484 488 while(!outline.isNull()) 485 489 { 486 qDebug("msg: %s", qPrintable(outline));490 //qDebug("msg: %s", qPrintable(outline)); 487 491 QStringList sl = outline.split(" "); 488 492 if(sl.first().endsWith("arm-elf-gcc") && sl.at(1) == "-c") … … 522 526 while(!outline.isNull()) 523 527 { 524 qDebug("err: %s", qPrintable(outline));528 //qDebug("err: %s", qPrintable(outline)); 525 529 QString line = outline; 526 530 outline = outstream.readLine(); … … 648 652 Create a Library structure for each library and store it in our class member "libraries" 649 653 */ 650 void Builder::loadDependencies(QString project)654 void Builder::loadDependencies(QString libsDir, QString project) 651 655 { 652 656 QDir projDir(project); 653 657 QStringList srcFiles = projDir.entryList(QStringList() << "*.c" << "*.h"); 654 QDir libDir(QDir::current().filePath( "cores/makecontroller/libraries"));658 QDir libDir(QDir::current().filePath(libsDir)); 655 659 QStringList libDirs = libDir.entryList(QStringList(), QDir::Dirs | QDir::NoDotAndDotDot); 656 660 -
mcbuilder/trunk/tests/TestBuilder.cpp
r798 r799 1 /********************************************************************************* 1 2 3 Copyright 2008 MakingThings 4 5 Licensed under the Apache License, 6 Version 2.0 (the "License"); you may not use this file except in compliance 7 with the License. You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software distributed 12 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 13 CONDITIONS OF ANY KIND, either express or implied. See the License for 14 the specific language governing permissions and limitations under the License. 15 16 *********************************************************************************/ 2 17 3 18 #include "TestBuilder.h" 19 #include "ProjectInfo.h" 4 20 21 #define TEST_PROJECT "resources/examples/Input-Output/AinToServo" 22 23 TestBuilder::TestBuilder( MainWindow* window ) 24 { 25 this->window = window; 26 } 27 28 /* 29 util - get the "current" project...just our test project. 30 */ 31 QString TestBuilder::currentProjectPath() 32 { 33 QDir proj = QDir::current().filePath(TEST_PROJECT); 34 return proj.path(); 35 } 36 37 /* 38 This is run before any other tests. 39 */ 5 40 void TestBuilder::initTestCase() 6 41 { 42 builder = window->builder; 43 builder->currentProjectPath = currentProjectPath(); 44 } 45 46 /* 47 Take an example project and load its libraries. 48 Make sure the appropriate libraries are loaded, no more, no less. 49 */ 50 void TestBuilder::loadLibs() 51 { 52 // change the path to libraries if you need to for your setup...not sure how best to automatically do that 53 QDir libDir = QDir::current().filePath("build/Debug/cores/makecontroller/libraries"); 54 builder->loadDependencies(libDir.path(), currentProjectPath()); 55 QList<Builder::Library> libs = builder->libraries; 56 // the AinToServo example only pulls in one library, servo 57 QVERIFY(libs.size() == 1); 58 QVERIFY(libs.at(0).name == QString("servo")); 59 // only expect there to be one thumb src file - servo.c 60 QVERIFY(libs.at(0).thumb_src.size() == 1); 61 QVERIFY(libs.at(0).arm_src.size() == 0); 62 } 63 64 /* 65 Create a Makefile and verify that all the files in the project file are included, 66 the appropriate include dirs are there, taking into account any loaded libraries. 67 */ 68 void TestBuilder::testMakefile() 69 { 70 builder->createMakefile(currentProjectPath()); 71 QDir projDir(currentProjectPath()); 72 QFile makefile(projDir.filePath("build/Makefile")); 73 QVERIFY(makefile.exists()); 7 74 75 QStringList projectFiles; // a list of all the files in the project file 76 QFile projectFile(projDir.filePath(projDir.dirName() + ".xml")); 77 QDomDocument projectDoc; 78 if(projectDoc.setContent(&projectFile)) // read the project file and extract all the file paths 79 { 80 QDomNodeList files = projectDoc.elementsByTagName("files").at(0).childNodes(); 81 for(int i = 0; i < files.count(); i++) 82 projectFiles.append(builder->filteredPath(files.at(i).toElement().text())); 83 } 84 QVERIFY(projectFiles.size()); // make sure we got something 85 86 QStringList makeFiles; // list of files in the Makefile 87 QVERIFY(makefile.open(QFile::ReadOnly | QFile::Text)); 88 QTextStream in(&makefile); 89 QString makeLine = in.readLine(); 90 static const int BEGIN = 0; 91 static const int FILES = 1; 92 int state = BEGIN; 93 while(!makeLine.isNull()) 94 { 95 switch(state) 96 { 97 case BEGIN: 98 if(makeLine.startsWith("THUMB_SRC") ) 99 state = FILES; 100 break; 101 case FILES: 102 if(makeLine.startsWith("INCLUDEDIRS")) 103 state = BEGIN; 104 else 105 { 106 if(!makeLine.isEmpty() && !makeLine.startsWith("ARM_SRC")) 107 makeFiles.append(makeLine.remove("\\").trimmed()); 108 } 109 break; 110 } 111 makeLine = in.readLine(); 112 } 113 QVERIFY(makeFiles.size()); // make sure we got something 114 115 // now, let's compare our lists 116 // it's possible (probable) that the list of files in the makefiles list will be 117 // longer since it will have libraries files added as part of the build process 118 // that are not included in the project file. 119 int matches = 0; 120 int libraryFiles = 0; 121 foreach(QString file, makeFiles) 122 { 123 if(projectFiles.contains(file)) 124 matches++; 125 else if(file.contains("cores/makecontroller/libraries")) 126 libraryFiles++; 127 } 128 //qDebug("makefiles: %d, projectfiles: %d, matches: %d", makeFiles.size(), projectFiles.size(), matches); 129 QVERIFY( matches == (makeFiles.size() - libraryFiles)); 8 130 } 9 131 10 132 11 -
mcbuilder/trunk/tests/TestBuilder.h
r798 r799 1 /********************************************************************************* 2 3 Copyright 2008 MakingThings 4 5 Licensed under the Apache License, 6 Version 2.0 (the "License"); you may not use this file except in compliance 7 with the License. You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software distributed 12 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 13 CONDITIONS OF ANY KIND, either express or implied. See the License for 14 the specific language governing permissions and limitations under the License. 15 16 *********************************************************************************/ 17 18 #ifndef TEST_BUILDER_H 19 #define TEST_BUILDER_H 1 20 2 21 #include <QtTest/QtTest> 22 #include "MainWindow.h" 3 23 #include "Builder.h" 24 25 class Builder; 4 26 5 27 /* … … 10 32 Q_OBJECT 11 33 34 public: 35 TestBuilder( MainWindow* window ); 36 QString currentProjectPath(); 37 12 38 private: 13 39 Builder* builder; 40 MainWindow* window; 14 41 15 42 private slots: 16 43 void initTestCase(); 44 void loadLibs(); 45 void testMakefile(); 17 46 }; 47 48 #endif // TEST_BUILDER_H 18 49 19 50 … … 22 53 23 54 24 25 -
mcbuilder/trunk/tests/TestProjectManager.cpp
r798 r799 1 1 /********************************************************************************* 2 3 Copyright 2008 MakingThings 4 5 Licensed under the Apache License, 6 Version 2.0 (the "License"); you may not use this file except in compliance 7 with the License. You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software distributed 12 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 13 CONDITIONS OF ANY KIND, either express or implied. See the License for 14 the specific language governing permissions and limitations under the License. 15 16 *********************************************************************************/ 2 17 3 18 #include "TestProjectManager.h" -
mcbuilder/trunk/tests/TestProjectManager.h
r798 r799 1 /********************************************************************************* 1 2 3 Copyright 2008 MakingThings 4 5 Licensed under the Apache License, 6 Version 2.0 (the "License"); you may not use this file except in compliance 7 with the License. You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software distributed 12 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 13 CONDITIONS OF ANY KIND, either express or implied. See the License for 14 the specific language governing permissions and limitations under the License. 15 16 *********************************************************************************/ 17 18 #ifndef TEST_PROJECT_MANAGER_H 19 #define TEST_PROJECT_MANAGER_H 2 20 3 21 … … 33 51 }; 34 52 53 #endif // TEST_PROJECT_MANAGER_H 35 54 36 55 -
mcbuilder/trunk/tests/main.cpp
r798 r799 1 /********************************************************************************* 1 2 3 Copyright 2008 MakingThings 4 5 Licensed under the Apache License, 6 Version 2.0 (the "License"); you may not use this file except in compliance 7 with the License. You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software distributed 12 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 13 CONDITIONS OF ANY KIND, either express or implied. See the License for 14 the specific language governing permissions and limitations under the License. 15 16 *********************************************************************************/ 2 17 3 18 #include <QtTest/QtTest> 19 #include <QApplication> 20 #include "MainWindow.h" 4 21 #include "TestProjectManager.h" 5 22 #include "TestBuilder.h" 6 23 7 int main(int argc, char** argv) 24 /* 25 A test suite that fires off each unit test in succession. 26 */ 27 int main(int argc, char* argv[]) 8 28 { 9 29 (void)argc; 10 30 (void)argv; 31 QApplication app(argc, argv); 32 MainWindow window; 11 33 12 34 TestProjectManager testProjectManager; 13 35 QTest::qExec(&testProjectManager); 14 36 15 TestBuilder testBuilder ;37 TestBuilder testBuilder(&window); 16 38 QTest::qExec(&testBuilder); 17 39 }
