Skip to content

moved async test to nested workspace #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tests/serialize
tests
6 changes: 3 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ build --incompatible_enable_cc_toolchain_resolution
build --incompatible_strict_action_env
build --enable_runfiles

build:windows --platforms=//bazel/platforms:windows
build:windows --host_platform=//bazel/platforms:windows
build:windows --platforms=@ecsact_runtime//bazel/platforms:windows
build:windows --host_platform=@ecsact_runtime//bazel/platforms:windows

build:linux --platforms=//bazel/platforms:linux
build:linux --platforms=@ecsact_runtime//bazel/platforms:linux
build:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux

common:ci --announce_rc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
key: ${{runner.os}}-bazel-cache
- uses: actions/checkout@v3
- run: bazel test --config=ci //...
- run: cd tests/serialize
- run: cd tests
- run: bazel test --config=ci //...

test-linux:
Expand All @@ -43,7 +43,7 @@ jobs:
key: ${{runner.os}}-bazel-cache
- uses: actions/checkout@v3
- run: bazel test --config=ci //...
- run: cd tests/serialize
- run: cd tests
- run: bazel test --config=ci //...

check-module-headers:
Expand Down
3 changes: 2 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports_files([
"ecsact/runtime/static.h",
"ecsact/runtime.h",
"codegen_plugin.bzl",
"ecsact/codegen/ecsact_codegen_plugin_test.cc",
"index.bzl",
])

Expand Down Expand Up @@ -96,7 +97,7 @@ cc_library(
"ecsact/runtime/serialize.hh",
],
copts = copts,
deps = [":common"],
deps = [":common", ":core"],
)

