1
0
Fork 0
flightgear/test_suite/FGTestApi/testGlobals.hxx

76 lines
2 KiB
C++
Raw Normal View History

#ifndef FG_TEST_GLOBALS_HELPERS_HXX
#define FG_TEST_GLOBALS_HELPERS_HXX
#include <string>
#include <functional>
#include <vector>
#include <simgear/math/SGGeod.hxx>
2019-04-23 17:10:39 +00:00
#include <simgear/structure/SGSharedPtr.hxx>
2019-04-23 17:10:39 +00:00
namespace flightgear
{
class FlightPlan;
typedef SGSharedPtr<FlightPlan> FlightPlanRef;
2019-09-23 22:14:32 +00:00
typedef std::vector<SGGeod> SGGeodVec;
2019-04-23 17:10:39 +00:00
}
namespace FGTestApi {
namespace setUp {
void initTestGlobals(const std::string& testName);
bool logPositionToKML(const std::string& testName);
2021-03-08 20:56:54 +00:00
/**Don't log aircraft positions*/
bool logLinestringsToKML(const std::string& testName);
void initStandardNasal(bool withCanvas = false);
void populateFPWithoutNasal(flightgear::FlightPlanRef f,
const std::string& depICAO, const std::string& depRunway,
const std::string& destICAO, const std::string& destRunway,
const std::string& waypoints);
void populateFPWithNasal(flightgear::FlightPlanRef f,
const std::string& depICAO, const std::string& depRunway,
const std::string& destICAO, const std::string& destRunway,
const std::string& waypoints);
2019-04-23 17:10:39 +00:00
} // End of namespace setUp.
// helpers during tests
2021-03-08 20:56:54 +00:00
const SGGeod getPosition();
void setPosition(const SGGeod& g);
void setPositionAndStabilise(const SGGeod& g);
void runForTime(double t);
2021-04-24 20:39:14 +00:00
/**
@brief set the simulation date/time clock to 'time'
*/
void adjustSimulationWorldTime(time_t time);
using RunCheck = std::function<bool(void)>;
bool runForTimeWithCheck(double t, RunCheck check);
void writeFlightPlanToKML(flightgear::FlightPlanRef fp);
2019-09-23 22:14:32 +00:00
void writeGeodsToKML(const std::string &label, const flightgear::SGGeodVec& geods);
void writePointToKML(const std::string& ident, const SGGeod& pos);
bool executeNasal(const std::string& code);
namespace tearDown {
void shutdownTestGlobals();
} // End of namespace tearDown.
} // End of namespace FGTestApi.
#endif // of FG_TEST_GLOBALS_HELPERS_HXX