Ignore:
Timestamp:
Sep 20, 2015, 2:30:36 PM (11 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
master
Children:
1ebaa4f
Parents:
915dc18
Message:

Build in php webserver is now launched with QProcess::start instead of QProcess::execute in a different thread

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/testing/webserverprocess.h

    r915dc18 ra2330fc  
    2121#define WEBSERVERPROCESS_H
    2222
    23 #include <QThread>
     23#include <QObject>
    2424#include <sitestingglobal.h>
    25 
    26 class WebserverRunner;
    2725
    2826#include <QPointer>
    … …  
    3230 * @brief Starts the php build in webserver to allow testing against the webservice
    3331 */
    34 class SI_TESTING_EXPORT WebserverProcess : public QThread {
    35         friend WebserverRunner;
    36        
     32class SI_TESTING_EXPORT WebserverProcess : public QObject {
    3733        Q_OBJECT
    3834        public:
    … …  
    4440               
    4541                bool isRunning() const;
    46        
    47                 void stopThread();
    48                 void run();
    49                 bool isStarted();
    50                 bool waitForStart();
     42                bool start();
     43                /**
     44                 * @brief Stops the webservice with QProcess::terminate(). The destructor ~WebserverProcess() calls QProcess::kill() to stop the webserver process.
     45                 */
     46                bool stop();
     47                /**
     48                 * @brief Calls the setup page of the webservice. Returns true, if the call was successfully. This does not means, the setup was successfully.
     49                 */
     50                bool setup();
     51                /**
     52                 * @brief Removes the webservice data directory to cleanup test case. It is called by ~WebserverProcess().
     53                 */
     54                bool cleanupDataDirectory();
    5155
    5256        private slots:
    53                 void setStarted();
     57                void processError(QProcess::ProcessError error);
     58                void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
     59                void processReadyRead();
    5460
    5561        private:
    5662                static QString appendSlashToUrl(QString url);
    5763
    58 //              QPointer<QProcess> _webserverProcess;
    59 //              int _timeout;
    60                 WebserverRunner *_runner;
    61                 bool _finishedStartup;
     64                QPointer<QProcess> _process;
     65                int _timeout;
    6266};
    6367
Note: See TracChangeset for help on using the changeset viewer.