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:
parent
7616f1ec3e
commit
0f96032487
12 changed files with 23 additions and 13 deletions
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include "unitTestHelpers.hxx"
|
||||
#include "test_suite/helpers/globals.hxx"
|
||||
|
||||
#include <simgear/misc/test_macros.hxx>
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include "unitTestHelpers.hxx"
|
||||
#include "test_suite/helpers/globals.hxx"
|
||||
|
||||
#include <simgear/misc/test_macros.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
|
|
|
@ -8,6 +8,9 @@ foreach(test_category
|
|||
add_subdirectory(${test_category})
|
||||
endforeach(test_category)
|
||||
|
||||
# Add the helpers.
|
||||
add_subdirectory(helpers)
|
||||
|
||||
# Add all test suite sources and headers.
|
||||
set(TESTSUITE_SOURCES
|
||||
${TESTSUITE_SOURCES}
|
||||
|
|
12
test_suite/helpers/CMakeLists.txt
Normal file
12
test_suite/helpers/CMakeLists.txt
Normal 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
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include "unitTestHelpers.hxx"
|
||||
#include "globals.hxx"
|
||||
|
||||
#include <Main/globals.hxx>
|
||||
#include <Main/options.hxx>
|
||||
|
@ -33,9 +33,6 @@ namespace fgtest
|
|||
|
||||
void initTestGlobals(const std::string& testName)
|
||||
{
|
||||
sglog().setLogLevels( SG_ALL, SG_WARN );
|
||||
sglog().setDeveloperMode(true);
|
||||
|
||||
globals = new FGGlobals;
|
||||
|
||||
bool foundRoot = false;
|
|
@ -21,7 +21,7 @@
|
|||
#include "test_AddonManagement.hxx"
|
||||
|
||||
#include "config.h"
|
||||
#include "tests/unitTestHelpers.hxx"
|
||||
#include "test_suite/helpers/globals.hxx"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "test_posinit.hxx"
|
||||
|
||||
#include "tests/unitTestHelpers.hxx"
|
||||
#include "test_suite/helpers/globals.hxx"
|
||||
|
||||
#include <simgear/props/props_io.hxx>
|
||||
|
||||
|
|
|
@ -2,13 +2,11 @@ set(TESTSUITE_SOURCES
|
|||
${TESTSUITE_SOURCES}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/TestSuite.cxx
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_flightplan.cxx
|
||||
${PROJECT_SOURCE_DIR}/tests/unitTestHelpers.cxx
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
set(TESTSUITE_HEADERS
|
||||
${TESTSUITE_HEADERS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_flightplan.hxx
|
||||
${PROJECT_SOURCE_DIR}/tests/unitTestHelpers.cxx
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "test_flightplan.hxx"
|
||||
|
||||
#include "tests/unitTestHelpers.hxx"
|
||||
#include "test_suite/helpers/globals.hxx"
|
||||
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ set_property(DIRECTORY APPEND PROPERTY fgtestlib_sources "${CMAKE_SOURCE_DIR}/3r
|
|||
get_property(fgtestlib_sources DIRECTORY PROPERTY fgtestlib_sources)
|
||||
|
||||
add_library(fgtestlib SHARED ${fgtestlib_sources}
|
||||
unitTestHelpers.cxx
|
||||
"${CMAKE_SOURCE_DIR}/test_suite/helpers/globals.cxx"
|
||||
testStubs.cxx
|
||||
fake_sgSky.cxx
|
||||
fake_sgPrecipitation.cxx
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "unitTestHelpers.hxx"
|
||||
#include "test_suite/helpers/globals.hxx"
|
||||
|
||||
#include <simgear/misc/test_macros.hxx>
|
||||
|
||||
|
|
Loading…
Reference in a new issue