Skip to content

Commit af9e498

Browse files
committed
feat: Create .yaml file for fetches and add cc_test to see if it's working
1 parent c47f093 commit af9e498

File tree

6 files changed

+298
-6
lines changed

6 files changed

+298
-6
lines changed

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ bazel_dep(name = "entt", version = "3.12.2")
1414
bazel_dep(name = "ecsact_codegen", version = "0.2.0")
1515
bazel_dep(name = "ecsact_cli", version = "0.3.4")
1616
bazel_dep(name = "xxhash", version = "0.8.2")
17+
bazel_dep(name = "googletest", version = "1.14.0")
1718

1819
bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True)
1920
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)

test/BUILD.bazel

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
11
load("@ecsact_rt_entt//bazel:copts.bzl", "copts")
22
load("@ecsact_rt_entt//runtime:index.bzl", "ecsact_entt_runtime")
3+
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
34
load("@rules_cc//cc:defs.bzl", "cc_test")
45
load("@rules_ecsact//ecsact:defs.bzl", "ecsact_codegen")
56

7+
cc_test(
8+
name = "test_build_recipe",
9+
srcs = ["test_build_recipe.cc"],
10+
copts = copts,
11+
data = [
12+
"test_recipe.yml",
13+
"//:imported_pkg.ecsact",
14+
"//:runtime_test.ecsact",
15+
"@ecsact_cli",
16+
"@ecsact_rt_entt//rt_entt_codegen:ecsact_rt_entt_codegen",
17+
],
18+
env = {
19+
"ECSACT_CLI": "$(rootpath @ecsact_cli)",
20+
"ECSACT_RECIPE_PATH": "$(roothpath test_recipe.yml)",
21+
"ECSACT_RUNTIME_FILE_PATH": "$(rootpath //:runtime_test.ecsact)",
22+
"ECSACT_IMPORTED_FILE_PATH": "$rootpath //:imported_pkg.ecsact)",
23+
"ECSACT_CODEGEN_PLUGIN_PATH": "$(rootpath @ecsact_rt_entt//rt_entt_codegen:ecsact_rt_entt_codegen",
24+
},
25+
deps = [
26+
"@boost.process",
27+
"@ecsact_cli",
28+
"@googletest//:gtest",
29+
"@googletest//:gtest_main",
30+
],
31+
)
32+
33+
refresh_compile_commands(
34+
name = "refresh_compile_commands",
35+
targets = {
36+
# "//:test_build_recipe": "",
37+
"//:test": "",
38+
},
39+
)
40+
641
ecsact_codegen(
742
name = "ecsact_cc_system_impl_srcs",
843
srcs = [

test/MODULE.bazel

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
module(
2-
name = "ecsact_rt_entt_test",
3-
version = "0.1.0",
4-
compatibility_level = 1,
5-
)
1+
module(name = "ecsact_rt_entt_test")
62

73
bazel_dep(name = "rules_cc", version = "0.0.9")
84
bazel_dep(name = "bazel_skylib", version = "1.5.0")
@@ -20,7 +16,7 @@ bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True)
2016
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
2117
git_override(
2218
module_name = "hedron_compile_commands",
23-
commit = "204aa593e002cbd177d30f11f54cff3559110bb9",
19+
commit = "a14ad3a64e7bf398ab48105aaa0348e032ac87f8",
2420
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
2521
)
2622

test/ecsact_rt_entt_codegen.dll

845 KB
Binary file not shown.

test/test_build_recipe.cc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include <string>
2+
#include <filesystem>
3+
#include <cstdlib>
4+
5+
#include <gtest/gtest.h>
6+
#include <boost/process.hpp>
7+
8+
namespace fs = std::filesystem;
9+
10+
TEST(Build, Success) {
11+
auto ecsact_cli = std::getenv("ECSACT_CLI");
12+
auto codegen_plugin_path = std::getenv("CODEGEN_PLUGIN_PATH");
13+
auto ecsact_runtime_file_path = std::getenv("ECSACT_RUNTIME_FILE_PATH");
14+
auto ecsact_imported_file_path = std::getenv("ECSACT_IMPORTED_FILE_PATH");
15+
auto ecsact_recipe_path = std::getenv("ECSACT_RECIPE_PATH");
16+
17+
ASSERT_NE(ecsact_cli, nullptr);
18+
ASSERT_NE(codegen_plugin_path, nullptr);
19+
ASSERT_NE(ecsact_runtime_file_path, nullptr);
20+
ASSERT_NE(ecsact_imported_file_path, nullptr);
21+
ASSERT_NE(ecsact_recipe_path, nullptr);
22+
23+
ASSERT_TRUE(fs::exists(ecsact_cli));
24+
ASSERT_TRUE(fs::exists(codegen_plugin_path));
25+
ASSERT_TRUE(fs::exists(ecsact_runtime_file_path));
26+
ASSERT_TRUE(fs::exists(ecsact_imported_file_path));
27+
ASSERT_TRUE(fs::exists(ecsact_recipe_path));
28+
29+
boost::process.spawn(
30+
ecsact_cli,
31+
std::string(codegen_plugin_path),
32+
std::string(ecsact_runtime_file_path),
33+
std::string(ecsact_imported_file_path),
34+
std::string(ecsact_recipe_path)
35+
);
36+
}

test/test_recipe.yml

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
name: RT EnTT Recipe
2+
3+
sources:
4+
- ../test/bazel-bin/_runtime__public_hdrs/runtime_test.ecsact.hh
5+
- ../test/bazel-bin/_runtime__public_hdrs/imported_pkg.ecsact.hh
6+
- ../test/bazel-bin/_runtime__cc_srcs/runtime_test.ecsact.rt_entt.cc
7+
- codegen: ./ecsact_rt_entt_codegen
8+
outdir: _rt_entt_codegen_outdir
9+
# entt
10+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entt.hpp
11+
outdir: include/entt
12+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/graph/adjacency_matrix.hpp
13+
outdir: include/entt/graph
14+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/graph/flow.hpp
15+
outdir: include/entt/graph
16+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/graph/dot.hpp
17+
outdir: include/entt/graph
18+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/graph/fwd.hpp
19+
outdir: include/entt/graph
20+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/locator/locator.hpp
21+
outdir: include/entt/locator
22+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/platform/android-ndk-r17.hpp
23+
outdir: include/entt/platform
24+
# poly
25+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/poly/fwd.hpp
26+
outdir: include/entt/poly
27+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/poly/poly.hpp
28+
outdir: include/entt/poly
29+
# process
30+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/process/fwd.hpp
31+
outdir: include/entt/process
32+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/process/process.hpp
33+
outdir: include/entt/process
34+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/process/scheduler.hpp
35+
outdir: include/entt/process
36+
# resource
37+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/resource/cache.hpp
38+
outdir: include/entt/resource
39+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/resource/fwd.hpp
40+
outdir: include/entt/resource
41+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/resource/loader.hpp
42+
outdir: include/entt/resource
43+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/resource/resource.hpp
44+
outdir: include/entt/resource
45+
# entity
46+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/registry.hpp
47+
outdir: include/entt/entity
48+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/storage.hpp
49+
outdir: include/entt/entity
50+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/entity.hpp
51+
outdir: include/entt/entity
52+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/group.hpp
53+
outdir: include/entt/entity
54+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/fwd.hpp
55+
outdir: include/entt/entity
56+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/sparse_set.hpp
57+
outdir: include/entt/entity
58+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/group.hpp
59+
outdir: include/entt/entity
60+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/storage.hpp
61+
outdir: include/entt/entity
62+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/component.hpp
63+
outdir: include/entt/entity
64+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/mixin.hpp
65+
outdir: include/entt/entity
66+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/view.hpp
67+
outdir: include/entt/entity
68+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/handle.hpp
69+
outdir: include/entt/entity
70+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/helper.hpp
71+
outdir: include/entt/entity
72+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/observer.hpp
73+
outdir: include/entt/entity
74+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/organizer.hpp
75+
outdir: include/entt/entity
76+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/runtime_view.hpp
77+
outdir: include/entt/entity
78+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/snapshot.hpp
79+
outdir: include/entt/entity
80+
# meta
81+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/adl_pointer.hpp
82+
outdir: include/entt/meta
83+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/container.hpp
84+
outdir: include/entt/meta
85+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/context.hpp
86+
outdir: include/entt/meta
87+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/factory.hpp
88+
outdir: include/entt/meta
89+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/fwd.hpp
90+
outdir: include/entt/meta
91+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/meta.hpp
92+
outdir: include/entt/meta
93+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/node.hpp
94+
outdir: include/entt/meta
95+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/pointer.hpp
96+
outdir: include/entt/meta
97+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/policy.hpp
98+
outdir: include/entt/meta
99+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/range.hpp
100+
outdir: include/entt/meta
101+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/resolve.hpp
102+
outdir: include/entt/meta
103+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/template.hpp
104+
outdir: include/entt/meta
105+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/type_traits.hpp
106+
outdir: include/entt/meta
107+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/utility.hpp
108+
outdir: include/entt/meta
109+
# signal
110+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/sigh.hpp
111+
outdir: include/entt/signal
112+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/delegate.hpp
113+
outdir: include/entt/signal
114+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/dispatcher.hpp
115+
outdir: include/entt/signal
116+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/emitter.hpp
117+
outdir: include/entt/signal
118+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/fwd.hpp
119+
outdir: include/entt/signal
120+
# config
121+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/config/version.h
122+
outdir: include/entt/config
123+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/config/macro.h
124+
outdir: include/entt/config
125+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/config/config.h
126+
outdir: include/entt/config
127+
# container
128+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/container/dense_map.hpp
129+
outdir: include/entt/container
130+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/container/fwd.hpp
131+
outdir: include/entt/container
132+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/container/dense_set.hpp
133+
outdir: include/entt/container
134+
# core
135+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/compressed_pair.hpp
136+
outdir: include/entt/core
137+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/type_traits.hpp
138+
outdir: include/entt/core
139+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/fwd.hpp
140+
outdir: include/entt/core
141+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/iterator.hpp
142+
outdir: include/entt/core
143+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/memory.hpp
144+
outdir: include/entt/core
145+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/algorithm.hpp
146+
outdir: include/entt/core
147+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/utility.hpp
148+
outdir: include/entt/core
149+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/any.hpp
150+
outdir: include/entt/core
151+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/type_info.hpp
152+
outdir: include/entt/core
153+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/attribute.h
154+
outdir: include/entt/core
155+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/hashed_string.hpp
156+
outdir: include/entt/core
157+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/enum.hpp
158+
outdir: include/entt/core
159+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/family.hpp
160+
outdir: include/entt/core
161+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/ident.hpp
162+
outdir: include/entt/core
163+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/monostate.hpp
164+
outdir: include/entt/core
165+
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/tuple.hpp
166+
outdir: include/entt/core
167+
- path: ../ecsact/entt/detail/apply_pending.hh
168+
outdir: include/ecsact/entt/detail
169+
- path: ../ecsact/entt/detail/execution_events_collector.hh
170+
outdir: include/ecsact/entt/detail
171+
- path: ../ecsact/entt/detail/globals.hh
172+
outdir: include/ecsact/entt/detail
173+
- path: ../ecsact/entt/detail/internal_markers.hh
174+
outdir: include/ecsact/entt/detail
175+
- path: ../ecsact/entt/detail/system_execution_context.hh
176+
outdir: include/ecsact/entt/detail/
177+
- path: ../ecsact/entt/wrapper/core.hh
178+
outdir: include/ecsact/entt/wrapper
179+
- path: ../ecsact/entt/wrapper/dynamic.hh
180+
outdir: include/ecsact/entt/wrapper
181+
- path: ../ecsact/entt/entity.hh
182+
outdir: include/ecsact/entt
183+
- path: ../ecsact/entt/error_check.hh
184+
outdir: include/ecsact/entt
185+
- path: ../ecsact/entt/event_markers.hh
186+
outdir: include/ecsact/entt
187+
- path: ../ecsact/entt/execution.hh
188+
outdir: include/ecsact/entt
189+
- path: ../ecsact/entt/registry_util.hh
190+
outdir: include/ecsact/entt
191+
- ../runtime/ecsact_rt_entt_core.cc
192+
- ../runtime/ecsact_rt_entt_dynamic.cc
193+
194+
exports:
195+
# Core
196+
- ecsact_execute_systems
197+
- ecsact_destroy_registry
198+
- ecsact_clear_registry
199+
- ecsact_create_entity
200+
- ecsact_ensure_entity
201+
- ecsact_entity_exists
202+
- ecsact_destroy_entity
203+
- ecsact_count_entities
204+
- ecsact_get_entities
205+
- ecsact_add_component
206+
- ecsact_has_component
207+
- ecsact_get_component
208+
- ecsact_count_components
209+
- ecsact_each_component
210+
- ecsact_get_components
211+
- ecsact_update_component
212+
- ecsact_remove_component
213+
# Dynamic
214+
- ecsact_system_execution_context_same
215+
- ecsact_system_execution_context_entity
216+
- ecsact_system_execution_context_generate
217+
- ecsact_system_execution_context_id
218+
- ecsact_system_execution_context_other
219+
- ecsact_system_execution_context_add
220+
- ecsact_system_execution_context_remove
221+
- ecsact_system_execution_context_get
222+
- ecsact_system_execution_context_update
223+
- ecsact_system_execution_context_has
224+
- ecsact_system_execution_context_action

0 commit comments

Comments
 (0)