Kaynağa Gözat

test: refine lib tests

skypjack 3 ay önce
ebeveyn
işleme
cffbf89d9b

+ 1 - 0
test/lib/dispatcher/shared/lib.cpp

@@ -2,6 +2,7 @@
 #include <entt/signal/dispatcher.hpp>
 #include "../../../common/boxed_type.h"
 #include "../../../common/empty.h"
+#include "lib.h"
 
 ENTT_API void trigger(entt::dispatcher &dispatcher) {
     dispatcher.trigger<test::empty>();

+ 4 - 0
test/lib/dispatcher/shared/lib.h

@@ -0,0 +1,4 @@
+#include <entt/config/config.h>
+#include <entt/signal/fwd.hpp>
+
+ENTT_API void trigger(entt::dispatcher &);

+ 1 - 2
test/lib/dispatcher/shared/main.cpp

@@ -5,8 +5,7 @@
 #include <entt/signal/sigh.hpp>
 #include "../../../common/boxed_type.h"
 #include "../../../common/listener.h"
-
-ENTT_API void trigger(entt::dispatcher &);
+#include "lib.h"
 
 TEST(Lib, Dispatcher) {
     entt::dispatcher dispatcher;

+ 1 - 0
test/lib/emitter/shared/lib.cpp

@@ -2,6 +2,7 @@
 #include "../../../common/boxed_type.h"
 #include "../../../common/emitter.h"
 #include "../../../common/empty.h"
+#include "lib.h"
 
 ENTT_API void emit(test::emitter &emitter) {
     emitter.publish(test::empty{});

+ 4 - 0
test/lib/emitter/shared/lib.h

@@ -0,0 +1,4 @@
+#include <entt/config/config.h>
+#include "../../../common/emitter.h"
+
+ENTT_API void emit(test::emitter &);

+ 1 - 2
test/lib/emitter/shared/main.cpp

@@ -3,8 +3,7 @@
 #include <entt/config/config.h>
 #include "../../../common/boxed_type.h"
 #include "../../../common/emitter.h"
-
-ENTT_API void emit(test::emitter &);
+#include "lib.h"
 
 TEST(Lib, Emitter) {
     test::emitter emitter;

+ 1 - 0
test/lib/locator/shared/lib.cpp

@@ -1,6 +1,7 @@
 #include <entt/config/config.h>
 #include <entt/locator/locator.hpp>
 #include "../../../common/boxed_type.h"
+#include "lib.h"
 
 ENTT_API void set_up(const entt::locator<test::boxed_int>::node_type &handle) {
     entt::locator<test::boxed_int>::reset(handle);

+ 6 - 0
test/lib/locator/shared/lib.h

@@ -0,0 +1,6 @@
+#include <entt/config/config.h>
+#include <entt/locator/locator.hpp>
+#include "../../../common/boxed_type.h"
+
+ENTT_API void set_up(const entt::locator<test::boxed_int>::node_type &);
+ENTT_API void use_service(int);

+ 1 - 3
test/lib/locator/shared/main.cpp

@@ -2,9 +2,7 @@
 #include <entt/config/config.h>
 #include <entt/locator/locator.hpp>
 #include "../../../common/boxed_type.h"
-
-ENTT_API void set_up(const entt::locator<test::boxed_int>::node_type &);
-ENTT_API void use_service(int);
+#include "lib.h"
 
 TEST(Lib, Locator) {
     entt::locator<test::boxed_int>::emplace().value = 4;

+ 5 - 0
test/lib/meta/shared/lib.cpp

@@ -6,11 +6,16 @@
 #include <entt/meta/meta.hpp>
 #include "../../../common/boxed_type.h"
 #include "../../../common/empty.h"
+#include "lib.h"
+
+namespace {
 
 test::boxed_int create_boxed_int(int value) {
     return test::boxed_int{value};
 }
 
+} // namespace
+
 ENTT_API void share(const entt::locator<entt::meta_ctx>::node_type &handle) {
     entt::locator<entt::meta_ctx>::reset(handle);
 }

+ 8 - 0
test/lib/meta/shared/lib.h

@@ -0,0 +1,8 @@
+#include <entt/config/config.h>
+#include <entt/locator/locator.hpp>
+#include <entt/meta/fwd.hpp>
+
+ENTT_API void share(const entt::locator<entt::meta_ctx>::node_type &);
+ENTT_API void set_up();
+ENTT_API void tear_down();
+ENTT_API entt::meta_any wrap_int(int);

+ 1 - 5
test/lib/meta/shared/main.cpp

@@ -7,11 +7,7 @@
 #include <entt/meta/resolve.hpp>
 #include "../../../common/boxed_type.h"
 #include "../../../common/empty.h"
-
-ENTT_API void share(const entt::locator<entt::meta_ctx>::node_type &);
-ENTT_API void set_up();
-ENTT_API void tear_down();
-ENTT_API entt::meta_any wrap_int(int);
+#include "lib.h"
 
 TEST(Lib, Meta) {
     using namespace entt::literals;

+ 1 - 0
test/lib/registry/shared/lib.cpp

@@ -4,6 +4,7 @@
 #include <entt/entity/view.hpp>
 #include "../../../common/boxed_type.h"
 #include "../../../common/empty.h"
+#include "lib.h"
 
 template class entt::basic_registry<entt::entity>;
 

+ 5 - 0
test/lib/registry/shared/lib.h

@@ -0,0 +1,5 @@
+#include <entt/config/config.h>
+#include <entt/entity/fwd.hpp>
+
+ENTT_API void update(entt::registry &, int);
+ENTT_API void insert(entt::registry &);

+ 1 - 3
test/lib/registry/shared/main.cpp

@@ -6,9 +6,7 @@
 #include <entt/entity/view.hpp>
 #include "../../../common/boxed_type.h"
 #include "../../../common/empty.h"
-
-ENTT_API void update(entt::registry &, int);
-ENTT_API void insert(entt::registry &);
+#include "lib.h"
 
 TEST(Lib, Registry) {
     constexpr auto count = 3;

+ 1 - 0
test/lib/view/shared/lib.cpp

@@ -1,5 +1,6 @@
 #include <entt/config/config.h>
 #include "../types.h"
+#include "lib.h"
 
 ENTT_API const void *filter(const view_type &view) {
     // forces the creation of all symbols for the view type

+ 4 - 0
test/lib/view/shared/lib.h

@@ -0,0 +1,4 @@
+#include <entt/config/config.h>
+#include "../types.h"
+
+ENTT_API const void *filter(const view_type &);

+ 1 - 2
test/lib/view/shared/main.cpp

@@ -1,8 +1,7 @@
 #include <gtest/gtest.h>
 #include <entt/config/config.h>
 #include "../types.h"
-
-ENTT_API const void *filter(const view_type &);
+#include "lib.h"
 
 TEST(Lib, View) {
     view_type view{};