Changeset 2189

Show
Ignore:
Timestamp:
07/26/08 11:39:32 (4 months ago)
Author:
pasnox
Message:

Import dev branches

Location:
v2/trunk
Files:
1 added
93 modified

Legend:

Unmodified
Added
Removed
  • v2/trunk/coveragemeter/ui/UITestReport.cpp

    r1518 r2189  
    11/**************************************************************************** 
    2 ** 
    3 **              Created using Monkey Studio v1.8.1.0 
    4 ** Authors    : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 
    5 ** Project   : Coverage Meter 
    6 ** FileName  : UITestReport.cpp 
    7 ** Date      : 2008-01-14T00:35:51 
    8 ** License   : GPL 
    9 ** Comment   : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 
    10 ** Home Page : http://www.monkeystudio.org 
    11 ** 
    12     Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
     2        Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
    133 
    14     This program is free software; you can redistribute it and/or modify 
    15     it under the terms of the GNU General Public License as published by 
    16     the Free Software Foundation; either version 2 of the License, or 
    17     (at your option) any later version. 
     4        This program is free software; you can redistribute it and/or modify 
     5        it under the terms of the GNU General Public License as published by 
     6        the Free Software Foundation; either version 2 of the License, or 
     7        (at your option) any later version. 
    188 
    19     This program is distributed in the hope that it will be useful, 
    20     but WITHOUT ANY WARRANTY; without even the implied warranty of 
    21     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    22     GNU General Public License for more details. 
     9        This program is distributed in the hope that it will be useful, 
     10        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     12        GNU General Public License for more details. 
    2313 
    24     You should have received a copy of the GNU General Public License 
    25     along with this program; if not, write to the Free Software 
    26     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
     14        You should have received a copy of the GNU General Public License 
     15        along with this program; if not, write to the Free Software 
     16        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    2717** 
    2818****************************************************************************/ 
     
    5545        QFileInfo coverageFile(BasePlugin::codeCoverageFile()); 
    5646        descriptionText = "<HTML><BODY>"  
    57                       "<H1>Test Report Generation for MonkeyStudio</H1>" 
    58                       "<P>" 
    59                       "Process as follows:" 
    60                       "<UL>" 
    61                         "<LI>Do some test operations.</LI>" 
    62                         "<LI>Press the <TT>PAUSE</TT> key or exit MonkeyStudio. This dialog appears.</LI>" 
    63                         "<LI>Enter a title for your test and its state (Passed or Failed).</LI>" 
    64                         "<LI>Press OK to save the report.</LI>" 
    65                       "</UL>" 
    66                       "</P><P>" 
    67                       "The report contains code coverage data generated using " 
    68                       "<I>CoverageMeter</I>&nbsp;(<TT>http://www.coveragemeter.com</TT>). " 
    69                       "This report does not contain any kind of information about " 
    70                       "the project developped using MonkeyStudio." 
    71                       "</P><P>" 
    72                       "When the testing phase is finished, send the contain of the directory " 
    73                       "'<TT>"+coverageFile.dir().absolutePath()+"</TT>' " 
    74                       "to xxxx@xxx.xx"  
    75                       "</P>" 
    76                       "</BODY></HTML>"; 
     47                                                "<H1>Test Report Generation for MonkeyStudio</H1>" 
     48                                                "<P>" 
     49                                                "Process as follows:" 
     50                                                "<UL>" 
     51                                                        "<LI>Do some test operations.</LI>" 
     52                                                        "<LI>Press the <TT>PAUSE</TT> key or exit MonkeyStudio. This dialog appears.</LI>" 
     53                                                        "<LI>Enter a title for your test and its state (Passed or Failed).</LI>" 
     54                                                        "<LI>Press OK to save the report.</LI>" 
     55                                                "</UL>" 
     56                                                "</P><P>" 
     57                                                "The report contains code coverage data generated using " 
     58                                                "<I>CoverageMeter</I>&nbsp;(<TT>http://www.coveragemeter.com</TT>). " 
     59                                                "This report does not contain any kind of information about " 
     60                                                "the project developped using MonkeyStudio." 
     61                                                "</P><P>" 
     62                                                "When the testing phase is finished, send the contain of the directory " 
     63                                                "'<TT>"+coverageFile.dir().absolutePath()+"</TT>' " 
     64                                                "to xxxx@xxx.xx"  
     65                                                "</P>" 
     66                                                "</BODY></HTML>"; 
    7767#endif 
    78         description->setText(descriptionText); 
    79         // 
    80         connect( ok, SIGNAL( clicked( ) ), this, SLOT( okClicked( ) ) ); 
    81         connect( cancel, SIGNAL( clicked( ) ), this, SLOT( cancelClicked( ) ) ); 
     68                description->setText(descriptionText); 
     69                // 
     70                connect( ok, SIGNAL( clicked( ) ), this, SLOT( okClicked( ) ) ); 
     71                connect( cancel, SIGNAL( clicked( ) ), this, SLOT( cancelClicked( ) ) ); 
    8272} 
    8373// 
     
    8575{ 
    8676#ifdef __COVERAGESCANNER__ 
    87     QString testState; 
     77        QString testState; 
    8878        __coveragescanner_filename( BasePlugin::codeCoverageFile().toAscii() ); 
    8979        switch ( status->currentIndex() ) 
    90     { 
    91       case 1: 
    92         testState = ( "PASSED" ); 
    93         break; 
    94       case 2: 
    95         testState = ( "FAILED" ); 
    96         break; 
    97       default: 
    98         testState = ( "UNKNOWN" ); 
    99         break; 
    100     } 
    101     QString testName=testTitle(title->text()); 
    102     QString monkeyTestName=testName+"/MonkeyStudio"; 
    103     __coveragescanner_teststate( testState.toAscii() ); 
     80        { 
     81                case 1: 
     82                        testState = ( "PASSED" ); 
     83                        break; 
     84                case 2: 
     85                        testState = ( "FAILED" ); 
     86                        break; 
     87                default: 
     88                        testState = ( "UNKNOWN" ); 
     89                        break; 
     90        } 
     91        QString testName=testTitle(title->text()); 
     92        QString monkeyTestName=testName+"/MonkeyStudio"; 
     93        __coveragescanner_teststate( testState.toAscii() ); 
    10494        __coveragescanner_testname( monkeyTestName.toAscii() ); 
    10595        __coveragescanner_save(); 
    10696        for ( int i = 0; i < PluginsManager::self()->plugins().count(); i++ ) 
    10797        { 
    108       BasePlugin *plg=PluginsManager::self()->plugins().at(i); 
    109       plg->saveCodeCoverage(testName,testState); 
    110     } 
     98                BasePlugin *plg=PluginsManager::self()->plugins().at(i); 
     99                plg->saveCodeCoverage(testName,testState); 
     100                } 
    111101#endif 
    112102        accept(); 
     
    132122        else 
    133123                testName += s; 
    134     return testName; 
     124        return testName; 
    135125} 
  • v2/trunk/coveragemeter/ui/UITestReport.h

    r1518 r2189  
    11/**************************************************************************** 
    2 ** 
    3 **              Created using Monkey Studio v1.8.1.0 
    4 ** Authors    : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 
    5 ** Project   : Coverage Meter 
    6 ** FileName  : UITestReport.h 
    7 ** Date      : 2008-01-14T00:35:56 
    8 ** License   : GPL 
    9 ** Comment   : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 
    10 ** Home Page : http://www.monkeystudio.org 
    11 ** 
    12     Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
     2        Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
    133 
    14     This program is free software; you can redistribute it and/or modify 
    15     it under the terms of the GNU General Public License as published by 
    16     the Free Software Foundation; either version 2 of the License, or 
    17     (at your option) any later version. 
     4        This program is free software; you can redistribute it and/or modify 
     5        it under the terms of the GNU General Public License as published by 
     6        the Free Software Foundation; either version 2 of the License, or 
     7        (at your option) any later version. 
    188 
    19     This program is distributed in the hope that it will be useful, 
    20     but WITHOUT ANY WARRANTY; without even the implied warranty of 
    21     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    22     GNU General Public License for more details. 
     9        This program is distributed in the hope that it will be useful, 
     10        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     12        GNU General Public License for more details. 
    2313 
    24     You should have received a copy of the GNU General Public License 
    25     along with this program; if not, write to the Free Software 
    26     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    27 ** 
     14        You should have received a copy of the GNU General Public License 
     15        along with this program; if not, write to the Free Software 
     16        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    2817****************************************************************************/ 
     18/*! 
     19        \file UITestReport.h 
     20        \date 2008-01-14T00:35:56 
     21        \author Coverage Meter Team 
     22        \author Filipe AZEVEDO aka Nox P\@sNox <pasnox@gmail.com> 
     23        \brief Coverage meter class 
     24*/ 
    2925#ifndef UITESTREPORT_H 
    3026#define UITESTREPORT_H 
  • v2/trunk/fresh/objects/MonkeyExport.h

    r1518 r2189  
    11/**************************************************************************** 
    2 ** 
    3 **              Created using Monkey Studio v1.8.1.0 
    4 ** Authors    : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 
    5 ** Project   : Fresh Framework 
    6 ** FileName  : MonkeyExport.h 
    7 ** Date      : 2008-01-14T00:27:36 
    8 ** License   : GPL 
    9 ** Comment   : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 
    10 ** Home Page : http://www.monkeystudio.org 
    11 ** 
    12     Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
     2        Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
    133 
    14     This program is free software; you can redistribute it and/or modify 
    15     it under the terms of the GNU General Public License as published by 
    16     the Free Software Foundation; either version 2 of the License, or 
    17     (at your option) any later version. 
     4        This program is free software; you can redistribute it and/or modify 
     5        it under the terms of the GNU General Public License as published by 
     6        the Free Software Foundation; either version 2 of the License, or 
     7        (at your option) any later version. 
    188 
    19     This program is distributed in the hope that it will be useful, 
    20     but WITHOUT ANY WARRANTY; without even the implied warranty of 
    21     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    22     GNU General Public License for more details. 
     9        This program is distributed in the hope that it will be useful, 
     10        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     12        GNU General Public License for more details. 
    2313 
    24     You should have received a copy of the GNU General Public License 
    25     along with this program; if not, write to the Free Software 
    26     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    27 ** 
     14        You should have received a copy of the GNU General Public License 
     15        along with this program; if not, write to the Free Software 
     16        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    2817****************************************************************************/ 
     18/*! 
     19        \file MonkeyExport.h 
     20        \date 2008-01-14T00:27:36 
     21        \author Filipe AZEVEDO aka Nox P\@sNox <pasnox@gmail.com> 
     22        \brief Export Symbol Macros 
     23*/ 
    2924#ifndef MONKEY_EXPORT_H 
    3025#define MONKEY_EXPORT_H 
    3126 
    3227#include <qglobal.h> 
     28 
     29/*! 
     30        \def Q_MONKEY_EXPORT 
     31        \details This macro allow symbols to be exported/imported for Window OS 
     32*/ 
    3333 
    3434#if defined(MONKEY_CORE_BUILD) 
  • v2/trunk/fresh/objects/QSingleton.cpp

    r1518 r2189  
    11/**************************************************************************** 
    2 ** 
    3 **              Created using Monkey Studio v1.8.1.0 
    4 ** Authors    : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 
    5 ** Project   : Fresh Framework 
    6 ** FileName  : QSingleton.cpp 
    7 ** Date      : 2008-01-14T00:27:36 
    8 ** License   : GPL 
    9 ** Comment   : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 
    10 ** Home Page : http://www.monkeystudio.org 
    11 ** 
    12     Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
     2        Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
    133 
    14     This program is free software; you can redistribute it and/or modify 
    15     it under the terms of the GNU General Public License as published by 
    16     the Free Software Foundation; either version 2 of the License, or 
    17     (at your option) any later version. 
     4        This program is free software; you can redistribute it and/or modify 
     5        it under the terms of the GNU General Public License as published by 
     6        the Free Software Foundation; either version 2 of the License, or 
     7        (at your option) any later version. 
    188 
    19     This program is distributed in the hope that it will be useful, 
    20     but WITHOUT ANY WARRANTY; without even the implied warranty of 
    21     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    22     GNU General Public License for more details. 
     9        This program is distributed in the hope that it will be useful, 
     10        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     12        GNU General Public License for more details. 
    2313 
    24     You should have received a copy of the GNU General Public License 
    25     along with this program; if not, write to the Free Software 
    26     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    27 ** 
     14        You should have received a copy of the GNU General Public License 
     15        along with this program; if not, write to the Free Software 
     16        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    2817****************************************************************************/ 
    2918#include "QSingleton.h" 
  • v2/trunk/fresh/objects/QSingleton.h

    r1518 r2189  
    11/**************************************************************************** 
    2 ** 
    3 **              Created using Monkey Studio v1.8.1.0 
    4 ** Authors    : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 
    5 ** Project   : Fresh Framework 
    6 ** FileName  : QSingleton.h 
    7 ** Date      : 2008-01-14T00:27:37 
    8 ** License   : GPL 
    9 ** Comment   : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 
    10 ** Home Page : http://www.monkeystudio.org 
    11 ** 
    12     Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
     2        Copyright (C) 2005 - 2008  Filipe AZEVEDO & The Monkey Studio Team 
    133 
    14     This program is free software; you can redistribute it and/or modify 
    15     it under the terms of the GNU General Public License as published by 
    16     the Free Software Foundation; either version 2 of the License, or 
    17     (at your option) any later version. 
     4        This program is free software; you can redistribute it and/or modify 
     5        it under the terms of the GNU General Public License as published by 
     6        the Free Software Foundation; either version 2 of the License, or 
     7        (at your option) any later version. 
    188 
    19     This program is distributed in the hope that it will be useful, 
    20     but WITHOUT ANY WARRANTY; without even the implied warranty of 
    21     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    22     GNU General Public License for more details. 
     9        This program is distributed in the hope that it will be useful, 
     10        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     12        GNU General Public License for more details. 
    2313 
    24     You should have received a copy of the GNU General Public License 
    25     along with this program; if not, write to the Free Software 
    26     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    27 ** 
     14        You should have received a copy of the GNU General Public License 
     15        along with this program; if not, write to the Free Software 
     16        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    2817****************************************************************************/ 
    29 /* 
    30         How to use : 
    31  
    32         // single sur un QPushButton 
    33         class MyPushButon : public QPushButton, public QSingleton<MyPushButon> 
    34         { 
    35                 friend class QSingleton<MyPushButon>; 
    36  
    37         protected: 
    38                 MyPushButon( QWidget* p ) 
    39                 : QPushButton( p ), QSingleton<MyPushButon>() 
    40                 {}; 
    41         }; 
    42         // in cpp 
    43         MyPushButton* pb = MyPushButton::instance( parentWidget ); // initialise object 
    44         // then u can retreive it with MyPushButton::instance() or using pb pointer 
     18/*! 
     19        \file QSingleton.h 
     20        \date 2008-01-14T00:27:37 
     21        \author Filipe AZEVEDO aka Nox P\@sNox <pasnox@gmail.com> 
     22        \brief Singletonize your QObject class 
    4523*/ 
    4624#ifndef QSINGLETON_H 
     
    5331#include <QApplication> 
    5432 
     33/*! 
     34        \brief Internal hash of instances 
     35        \details This class contains unique instance pointer of singletonized classes 
     36*/ 
    5537class Q_MONKEY_EXPORT QSingletonExpose 
    5638{ 
     
    5941}; 
    6042 
     43/*! 
     44        \brief Singletonize your QObject class 
     45        \details When heriting this template, you self made your class singletonizable ( unique instance ) ( ie: call like youclass::instance() ) 
     46*/ 
    6147template <class T> 
    6248class QSingleton : public QSingletonExpose 
     
    6955public: 
    7056        template <typename P> 
    71         static T* instance( P* ); 
     57        static T* instance( P* pointer ); 
    7258        static T* instance(); 
    73         static bool instanceAvailable() 
    74         { return mInstances.contains( &T::staticMetaObject ); } 
    75         static void cleanInstance() 
    76         { if ( instanceAvailable() ) delete mInstances[ &T::staticMetaObject ]; } 
    77  
     59        static bool instanceAvailable(); 
     60        static void cleanInstance(); 
    7861}; 
    7962 
     63/*! 
     64        \details Return an unique instance of the class 
     65        \param pointer A pointer that is given to constructor of the class 
     66*/ 
    8067template <class T> 
    8168template <typename P> 
    82 T* QSingleton<T>::instance( P* p ) 
     69T* QSingleton<T>::instance( P* pointer ) 
    8370{ 
    8471        T* t = qobject_cast<T*>( mInstances.value( &T::staticMetaObject ) ); 
    8572        if ( !t ) 
    86                 mInstances[&T::staticMetaObject] = ( t = new T( p ) ); 
     73                mInstances[&T::staticMetaObject] = ( t = new T( pointer ) ); 
    8774        return t;