##

QTestFixture.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _QTESTFIXTURE_HH_
#define _QTESTFIXTURE_HH_
#include <string>
#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
# include <boost/thread.hpp>
# include "gazebo/Server.hh"
# include "gazebo/physics/physics.hh"
# include "gazebo/rendering/rendering.hh"
#endif
#include "gazebo/gui/qt.h"
#include "gazebo/gui/qt_test.h"
#include "gazebo/gazebo_config.h"
#include "test_config.h"
class QTestFixture : public QObject
{
Q_OBJECT
public: QTestFixture();
protected: void Load(const std::string &_worldFilename, bool _paused = false,
bool _serverScene = true, bool _clientScene = false);
protected: void SetPause(bool _pause);
protected: void ProcessEventsAndDraw(QMainWindow *_mainWindow = NULL,
const unsigned int _repeat = 10, const unsigned int _ms = 30);
protected: void GetMemInfo(double &_resident, double &_share);
private slots: void initTestCase();
private slots: void init();
private slots: void cleanup();
private slots: void cleanupTestCase();
private: void RunServer(const std::string &_worldFilename, bool _paused,
bool _createScene);
protected: gazebo::Server *server;
protected: boost::thread *serverThread;
protected: double resMaxPercentChange;
protected: double shareMaxPercentChange;
private: double residentStart;
private: double shareStart;
};
#endif
Server.hh
QTestFixture::shareMaxPercentChange
double shareMaxPercentChange
Maximum allowed percent change in shared memory usage.
Definition: QTestFixture.hh:98
QTestFixture::serverThread
boost::thread * serverThread
Thread to run the Gazebo server.
Definition: QTestFixture.hh:92
qt.h
QTestFixture::QTestFixture
QTestFixture()
NULL
#define NULL
Definition: CommonTypes.hh:31
qt_test.h
QTestFixture::ProcessEventsAndDraw
void ProcessEventsAndDraw(QMainWindow *_mainWindow=NULL, const unsigned int _repeat=10, const unsigned int _ms=30)
Give the GUI time to process events and trigger main window repaint.
QTestFixture::SetPause
void SetPause(bool _pause)
Pause or unpause the world.
QTestFixture::resMaxPercentChange
double resMaxPercentChange
Maximum allowed percent change in resident memory usage.
Definition: QTestFixture.hh:95
gazebo::Server
Definition: Server.hh:41
QTestFixture::server
gazebo::Server * server
The Gazebo server, which is run in a thread.
Definition: QTestFixture.hh:89
QTestFixture::Load
void Load(const std::string &_worldFilename, bool _paused=false, bool _serverScene=true, bool _clientScene=false)
Load a world.
QTestFixture
Base class for all Gazebo GUI unit tests.
Definition: QTestFixture.hh:37
QTestFixture::GetMemInfo
void GetMemInfo(double &_resident, double &_share)
Get memory information about the current process.