1
0
Fork 0

TestSuite: Shift of the globals unit test helper functions into the test suite.

The setting of the SG log levels and developer mode has been removed as this
clashes with the output control set by the test suite main() function.
This commit is contained in:
Edward d'Auvergne 2018-03-13 20:56:31 +01:00
parent 7616f1ec3e
commit 0f96032487
12 changed files with 23 additions and 13 deletions

View file

@ -18,7 +18,7 @@
#include "config.h" #include "config.h"
#include "unitTestHelpers.hxx" #include "test_suite/helpers/globals.hxx"
#include <simgear/misc/test_macros.hxx> #include <simgear/misc/test_macros.hxx>

View file

@ -18,7 +18,7 @@
#include "config.h" #include "config.h"
#include "unitTestHelpers.hxx" #include "test_suite/helpers/globals.hxx"
#include <simgear/misc/test_macros.hxx> #include <simgear/misc/test_macros.hxx>
#include <simgear/props/props_io.hxx> #include <simgear/props/props_io.hxx>

View file

@ -8,6 +8,9 @@ foreach(test_category
add_subdirectory(${test_category}) add_subdirectory(${test_category})
endforeach(test_category) endforeach(test_category)
# Add the helpers.
add_subdirectory(helpers)
# Add all test suite sources and headers. # Add all test suite sources and headers.
set(TESTSUITE_SOURCES set(TESTSUITE_SOURCES
${TESTSUITE_SOURCES} ${TESTSUITE_SOURCES}

View file

@ -0,0 +1,12 @@
set(TESTSUITE_SOURCES
${TESTSUITE_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/globals.cxx
PARENT_SCOPE
)
set(TESTSUITE_HEADERS
${TESTSUITE_HEADERS}
${CMAKE_CURRENT_SOURCE_DIR}/globals.hxx
PARENT_SCOPE
)

View file

@ -1,7 +1,7 @@
#include "config.h" #include "config.h"
#include "unitTestHelpers.hxx" #include "globals.hxx"
#include <Main/globals.hxx> #include <Main/globals.hxx>
#include <Main/options.hxx> #include <Main/options.hxx>
@ -33,9 +33,6 @@ namespace fgtest
void initTestGlobals(const std::string& testName) void initTestGlobals(const std::string& testName)
{ {
sglog().setLogLevels( SG_ALL, SG_WARN );
sglog().setDeveloperMode(true);
globals = new FGGlobals; globals = new FGGlobals;
bool foundRoot = false; bool foundRoot = false;

View file

@ -21,7 +21,7 @@
#include "test_AddonManagement.hxx" #include "test_AddonManagement.hxx"
#include "config.h" #include "config.h"
#include "tests/unitTestHelpers.hxx" #include "test_suite/helpers/globals.hxx"
#include <sstream> #include <sstream>
#include <string> #include <string>

View file

@ -18,7 +18,7 @@
#include "test_posinit.hxx" #include "test_posinit.hxx"
#include "tests/unitTestHelpers.hxx" #include "test_suite/helpers/globals.hxx"
#include <simgear/props/props_io.hxx> #include <simgear/props/props_io.hxx>

View file

@ -2,13 +2,11 @@ set(TESTSUITE_SOURCES
${TESTSUITE_SOURCES} ${TESTSUITE_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/TestSuite.cxx ${CMAKE_CURRENT_SOURCE_DIR}/TestSuite.cxx
${CMAKE_CURRENT_SOURCE_DIR}/test_flightplan.cxx ${CMAKE_CURRENT_SOURCE_DIR}/test_flightplan.cxx
${PROJECT_SOURCE_DIR}/tests/unitTestHelpers.cxx
PARENT_SCOPE PARENT_SCOPE
) )
set(TESTSUITE_HEADERS set(TESTSUITE_HEADERS
${TESTSUITE_HEADERS} ${TESTSUITE_HEADERS}
${CMAKE_CURRENT_SOURCE_DIR}/test_flightplan.hxx ${CMAKE_CURRENT_SOURCE_DIR}/test_flightplan.hxx
${PROJECT_SOURCE_DIR}/tests/unitTestHelpers.cxx
PARENT_SCOPE PARENT_SCOPE
) )

View file

@ -1,6 +1,6 @@
#include "test_flightplan.hxx" #include "test_flightplan.hxx"
#include "tests/unitTestHelpers.hxx" #include "test_suite/helpers/globals.hxx"
#include <simgear/misc/strutils.hxx> #include <simgear/misc/strutils.hxx>

View file

@ -88,7 +88,7 @@ set_property(DIRECTORY APPEND PROPERTY fgtestlib_sources "${CMAKE_SOURCE_DIR}/3r
get_property(fgtestlib_sources DIRECTORY PROPERTY fgtestlib_sources) get_property(fgtestlib_sources DIRECTORY PROPERTY fgtestlib_sources)
add_library(fgtestlib SHARED ${fgtestlib_sources} add_library(fgtestlib SHARED ${fgtestlib_sources}
unitTestHelpers.cxx "${CMAKE_SOURCE_DIR}/test_suite/helpers/globals.cxx"
testStubs.cxx testStubs.cxx
fake_sgSky.cxx fake_sgSky.cxx
fake_sgPrecipitation.cxx fake_sgPrecipitation.cxx

View file

@ -1,4 +1,4 @@
#include "unitTestHelpers.hxx" #include "test_suite/helpers/globals.hxx"
#include <simgear/misc/test_macros.hxx> #include <simgear/misc/test_macros.hxx>