cc_library(
Expand Down
2 changes: 1 addition & 1 deletion codegen_plugin.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def cc_ecsact_codegen_plugin(name = None, srcs = [], deps = [], defines = [], no
if not no_validate_test:
cc_test(
name = "{}__validate".format(name),
srcs = ["@ecsact_runtime//tests:ecsact_codegen_plugin_test.cc"],
srcs = ["@ecsact_runtime//:ecsact/codegen/ecsact_codegen_plugin_test.cc"],
args = ["$(rootpath :{}_bin)".format(name)],
copts = _copts,
data = [":{}_bin".format(name)],
Expand Down
1 change: 1 addition & 0 deletions ecsact/runtime/serialize.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <vector>
#include <type_traits>
#include "ecsact/runtime/serialize.h"
#include "ecsact/runtime/core.h"

namespace ecsact {

Expand Down
7 changes: 0 additions & 7 deletions reference/async_reference/test/BUILD.bazel

This file was deleted.

39 changes: 0 additions & 39 deletions reference/async_reference/test/index.bzl

This file was deleted.

2 changes: 1 addition & 1 deletion tests/serialize/.bazelrc → tests/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import %workspace%/../../.bazelrc
import %workspace%/../.bazelrc
try-import %workspace%/user.bazelrc
File renamed without changes.
11 changes: 3 additions & 8 deletions tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
load("@rules_cc//cc:defs.bzl", "cc_test")
load("//bazel:copts.bzl", "copts")
load("//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")

exports_files(
["ecsact_codegen_plugin_test.cc"],
visibility = ["//visibility:public"],
)
load("@ecsact_runtime//bazel:copts.bzl", "copts")
load("@ecsact_runtime//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")

cc_ecsact_codegen_plugin(
name = "empty_codegen_plugin",
Expand All @@ -19,7 +14,7 @@ cc_test(
srcs = ["test.cc"],
copts = copts,
deps = [
"//:ecsact_runtime",
"@ecsact_runtime",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
Expand Down
147 changes: 88 additions & 59 deletions tests/serialize/WORKSPACE.bazel → tests/WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -1,59 +1,88 @@
workspace(name = "ecsact_runtime_serialize_test")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

local_repository(
name = "ecsact_runtime",
path = "../../",
)

http_archive(
name = "ecsact_lang_cpp",
sha256 = "2eb4456d0a706952bd46cff9cb6d1353a70d981e69eb42939da65b4c019ec610",
strip_prefix = "ecsact_lang_cpp-23cb4156fb69a3e7e54a1093a91cd63a87a8abb2",
url = "https://github.com/ecsact-dev/ecsact_lang_cpp/archive/23cb4156fb69a3e7e54a1093a91cd63a87a8abb2.zip",
)

http_archive(
name = "rules_ecsact",
sha256 = "e6d888c63aa536b5b7c6af10d217cdb8ad98b2262fa9d02515a99edbd0d94eea",
strip_prefix = "rules_ecsact-0.2.1",
url = "https://github.com/ecsact-dev/rules_ecsact/archive/refs/tags/0.2.1.tar.gz",
)

load("@rules_ecsact//ecsact:repositories.bzl", "ecsact_register_toolchains", "rules_ecsact_dependencies")

rules_ecsact_dependencies()

ecsact_register_toolchains()

http_archive(
name = "com_google_googletest",
sha256 = "ca6c78876bd052a7730dd717ba083e7351e26b3cfa68c5e3babd1b9d9925402e",
strip_prefix = "googletest-0e0d9feefab1b51aaab9dfd70132e93c0b6964e5",
url = "https://github.com/google/googletest/archive/0e0d9feefab1b51aaab9dfd70132e93c0b6964e5.zip",
)

http_archive(
name = "hedron_compile_commands",
sha256 = "4b251a482a85de6c5cb0dc34c5671e73190b9ff348e9979fa2c033d81de0f928",
strip_prefix = "bazel-compile-commands-extractor-5bb5ff2f32d542a986033102af771aa4206387b9",
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/5bb5ff2f32d542a986033102af771aa4206387b9.tar.gz",
)

load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")

hedron_compile_commands_setup()
# NOTE: This workspace file is only necessary to prevent a cyclic dependency
# between ecsact_rt_entt and this repository. Once a reference runtime
# is built we can remove this nested workspace.
# https://github.com/ecsact-dev/ecsact_runtime/issues/32
workspace(name = "ecsact_runtime_tests")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

local_repository(
name = "ecsact_runtime",
path = "..",
)

http_archive(
name = "boost",
sha256 = "4a79c389add7e3d54d0e12c83098d471d24536ba2d6b8593d3a95f151f25eebb",
strip_prefix = "boost-da62319c330d81ef032517cbe13b6f35d97387cb",
urls = ["https://github.com/bazelboost/boost/archive/da62319c330d81ef032517cbe13b6f35d97387cb.zip"],
)

load("@boost//:index.bzl", "boost_http_archives")

boost_http_archives()

http_archive(
name = "ecsact_rt_entt",
sha256 = "",
strip_prefix = "ecsact_rt_entt-440fa3f35ad9a19ce86f8280dc3e751945b4ee42",
url = "https://github.com/ecsact-dev/ecsact_rt_entt/archive/440fa3f35ad9a19ce86f8280dc3e751945b4ee42.zip",
)

http_archive(
name = "com_github_skypjack_entt",
sha256 = "f7031545130bfc06f5fe6b2f8c87dcbd4c1254fab86657e2788b70dfeea57965",
strip_prefix = "entt-3.10.1",
url = "https://github.com/skypjack/entt/archive/refs/tags/v3.10.1.tar.gz",
)

http_archive(
name = "ecsact_lang_cpp",
sha256 = "2eb4456d0a706952bd46cff9cb6d1353a70d981e69eb42939da65b4c019ec610",
strip_prefix = "ecsact_lang_cpp-23cb4156fb69a3e7e54a1093a91cd63a87a8abb2",
url = "https://github.com/ecsact-dev/ecsact_lang_cpp/archive/23cb4156fb69a3e7e54a1093a91cd63a87a8abb2.zip",
)

http_archive(
name = "rules_ecsact",
sha256 = "e6d888c63aa536b5b7c6af10d217cdb8ad98b2262fa9d02515a99edbd0d94eea",
strip_prefix = "rules_ecsact-0.2.1",
url = "https://github.com/ecsact-dev/rules_ecsact/archive/refs/tags/0.2.1.tar.gz",
)

load("@rules_ecsact//ecsact:repositories.bzl", "ecsact_register_toolchains", "rules_ecsact_dependencies")

rules_ecsact_dependencies()

ecsact_register_toolchains()

http_archive(
name = "com_google_googletest",
sha256 = "ca6c78876bd052a7730dd717ba083e7351e26b3cfa68c5e3babd1b9d9925402e",
strip_prefix = "googletest-0e0d9feefab1b51aaab9dfd70132e93c0b6964e5",
url = "https://github.com/google/googletest/archive/0e0d9feefab1b51aaab9dfd70132e93c0b6964e5.zip",
)

http_archive(
name = "hedron_compile_commands",
sha256 = "4b251a482a85de6c5cb0dc34c5671e73190b9ff348e9979fa2c033d81de0f928",
strip_prefix = "bazel-compile-commands-extractor-5bb5ff2f32d542a986033102af771aa4206387b9",
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/5bb5ff2f32d542a986033102af771aa4206387b9.tar.gz",
)

load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")

hedron_compile_commands_setup()
46 changes: 46 additions & 0 deletions tests/async/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
load("@rules_cc//cc:defs.bzl", "cc_test")
load("@rules_ecsact//ecsact:defs.bzl", "ecsact_codegen")
load("@ecsact_runtime//bazel:copts.bzl", "copts")
load("@ecsact_rt_entt//runtime:index.bzl", "ecsact_entt_runtime")

ecsact_entt_runtime(
name = "async_test_core_module_runtime",
srcs = ["async_test.ecsact"],
ECSACT_ENTT_RUNTIME_PACKAGE = "::async_test::package",
ECSACT_ENTT_RUNTIME_USER_HEADER = "async_test.ecsact.meta.hh",
system_impls = ["dynamic"],
)

ecsact_codegen(
name = "async_test_support_generated_headers",
srcs = ["async_test.ecsact"],
plugins = [
"@ecsact//codegen_plugins:cpp_header",
"@ecsact//codegen_plugins:cpp_systems_header",
"@ecsact//codegen_plugins:systems_header",
"@ecsact//codegen_plugins:cpp_systems_source",
"@ecsact_runtime//reference/serialize_reference/codegen",
],
)

cc_test(
name = "async",
copts = copts,
srcs = [
"async_ref_test.cc",
":async_test_support_generated_headers",
"@ecsact_runtime//reference/async_reference:async_reference.cc",
"@ecsact_runtime//reference/async_reference:async_reference.hh",
"@ecsact_runtime//reference/async_reference:async.cc",
],
deps = [
":async_test_core_module_runtime",
"@ecsact_runtime//:core",
"@ecsact_runtime//:async",
"@ecsact_runtime//:dynamic",
"@ecsact_runtime//reference/async_reference:async",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@ecsact_runtime//reference/serialize_reference",
],
)
2 changes: 1 addition & 1 deletion tests/serialize/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@rules_cc//cc:defs.bzl", "cc_test")
load("@rules_ecsact//ecsact:defs.bzl", "ecsact_codegen")
load("//bazel:copts.bzl", "copts")
load("@ecsact_runtime//bazel:copts.bzl", "copts")

ecsact_codegen(
name = "serialize_test_generated",
Expand Down
Empty file removed tests/serialize/bazel/BUILD.bazel
Empty file.
4 changes: 0 additions & 4 deletions tests/serialize/bazel/copts.bzl

This file was deleted.

19 changes: 0 additions & 19 deletions tests/serialize/bazel/platforms/BUILD.bazel

This file was deleted.

2 changes: 1 addition & 1 deletion tests/serialize/serialize_test.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "gtest/gtest.h"
#include <vector>
#include "ecsact/runtime/serialize.hh"
#include "serialize_test_generated/serialize_test.ecsact.hh"
#include "serialize/serialize_test_generated/serialize_test.ecsact.hh"

TEST(Serialize, Correctness) {
auto comp = serialize_test::ExampleComponent{};
Expand Down