Skip to content

Commit

Permalink
feat: Create .yaml file for fetches and add cc_test to see if it's wo…
Browse files Browse the repository at this point in the history
…rking
  • Loading branch information
Kelwan committed May 8, 2024
1 parent c47f093 commit af9e498
Show file tree
Hide file tree
Showing 6 changed files with 298 additions and 6 deletions.
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ bazel_dep(name = "entt", version = "3.12.2")
bazel_dep(name = "ecsact_codegen", version = "0.2.0")
bazel_dep(name = "ecsact_cli", version = "0.3.4")
bazel_dep(name = "xxhash", version = "0.8.2")
bazel_dep(name = "googletest", version = "1.14.0")

bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True)
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
Expand Down
35 changes: 35 additions & 0 deletions test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,43 @@
load("@ecsact_rt_entt//bazel:copts.bzl", "copts")
load("@ecsact_rt_entt//runtime:index.bzl", "ecsact_entt_runtime")
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
load("@rules_cc//cc:defs.bzl", "cc_test")
load("@rules_ecsact//ecsact:defs.bzl", "ecsact_codegen")

cc_test(
name = "test_build_recipe",
srcs = ["test_build_recipe.cc"],
copts = copts,
data = [
"test_recipe.yml",
"//:imported_pkg.ecsact",
"//:runtime_test.ecsact",
"@ecsact_cli",
"@ecsact_rt_entt//rt_entt_codegen:ecsact_rt_entt_codegen",
],
env = {
"ECSACT_CLI": "$(rootpath @ecsact_cli)",
"ECSACT_RECIPE_PATH": "$(roothpath test_recipe.yml)",
"ECSACT_RUNTIME_FILE_PATH": "$(rootpath //:runtime_test.ecsact)",
"ECSACT_IMPORTED_FILE_PATH": "$rootpath //:imported_pkg.ecsact)",
"ECSACT_CODEGEN_PLUGIN_PATH": "$(rootpath @ecsact_rt_entt//rt_entt_codegen:ecsact_rt_entt_codegen",
},
deps = [
"@boost.process",
"@ecsact_cli",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)

refresh_compile_commands(
name = "refresh_compile_commands",
targets = {
# "//:test_build_recipe": "",
"//:test": "",
},
)

ecsact_codegen(
name = "ecsact_cc_system_impl_srcs",
srcs = [
Expand Down
8 changes: 2 additions & 6 deletions test/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
module(
name = "ecsact_rt_entt_test",
version = "0.1.0",
compatibility_level = 1,
)
module(name = "ecsact_rt_entt_test")

bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
Expand All @@ -20,7 +16,7 @@ bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True)
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
commit = "204aa593e002cbd177d30f11f54cff3559110bb9",
commit = "a14ad3a64e7bf398ab48105aaa0348e032ac87f8",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
)

Expand Down
Binary file added test/ecsact_rt_entt_codegen.dll
Binary file not shown.
36 changes: 36 additions & 0 deletions test/test_build_recipe.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include <string>
#include <filesystem>
#include <cstdlib>

#include <gtest/gtest.h>
#include <boost/process.hpp>

namespace fs = std::filesystem;

TEST(Build, Success) {
auto ecsact_cli = std::getenv("ECSACT_CLI");
auto codegen_plugin_path = std::getenv("CODEGEN_PLUGIN_PATH");
auto ecsact_runtime_file_path = std::getenv("ECSACT_RUNTIME_FILE_PATH");
auto ecsact_imported_file_path = std::getenv("ECSACT_IMPORTED_FILE_PATH");
auto ecsact_recipe_path = std::getenv("ECSACT_RECIPE_PATH");

ASSERT_NE(ecsact_cli, nullptr);
ASSERT_NE(codegen_plugin_path, nullptr);
ASSERT_NE(ecsact_runtime_file_path, nullptr);
ASSERT_NE(ecsact_imported_file_path, nullptr);
ASSERT_NE(ecsact_recipe_path, nullptr);

ASSERT_TRUE(fs::exists(ecsact_cli));
ASSERT_TRUE(fs::exists(codegen_plugin_path));
ASSERT_TRUE(fs::exists(ecsact_runtime_file_path));
ASSERT_TRUE(fs::exists(ecsact_imported_file_path));
ASSERT_TRUE(fs::exists(ecsact_recipe_path));

boost::process.spawn(
ecsact_cli,
std::string(codegen_plugin_path),
std::string(ecsact_runtime_file_path),
std::string(ecsact_imported_file_path),
std::string(ecsact_recipe_path)
);
}
224 changes: 224 additions & 0 deletions test/test_recipe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
name: RT EnTT Recipe

sources:
- ../test/bazel-bin/_runtime__public_hdrs/runtime_test.ecsact.hh
- ../test/bazel-bin/_runtime__public_hdrs/imported_pkg.ecsact.hh
- ../test/bazel-bin/_runtime__cc_srcs/runtime_test.ecsact.rt_entt.cc
- codegen: ./ecsact_rt_entt_codegen
outdir: _rt_entt_codegen_outdir
# entt
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entt.hpp
outdir: include/entt
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/graph/adjacency_matrix.hpp
outdir: include/entt/graph
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/graph/flow.hpp
outdir: include/entt/graph
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/graph/dot.hpp
outdir: include/entt/graph
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/graph/fwd.hpp
outdir: include/entt/graph
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/locator/locator.hpp
outdir: include/entt/locator
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/platform/android-ndk-r17.hpp
outdir: include/entt/platform
# poly
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/poly/fwd.hpp
outdir: include/entt/poly
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/poly/poly.hpp
outdir: include/entt/poly
# process
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/process/fwd.hpp
outdir: include/entt/process
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/process/process.hpp
outdir: include/entt/process
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/process/scheduler.hpp
outdir: include/entt/process
# resource
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/resource/cache.hpp
outdir: include/entt/resource
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/resource/fwd.hpp
outdir: include/entt/resource
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/resource/loader.hpp
outdir: include/entt/resource
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/resource/resource.hpp
outdir: include/entt/resource
# entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/registry.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/storage.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/entity.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/group.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/fwd.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/sparse_set.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/group.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/storage.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/component.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/mixin.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/view.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/handle.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/helper.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/observer.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/organizer.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/runtime_view.hpp
outdir: include/entt/entity
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/entity/snapshot.hpp
outdir: include/entt/entity
# meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/adl_pointer.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/container.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/context.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/factory.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/fwd.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/meta.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/node.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/pointer.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/policy.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/range.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/resolve.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/template.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/type_traits.hpp
outdir: include/entt/meta
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/meta/utility.hpp
outdir: include/entt/meta
# signal
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/sigh.hpp
outdir: include/entt/signal
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/delegate.hpp
outdir: include/entt/signal
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/dispatcher.hpp
outdir: include/entt/signal
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/emitter.hpp
outdir: include/entt/signal
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/signal/fwd.hpp
outdir: include/entt/signal
# config
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/config/version.h
outdir: include/entt/config
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/config/macro.h
outdir: include/entt/config
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/config/config.h
outdir: include/entt/config
# container
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/container/dense_map.hpp
outdir: include/entt/container
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/container/fwd.hpp
outdir: include/entt/container
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/container/dense_set.hpp
outdir: include/entt/container
# core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/compressed_pair.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/type_traits.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/fwd.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/iterator.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/memory.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/algorithm.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/utility.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/any.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/type_info.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/attribute.h
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/hashed_string.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/enum.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/family.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/ident.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/monostate.hpp
outdir: include/entt/core
- fetch: https://raw.githubusercontent.com/skypjack/entt/v3.12.2/src/entt/core/tuple.hpp
outdir: include/entt/core
- path: ../ecsact/entt/detail/apply_pending.hh
outdir: include/ecsact/entt/detail
- path: ../ecsact/entt/detail/execution_events_collector.hh
outdir: include/ecsact/entt/detail
- path: ../ecsact/entt/detail/globals.hh
outdir: include/ecsact/entt/detail
- path: ../ecsact/entt/detail/internal_markers.hh
outdir: include/ecsact/entt/detail
- path: ../ecsact/entt/detail/system_execution_context.hh
outdir: include/ecsact/entt/detail/
- path: ../ecsact/entt/wrapper/core.hh
outdir: include/ecsact/entt/wrapper
- path: ../ecsact/entt/wrapper/dynamic.hh
outdir: include/ecsact/entt/wrapper
- path: ../ecsact/entt/entity.hh
outdir: include/ecsact/entt
- path: ../ecsact/entt/error_check.hh
outdir: include/ecsact/entt
- path: ../ecsact/entt/event_markers.hh
outdir: include/ecsact/entt
- path: ../ecsact/entt/execution.hh
outdir: include/ecsact/entt
- path: ../ecsact/entt/registry_util.hh
outdir: include/ecsact/entt
- ../runtime/ecsact_rt_entt_core.cc
- ../runtime/ecsact_rt_entt_dynamic.cc

exports:
# Core
- ecsact_execute_systems
- ecsact_destroy_registry
- ecsact_clear_registry
- ecsact_create_entity
- ecsact_ensure_entity
- ecsact_entity_exists
- ecsact_destroy_entity
- ecsact_count_entities
- ecsact_get_entities
- ecsact_add_component
- ecsact_has_component
- ecsact_get_component
- ecsact_count_components
- ecsact_each_component
- ecsact_get_components
- ecsact_update_component
- ecsact_remove_component
# Dynamic
- ecsact_system_execution_context_same
- ecsact_system_execution_context_entity
- ecsact_system_execution_context_generate
- ecsact_system_execution_context_id
- ecsact_system_execution_context_other
- ecsact_system_execution_context_add
- ecsact_system_execution_context_remove
- ecsact_system_execution_context_get
- ecsact_system_execution_context_update
- ecsact_system_execution_context_has
- ecsact_system_execution_context_action

0 comments on commit af9e498

Please # to comment.