Skip to content

Commit ea7698f

Browse files
committed
adds testable async module
1 parent f2edda9 commit ea7698f

File tree

5 files changed

+97
-0
lines changed

5 files changed

+97
-0
lines changed

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@
1616
"sourceFileMap": {
1717
"E:/.cache/bazel/output_base/execroot/ecsact_rt_entt": "${workspaceFolder}"
1818
}
19+
},
20+
{
21+
"name": "test //tests:async_module_test",
22+
"request": "launch",
23+
"program": "${workspaceFolder}/bazel-bin/tests/async_module_test",
24+
"cwd": "${workspaceFolder}",
25+
"args": [],
26+
"type": "cppdbg",
27+
"windows": {
28+
"type": "cppvsdbg",
29+
"program": "${workspaceFolder}/bazel-bin/tests/async_module_test.exe",
30+
},
31+
"preLaunchTask": "build //tests:async_module_test",
32+
"sourceFileMap": {
33+
"C:/users/austin/_bazel_austin/ohk2m3f2/execroot/ecsact_rt_entt": "${workspaceFolder}"
34+
}
1935
}
2036
],
2137
"compounds": []

.vscode/tasks.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
"//runtime/test:test"
2121
],
2222
"group": "build"
23+
},
24+
{
25+
"label": "build //tests:async_module_test",
26+
"command": "bazel",
27+
"type": "shell",
28+
"args": [
29+
"build",
30+
"//tests:async_module_test"
31+
],
32+
"group": "build"
2333
}
2434
]
2535
}

tests/BUILD.bazel

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
load("@rules_ecsact//ecsact:defs.bzl", "ecsact_codegen")
2+
load("@ecsact_runtime//ecsact/reference/async_reference/test:index.bzl", "ecsact_reference_async_module_test")
3+
load("//bazel:copts.bzl", "copts")
4+
load("//runtime:index.bzl", "ecsact_entt_runtime")
5+
6+
ecsact_codegen(
7+
name = "test_system_impl_sources",
8+
srcs = ["async_test.ecsact"],
9+
plugins = [
10+
"@ecsact//codegen_plugins:cpp_systems_source",
11+
],
12+
)
13+
14+
ecsact_entt_runtime(
15+
name = "async_test_core_module_runtime",
16+
srcs = ["async_test.ecsact"],
17+
ECSACT_ENTT_RUNTIME_PACKAGE = "::async_test::package",
18+
ECSACT_ENTT_RUNTIME_USER_HEADER = "async_test.ecsact.meta.hh",
19+
system_impls = ["dynamic"],
20+
)
21+
22+
ecsact_reference_async_module_test(
23+
name = "async_module_test",
24+
srcs = [
25+
"async_test.cc",
26+
":test_system_impl_sources",
27+
],
28+
copts = copts,
29+
deps = [
30+
":async_test_core_module_runtime",
31+
],
32+
)

tests/async_test.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "async_test.ecsact.systems.hh"
2+
3+
void async_test::AddComponent::impl(context& ctx) {
4+
}
5+
6+
void async_test::UpdateComponent::impl(context& ctx) {
7+
}
8+
9+
void async_test::Blah::impl(context& ctx) {
10+
}
11+
12+
void async_test::RemoveComponent::impl(context& ctx) {
13+
}

tests/async_test.ecsact

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
main package async_test;
2+
3+
component ComponentAddRemove {
4+
i32 value;
5+
}
6+
7+
component ComponentUpdate {
8+
i32 value_to_update;
9+
}
10+
11+
system Blah {
12+
readwrite ComponentUpdate;
13+
}
14+
15+
action AddComponent {
16+
include ComponentUpdate;
17+
adds ComponentAddRemove;
18+
}
19+
20+
action UpdateComponent {
21+
readwrite ComponentUpdate;
22+
}
23+
24+
action RemoveComponent{
25+
removes ComponentAddRemove;
26+
}

0 commit comments

Comments
 (0)