1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-03 00:59:47 +02:00

Remove RW_TEST_WITH_DATA from test code

This commit is contained in:
Daniel Evans 2019-01-18 01:29:59 +00:00
parent 530a7d35ac
commit 6f9e23acc9
29 changed files with 46 additions and 107 deletions

View File

@ -13,7 +13,6 @@ set(_ARGS_BOOL
BUILD_VIEWER BUILD_VIEWER
RUN_TESTS RUN_TESTS
TESTS_NODATA
SEPARATE_TEST_SUITES SEPARATE_TEST_SUITES
RUN_MEMCHECK RUN_MEMCHECK
@ -164,7 +163,6 @@ set(_CONFIGURE_OPTIONS
"-DBUILD_TOOLS=${BUILD_TOOLS}" "-DBUILD_TOOLS=${BUILD_TOOLS}"
"-DBUILD_VIEWER=${BUILD_VIEWER}" "-DBUILD_VIEWER=${BUILD_VIEWER}"
"-DBUILD_TESTS=TRUE" "-DBUILD_TESTS=TRUE"
"-DTESTS_NODATA=${TESTS_NODATA}"
"-DTEST_COVERAGE=${TEST_COVERAGE}" "-DTEST_COVERAGE=${TEST_COVERAGE}"
"-DSEPARATE_TEST_SUITES=${SEPARATE_TEST_SUITES}" "-DSEPARATE_TEST_SUITES=${SEPARATE_TEST_SUITES}"
"-DCHECK_IWYU=${CHECK_IWYU}" "-DCHECK_IWYU=${CHECK_IWYU}"

View File

@ -52,9 +52,8 @@ set(RUN_MEMCHECK FALSE)
openrw_should_submit_ci(SUBMIT) openrw_should_submit_ci(SUBMIT)
# Build with no data and test # Build with no data and test
set(BUILDER_NAME "${BUILDER_NAME_BASE}-nodata") set(BUILDER_NAME "${BUILDER_NAME_BASE}")
set(APPEND_RESULTS FALSE) set(APPEND_RESULTS FALSE)
set(TESTS_NODATA TRUE)
set(RUN_TESTS TRUE) set(RUN_TESTS TRUE)
if($ENV{TEST_COVERAGE}) if($ENV{TEST_COVERAGE})
set(TEST_COVERAGE TRUE) set(TEST_COVERAGE TRUE)
@ -66,14 +65,4 @@ set(CODECOV_FLAGS "nodata")
include("${CTEST_SCRIPT_DIRECTORY}/build.ctest") include("${CTEST_SCRIPT_DIRECTORY}/build.ctest")
# Build with data and do not test
set(BUILDER_NAME "${BUILDER_NAME_BASE}-data")
set(APPEND_RESULTS FALSE)
set(TESTS_NODATA FALSE)
set(RUN_TESTS FALSE)
set(CODECOV_FLAGS "data")
include("${CTEST_SCRIPT_DIRECTORY}/build.ctest")
handle_warnings_errors() handle_warnings_errors()

View File

@ -62,7 +62,6 @@ else()
set(RES FALSE) set(RES FALSE)
endif() endif()
set(TESTS_NODATA FALSE)
set(RUN_TESTS TRUE) set(RUN_TESTS TRUE)
set(SUBMIT $ENV{SUBMIT}) set(SUBMIT $ENV{SUBMIT})

View File

@ -7,7 +7,7 @@ option(BUILD_VIEWER "Build GUI data viewer")
option(ENABLE_SCRIPT_DEBUG "Enable verbose script execution") option(ENABLE_SCRIPT_DEBUG "Enable verbose script execution")
option(ENABLE_PROFILING "Enable detailed profiling metrics") option(ENABLE_PROFILING "Enable detailed profiling metrics")
option(TESTS_NODATA "Build tests for no-data testing") option(TEST_DATA "Enable tests that require game data")
set(FAILED_CHECK_ACTION "IGNORE" CACHE STRING "What action to perform on a failed RW_CHECK (in debug mode)") set(FAILED_CHECK_ACTION "IGNORE" CACHE STRING "What action to perform on a failed RW_CHECK (in debug mode)")
set_property(CACHE FAILED_CHECK_ACTION PROPERTY STRINGS "IGNORE" "ABORT" "BREAKPOINT") set_property(CACHE FAILED_CHECK_ACTION PROPERTY STRINGS "IGNORE" "ABORT" "BREAKPOINT")

View File

@ -9,14 +9,12 @@ class OpenrwConan(ConanFile):
description = "OpenRW 'Open ReWrite' is an un-official open source recreation of the classic Grand Theft Auto III game executable" description = "OpenRW 'Open ReWrite' is an un-official open source recreation of the classic Grand Theft Auto III game executable"
settings = 'os', 'compiler', 'build_type', 'arch' settings = 'os', 'compiler', 'build_type', 'arch'
options = { options = {
'test_data': [True, False],
'viewer': [True, False], 'viewer': [True, False],
'tools': [True, False], 'tools': [True, False],
'profiling': [True, False], 'profiling': [True, False],
} }
default_options = { default_options = {
'test_data': False,
'viewer': True, 'viewer': True,
'tools': True, 'tools': True,
'profiling': True, 'profiling': True,
@ -68,7 +66,6 @@ class OpenrwConan(ConanFile):
'BUILD_TESTS': True, 'BUILD_TESTS': True,
'BUILD_VIEWER': self.options.viewer, 'BUILD_VIEWER': self.options.viewer,
'BUILD_TOOLS': self.options.tools, 'BUILD_TOOLS': self.options.tools,
'TESTS_NODATA': not self.options.test_data,
'ENABLE_PROFILING': self.options.profiling, 'ENABLE_PROFILING': self.options.profiling,
'USE_CONAN': True, 'USE_CONAN': True,
'BOOST_STATIC': not self.options['boost'].shared, 'BOOST_STATIC': not self.options['boost'].shared,

View File

@ -53,11 +53,6 @@ add_executable(rwtests
${TEST_SOURCES} ${TEST_SOURCES}
) )
target_compile_definitions(rwtests
PRIVATE
"RW_TEST_WITH_DATA=$<NOT:$<BOOL:${TESTS_NODATA}>>"
)
target_include_directories(rwtests target_include_directories(rwtests
PRIVATE PRIVATE
"${PROJECT_SOURCE_DIR}/tests" "${PROJECT_SOURCE_DIR}/tests"
@ -97,3 +92,9 @@ else()
TIMEOUT 300 TIMEOUT 300
) )
endif() endif()
if(TEST_DATA)
add_test(NAME DataTests
COMMAND "$<TARGET_FILE:rwtests>" "--run_test=@data-test"
)
endif()

View File

@ -5,9 +5,8 @@
#include <glm/gtx/string_cast.hpp> #include <glm/gtx/string_cast.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(AnimationTests) BOOST_AUTO_TEST_SUITE(AnimationTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_matrix) { BOOST_AUTO_TEST_CASE(test_matrix) {
{ {
auto animation = std::make_shared<Animation>(); auto animation = std::make_shared<Animation>();
@ -44,6 +43,5 @@ BOOST_AUTO_TEST_CASE(test_matrix) {
glm::vec3(0.f, 1.f, 0.f)); glm::vec3(0.f, 1.f, 0.f));
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -2,9 +2,8 @@
#include <loaders/LoaderIMG.hpp> #include <loaders/LoaderIMG.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(ArchiveTests) BOOST_AUTO_TEST_SUITE(ArchiveTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_open_archive) { BOOST_AUTO_TEST_CASE(test_open_archive) {
LoaderIMG archive; LoaderIMG archive;
@ -28,6 +27,5 @@ BOOST_AUTO_TEST_CASE(test_open_archive) {
BOOST_CHECK_EQUAL(f2.offset, f.offset); BOOST_CHECK_EQUAL(f2.offset, f.offset);
BOOST_CHECK_EQUAL(f2.size, f.size); BOOST_CHECK_EQUAL(f2.size, f.size);
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -2,9 +2,8 @@
#include <objects/VehicleObject.hpp> #include <objects/VehicleObject.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(BuoyancyTests) BOOST_AUTO_TEST_SUITE(BuoyancyTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_vehicle_buoyancy) { BOOST_AUTO_TEST_CASE(test_vehicle_buoyancy) {
glm::vec2 tpos(-WATER_WORLD_SIZE / 2.f + 10.f); glm::vec2 tpos(-WATER_WORLD_SIZE / 2.f + 10.f);
{ {
@ -57,6 +56,5 @@ BOOST_AUTO_TEST_CASE(test_vehicle_buoyancy) {
Global::get().e->destroyObject(vehicle); Global::get().e->destroyObject(vehicle);
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -5,9 +5,8 @@
#include <objects/VehicleObject.hpp> #include <objects/VehicleObject.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(CharacterTests) BOOST_AUTO_TEST_SUITE(CharacterTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_create) { BOOST_AUTO_TEST_CASE(test_create) {
{ {
auto character = auto character =
@ -164,6 +163,5 @@ BOOST_AUTO_TEST_CASE(test_cycle_animating) {
static_cast<uint32_t>(AnimCycle::ArrestGun)); static_cast<uint32_t>(AnimCycle::ArrestGun));
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -2,9 +2,8 @@
#include <data/Chase.hpp> #include <data/Chase.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(ChaseTests) BOOST_AUTO_TEST_SUITE(ChaseTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_load_keyframes) { BOOST_AUTO_TEST_CASE(test_load_keyframes) {
std::vector<ChaseKeyframe> keyframes; std::vector<ChaseKeyframe> keyframes;
BOOST_REQUIRE(ChaseKeyframe::load( BOOST_REQUIRE(ChaseKeyframe::load(
@ -12,6 +11,5 @@ BOOST_AUTO_TEST_CASE(test_load_keyframes) {
BOOST_REQUIRE(keyframes.size() == 5400); BOOST_REQUIRE(keyframes.size() == 5400);
BOOST_CHECK_CLOSE(keyframes[0].position.x, 273.5422, 0.1); BOOST_CHECK_CLOSE(keyframes[0].position.x, 273.5422, 0.1);
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -4,9 +4,8 @@
#include <platform/FileHandle.hpp> #include <platform/FileHandle.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(CutsceneTests) BOOST_AUTO_TEST_SUITE(CutsceneTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_load) { BOOST_AUTO_TEST_CASE(test_load) {
{ {
auto d = Global::get().e->data->index.openFile("intro.dat"); auto d = Global::get().e->data->index.openFile("intro.dat");
@ -29,6 +28,5 @@ BOOST_AUTO_TEST_CASE(test_load) {
BOOST_CHECK(tracks.duration == 64.8f); BOOST_CHECK(tracks.duration == 64.8f);
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -8,9 +8,8 @@
// Tests against loading various data files // Tests against loading various data files
// These tests are bad but so are the interfaces so it cancels out. // These tests are bad but so are the interfaces so it cancels out.
BOOST_AUTO_TEST_SUITE(DataTests) BOOST_AUTO_TEST_SUITE(DataTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_weapon_dat) { BOOST_AUTO_TEST_CASE(test_weapon_dat) {
GenericDATLoader l; GenericDATLoader l;
std::vector<WeaponData> weaponData; std::vector<WeaponData> weaponData;
@ -121,6 +120,5 @@ BOOST_AUTO_TEST_CASE(test_model_archive_loaded) {
e->destroyObject(inst); e->destroyObject(inst);
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -21,8 +21,7 @@ BOOST_AUTO_TEST_CASE(test_normalizeName) {
} }
} }
#if RW_TEST_WITH_DATA BOOST_AUTO_TEST_CASE(test_indexTree, DATA_TEST_PREDICATE) {
BOOST_AUTO_TEST_CASE(test_indexTree) {
FileIndex index; FileIndex index;
index.indexTree(Global::getGamePath()); index.indexTree(Global::getGamePath());
@ -46,7 +45,7 @@ BOOST_AUTO_TEST_CASE(test_indexTree) {
} }
} }
BOOST_AUTO_TEST_CASE(test_openFile) { BOOST_AUTO_TEST_CASE(test_openFile, DATA_TEST_PREDICATE) {
FileIndex index; FileIndex index;
index.indexTree(Global::getGamePath() + "/data"); index.indexTree(Global::getGamePath() + "/data");
@ -54,7 +53,7 @@ BOOST_AUTO_TEST_CASE(test_openFile) {
BOOST_CHECK(handle.data != nullptr); BOOST_CHECK(handle.data != nullptr);
} }
BOOST_AUTO_TEST_CASE(test_indexArchive) { BOOST_AUTO_TEST_CASE(test_indexArchive, DATA_TEST_PREDICATE) {
FileIndex index; FileIndex index;
index.indexTree(Global::getGamePath()); index.indexTree(Global::getGamePath());
@ -70,6 +69,5 @@ BOOST_AUTO_TEST_CASE(test_indexArchive) {
BOOST_CHECK(handle.data != nullptr); BOOST_CHECK(handle.data != nullptr);
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -2,9 +2,8 @@
#include <engine/GameData.hpp> #include <engine/GameData.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(GameDataTests) BOOST_AUTO_TEST_SUITE(GameDataTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_object_data) { BOOST_AUTO_TEST_CASE(test_object_data) {
GameData gd(&Global::get().log, Global::getGamePath()); GameData gd(&Global::get().log, Global::getGamePath());
gd.load(); gd.load();
@ -94,6 +93,5 @@ BOOST_AUTO_TEST_CASE(test_ped_groups) {
BOOST_REQUIRE_GE(red.size(), 8); BOOST_REQUIRE_GE(red.size(), 8);
BOOST_CHECK_EQUAL(red[0], 34); BOOST_CHECK_EQUAL(red[0], 34);
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -4,9 +4,8 @@
#include <objects/InstanceObject.hpp> #include <objects/InstanceObject.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(GameWorldTests) BOOST_AUTO_TEST_SUITE(GameWorldTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_gameobject_id) { BOOST_AUTO_TEST_CASE(test_gameobject_id) {
auto& gw = *Global::get().e; auto& gw = *Global::get().e;
@ -67,6 +66,5 @@ BOOST_AUTO_TEST_CASE(test_offsetgametime) {
BOOST_CHECK_EQUAL(9, gw.getHour()); BOOST_CHECK_EQUAL(9, gw.getHour());
BOOST_CHECK_EQUAL(25, gw.getMinute()); BOOST_CHECK_EQUAL(25, gw.getMinute());
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -1,9 +1,8 @@
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <engine/Garage.hpp> #include <engine/Garage.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_SUITE(GarageTests) BOOST_AUTO_TEST_SUITE(GarageTests, DATA_TEST_PREDICATE)
BOOST_AUTO_TEST_CASE(test_garage_interaction) { BOOST_AUTO_TEST_CASE(test_garage_interaction) {
{ {
@ -14,5 +13,3 @@ BOOST_AUTO_TEST_CASE(test_garage_interaction) {
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
#endif

View File

@ -2,7 +2,6 @@
#include <RWConfig.hpp> #include <RWConfig.hpp>
#if RW_TEST_WITH_DATA
std::string Global::getGamePath() { std::string Global::getGamePath() {
rwfs::path configPath = RWConfigParser::getDefaultConfigPath() / "openrw.ini"; rwfs::path configPath = RWConfigParser::getDefaultConfigPath() / "openrw.ini";
RWConfigParser cfgParser; RWConfigParser cfgParser;
@ -10,4 +9,3 @@ std::string Global::getGamePath() {
BOOST_REQUIRE(parseResult.isValid()); BOOST_REQUIRE(parseResult.isValid());
return *cfgLayer.gamedataPath; return *cfgLayer.gamedataPath;
} }
#endif

View File

@ -19,6 +19,11 @@
#include <objects/GameObject.hpp> #include <objects/GameObject.hpp>
#include <glm/gtx/string_cast.hpp> #include <glm/gtx/string_cast.hpp>
#include <memory>
#define DATA_TEST_PREDICATE * boost::unit_test_framework::label("data-test")\
* boost::unit_test_framework::disabled()
std::ostream& operator<<(std::ostream& stream, glm::vec3 const& v); std::ostream& operator<<(std::ostream& stream, glm::vec3 const& v);
// Boost moved the print_log_value struct in version 1.59 // Boost moved the print_log_value struct in version 1.59
@ -80,12 +85,13 @@ BOOST_NS_MAGIC_CLOSING
class Global { class Global {
public: public:
GameWindow window; GameWindow window;
#if RW_TEST_WITH_DATA
GameData* d; GameData* d;
GameWorld* e; GameWorld* e;
GameState* s; GameState* s;
std::unique_ptr<GameData> d_;
std::unique_ptr<GameWorld> e_;
std::unique_ptr<GameState> s_;
Logger log; Logger log;
#endif
Global() { Global() {
if (SDL_Init(SDL_INIT_VIDEO) < 0) if (SDL_Init(SDL_INIT_VIDEO) < 0)
@ -94,29 +100,25 @@ public:
window.create("Tests", 800, 600, false); window.create("Tests", 800, 600, false);
window.hideCursor(); window.hideCursor();
#if RW_TEST_WITH_DATA d_ = std::make_unique<GameData>(&log, getGamePath());
d = new GameData(&log, getGamePath()); d = d_.get();
d->load(); d->load();
e = new GameWorld(&log, d); e_ = std::make_unique<GameWorld>(&log, d);
s = new GameState; e = e_.get();
s_ = std::make_unique<GameState>();
s = s_.get();
e->state = s; e->state = s;
e->dynamicsWorld->setGravity(btVector3(0.f, 0.f, 0.f)); e->dynamicsWorld->setGravity(btVector3(0.f, 0.f, 0.f));
#endif
} }
~Global() { ~Global() {
window.close(); window.close();
#if RW_TEST_WITH_DATA
delete e;
#endif
} }
#if RW_TEST_WITH_DATA
static std::string getGamePath(); static std::string getGamePath();
#endif
static Global& get() { static Global& get() {
static Global g; static Global g;

View File

@ -2,9 +2,8 @@
#include <objects/CharacterObject.hpp> #include <objects/CharacterObject.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(ItemsTests) BOOST_AUTO_TEST_SUITE(ItemsTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_character_inventory) { BOOST_AUTO_TEST_CASE(test_character_inventory) {
{ {
auto character = Global::get().e->createPedestrian(1, {0.f, 0.f, 0.f}); auto character = Global::get().e->createPedestrian(1, {0.f, 0.f, 0.f});
@ -25,6 +24,5 @@ BOOST_AUTO_TEST_CASE(test_character_inventory) {
Global::get().e->destroyObject(character); Global::get().e->destroyObject(character);
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -4,9 +4,8 @@
#include <render/ViewCamera.hpp> #include <render/ViewCamera.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(LifetimeTests) BOOST_AUTO_TEST_SUITE(LifetimeTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_cleanup) { BOOST_AUTO_TEST_CASE(test_cleanup) {
GameObject* f = GameObject* f =
Global::get().e->createInstance(1337, glm::vec3(0.f, 0.f, 1000.f)); Global::get().e->createInstance(1337, glm::vec3(0.f, 0.f, 1000.f));
@ -29,6 +28,5 @@ BOOST_AUTO_TEST_CASE(test_cleanup) {
BOOST_CHECK(search != objects.end()); BOOST_CHECK(search != objects.end());
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -5,8 +5,7 @@
BOOST_AUTO_TEST_SUITE(LoaderDFFTests) BOOST_AUTO_TEST_SUITE(LoaderDFFTests)
#if RW_TEST_WITH_DATA BOOST_AUTO_TEST_CASE(test_load_dff, DATA_TEST_PREDICATE) {
BOOST_AUTO_TEST_CASE(test_load_dff) {
{ {
auto d = Global::get().e->data->index.openFile("landstal.dff"); auto d = Global::get().e->data->index.openFile("landstal.dff");
@ -26,8 +25,6 @@ BOOST_AUTO_TEST_CASE(test_load_dff) {
} }
} }
#endif
BOOST_AUTO_TEST_CASE(test_clump_clone) { BOOST_AUTO_TEST_CASE(test_clump_clone) {
{ {
auto frame1 = std::make_shared<ModelFrame>(0); auto frame1 = std::make_shared<ModelFrame>(0);

View File

@ -6,9 +6,8 @@
#include <objects/GameObject.hpp> #include <objects/GameObject.hpp>
#include <objects/InstanceObject.hpp> #include <objects/InstanceObject.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_SUITE(PayphoneTests) BOOST_AUTO_TEST_SUITE(PayphoneTests, DATA_TEST_PREDICATE)
BOOST_AUTO_TEST_CASE(test_payphone_interaction) { BOOST_AUTO_TEST_CASE(test_payphone_interaction) {
{ {
@ -68,5 +67,3 @@ BOOST_AUTO_TEST_CASE(test_payphone_interaction) {
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
#endif

View File

@ -3,7 +3,6 @@
#include <objects/CharacterObject.hpp> #include <objects/CharacterObject.hpp>
#include <objects/PickupObject.hpp> #include <objects/PickupObject.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
#if RW_TEST_WITH_DATA
class TestPickup : public PickupObject { class TestPickup : public PickupObject {
public: public:
@ -20,7 +19,7 @@ public:
} }
}; };
BOOST_AUTO_TEST_SUITE(PickupTests) BOOST_AUTO_TEST_SUITE(PickupTests, DATA_TEST_PREDICATE)
BOOST_AUTO_TEST_CASE(test_pickup_interaction) { BOOST_AUTO_TEST_CASE(test_pickup_interaction) {
{ {
@ -97,4 +96,3 @@ BOOST_AUTO_TEST_CASE(test_item_pickup) {
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
#endif

View File

@ -3,9 +3,8 @@
#include <platform/FileHandle.hpp> #include <platform/FileHandle.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(RWBStreamTests) BOOST_AUTO_TEST_SUITE(RWBStreamTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(iterate_stream_test) { BOOST_AUTO_TEST_CASE(iterate_stream_test) {
{ {
auto d = Global::get().e->data->index.openFile("landstal.dff"); auto d = Global::get().e->data->index.openFile("landstal.dff");
@ -28,6 +27,5 @@ BOOST_AUTO_TEST_CASE(iterate_stream_test) {
BOOST_CHECK_EQUAL(*reinterpret_cast<std::uint32_t*>(innerCursor), 0x10); BOOST_CHECK_EQUAL(*reinterpret_cast<std::uint32_t*>(innerCursor), 0x10);
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -9,8 +9,7 @@
BOOST_AUTO_TEST_SUITE(TextTests) BOOST_AUTO_TEST_SUITE(TextTests)
#if RW_TEST_WITH_DATA BOOST_AUTO_TEST_CASE(load_test, DATA_TEST_PREDICATE) {
BOOST_AUTO_TEST_CASE(load_test) {
{ {
auto d = Global::get().e->data->index.openFileRaw("text/english.gxt"); auto d = Global::get().e->data->index.openFileRaw("text/english.gxt");
@ -23,7 +22,6 @@ BOOST_AUTO_TEST_CASE(load_test) {
BOOST_CHECK_EQUAL(texts.text("1008"), T("BUSTED")); BOOST_CHECK_EQUAL(texts.text("1008"), T("BUSTED"));
} }
} }
#endif
BOOST_AUTO_TEST_CASE(special_chars) { BOOST_AUTO_TEST_CASE(special_chars) {
{ {

View File

@ -15,9 +15,8 @@ std::ostream& operator<<(std::ostream& os, const AIGraphNode* yt) {
return os; return os;
} }
BOOST_AUTO_TEST_SUITE(TrafficDirectorTests) BOOST_AUTO_TEST_SUITE(TrafficDirectorTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_available_nodes) { BOOST_AUTO_TEST_CASE(test_available_nodes) {
AIGraph graph; AIGraph graph;
@ -164,6 +163,5 @@ BOOST_AUTO_TEST_CASE(test_create_traffic) {
// Global::get().e->destroyObject(created[0]); // Global::get().e->destroyObject(created[0]);
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -3,9 +3,8 @@
#include <objects/VehicleObject.hpp> #include <objects/VehicleObject.hpp>
#include "test_Globals.hpp" #include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(VehicleTests) BOOST_AUTO_TEST_SUITE(VehicleTests, DATA_TEST_PREDICATE)
#if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_create_vehicle) { BOOST_AUTO_TEST_CASE(test_create_vehicle) {
VehicleObject* vehicle = VehicleObject* vehicle =
Global::get().e->createVehicle(90u, glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f}); Global::get().e->createVehicle(90u, glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f});
@ -130,6 +129,5 @@ BOOST_AUTO_TEST_CASE(test_open_part) {
Global::get().e->destroyObject(vehicle); Global::get().e->destroyObject(vehicle);
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()

View File

@ -34,8 +34,7 @@ BOOST_FIXTURE_TEST_CASE(weapon_scan_does_injur_others, WeaponScanFixture) {
BOOST_CHECK(scan.doesDamage(reinterpret_cast<GameObject*>(0xDEADBEEF))); BOOST_CHECK(scan.doesDamage(reinterpret_cast<GameObject*>(0xDEADBEEF)));
} }
#if RW_TEST_WITH_DATA BOOST_AUTO_TEST_CASE(TestDoWeaponScan, DATA_TEST_PREDICATE) {
BOOST_AUTO_TEST_CASE(TestDoWeaponScan) {
{ {
// Test RADIUS scan // Test RADIUS scan
auto character = Global::get().e->createPedestrian(1, {0.f, 0.f, 0.f}); auto character = Global::get().e->createPedestrian(1, {0.f, 0.f, 0.f});
@ -53,7 +52,7 @@ BOOST_AUTO_TEST_CASE(TestDoWeaponScan) {
} }
} }
BOOST_AUTO_TEST_CASE(TestProjectile) { BOOST_AUTO_TEST_CASE(TestProjectile, DATA_TEST_PREDICATE) {
{ {
auto character = Global::get().e->createPedestrian(1, {25.f, 0.f, 0.f}); auto character = Global::get().e->createPedestrian(1, {25.f, 0.f, 0.f});
BOOST_REQUIRE(character != nullptr); BOOST_REQUIRE(character != nullptr);
@ -141,6 +140,5 @@ BOOST_AUTO_TEST_CASE(TestProjectile) {
Global::get().e->destroyQueuedObjects(); Global::get().e->destroyQueuedObjects();
} }
} }
#endif
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()