From 1d85ad42e9a1abe99350732e411fc9c8e0885680 Mon Sep 17 00:00:00 2001 From: Sander Mertens Date: Wed, 11 Dec 2024 11:02:17 -0800 Subject: [PATCH] Fix CI bazel job --- .github/workflows/ci.yml | 6 +++--- MODULE.bazel | 2 +- WORKSPACE | 2 +- examples/BUILD.bazel | 6 +++--- test/BUILD | 19 ++++++------------- test/bake_tests.bzl | 16 ---------------- test/core/src/Observer.c | 10 +++++----- test/core/src/OnDelete.c | 2 +- test/core/src/Sparse.c | 24 ++++++++++++------------ 9 files changed, 32 insertions(+), 55 deletions(-) delete mode 100644 test/bake_tests.bzl diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 573df41271..06153299cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -295,7 +295,7 @@ jobs: working-directory: meson_build run: | meson compile - + build-bazel-linux: needs: build-linux runs-on: ubuntu-latest @@ -308,7 +308,7 @@ jobs: - name: build examples run: bazel build //examples/... - name: run tests - run: bazel test //test/... + run: bazel test --test_output=all //test/... build-bazel-windows: needs: build-windows @@ -322,7 +322,7 @@ jobs: - name: build examples run: bazel build //examples/... - name: run tests - run: bazel test //test/... + run: bazel test --test_output=all //test/... build-custom: needs: build-linux diff --git a/MODULE.bazel b/MODULE.bazel index d1a2765b09..35fa5fe281 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -14,7 +14,7 @@ cc_library( deps = [":util", ":bake"], defines = ["__BAKE__", "bake_test_EXPORTS"], - srcs = glob(["drivers/test/src/**/*.c", "drivers/test/src/**/*.h"]), + srcs = glob(["drivers/test/src/**/*.c"]), hdrs = glob(["drivers/test/include/**/*.h"]), includes = ["drivers/test/include"], ) diff --git a/WORKSPACE b/WORKSPACE index 3f82cc7b4c..4bf4dad7a5 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -12,7 +12,7 @@ cc_library( visibility = ["//visibility:public"], deps = [":util", ":bake"], - srcs = glob(["drivers/test/src/**/*.c", "drivers/test/src/**/*.h"]), + srcs = glob(["drivers/test/src/**/*.c"]), hdrs = glob(["drivers/test/include/**/*.h"]), includes = ["drivers/test/include"], ) diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel index 0327fb4488..4e5f4a72e4 100644 --- a/examples/BUILD.bazel +++ b/examples/BUILD.bazel @@ -3,7 +3,7 @@ cc_library( visibility = ["//:__subpackages__"], deps = ["//:flecs", "@bake//:util"], - srcs = glob(["os_api/flecs-os_api-bake/src/**/*.c", "os_api/flecs-os_api-bake/src/**/*.h"]), - hdrs = glob(["os_api/flecs-os_api-bake/include/**/*.h"]), - includes = ["os_api/flecs-os_api-bake/include"], + srcs = glob(["os_api/bake/src/**/*.c"]), + hdrs = glob(["os_api/bake/include/**/*.h"]), + includes = ["os_api/bake/include"], ) diff --git a/test/BUILD b/test/BUILD index 8cafe08183..5ce46dc3d0 100644 --- a/test/BUILD +++ b/test/BUILD @@ -1,23 +1,18 @@ -load(":bake_tests.bzl", "persuite_bake_tests") -cc_library( - name = "test-api", - deps = ["//:flecs", "//examples:os-api", "@bake//:driver-test"], - - srcs = glob(["api/src/*.c", "api/**/*.h"]), - includes = ["api/include"], +cc_test( + name = "core", + deps = ["//:flecs", "@bake//:driver-test"], + + srcs = glob(["core/src/*.c", "core/**/*.h"]), + includes = ["core/include"], ) -persuite_bake_tests("api", [":test-api"], glob(["api/src/*.c"], exclude=["api/src/main.c", "api/src/util.c"])) - cc_test( name = "collections", deps = ["//:flecs", "@bake//:driver-test"], srcs = glob(["collections/src/*.c", "collections/**/*.h"]), includes = ["collections/include"], - - timeout = "short", ) cc_test( @@ -26,6 +21,4 @@ cc_test( srcs = glob(["cpp/src/*.cpp", "cpp/**/*.h"]), includes = ["cpp/include"], - - timeout = "short", ) diff --git a/test/bake_tests.bzl b/test/bake_tests.bzl deleted file mode 100644 index 969f6cb779..0000000000 --- a/test/bake_tests.bzl +++ /dev/null @@ -1,16 +0,0 @@ - -def persuite_bake_tests(name, deps, suites, visibility=None): - suites_mangled = [s.partition(".")[0].rpartition("/")[2] for s in suites] - - for s in suites_mangled: - native.cc_test( - name = "{}-{}".format(name, s), - deps = deps, - visibility = visibility, - args = [s] - ) - - native.test_suite( - name = name, - tests = [":{}-{}".format(name, s) for s in suites_mangled] - ) diff --git a/test/core/src/Observer.c b/test/core/src/Observer.c index 5ddc4f141f..ba78d3f98e 100644 --- a/test/core/src/Observer.c +++ b/test/core/src/Observer.c @@ -7455,7 +7455,7 @@ void Observer_register_comp_in_emit_named_entity(void) { ECS_TAG(world, TagA); ECS_TAG(world, Event); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = { @@ -7498,7 +7498,7 @@ void Observer_register_comp_w_macro_in_emit_named_entity(void) { ECS_TAG(world, TagA); ECS_TAG(world, Event); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = { @@ -7544,7 +7544,7 @@ void Observer_add_to_self_in_emit_entity(void) { ECS_TAG(world, Event); ECS_TAG_DEFINE(world, Foo); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = { @@ -7574,7 +7574,7 @@ void Observer_on_set_w_not_tag(void) { ECS_COMPONENT(world, Position); ECS_TAG(world, Foo); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = { @@ -7608,7 +7608,7 @@ void Observer_on_set_w_not_component(void) { ECS_COMPONENT(world, Position); ECS_COMPONENT(world, Velocity); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = { diff --git a/test/core/src/OnDelete.c b/test/core/src/OnDelete.c index 848cf70875..b5ed5e7b2f 100644 --- a/test/core/src/OnDelete.c +++ b/test/core/src/OnDelete.c @@ -2872,7 +2872,7 @@ void OnDelete_delete_with_inherited_tag_w_observer(void) { ecs_entity_t base = ecs_new_w(world, Tag); ecs_entity_t inst = ecs_new_w_pair(world, EcsIsA, base); - Probe ctx; + Probe ctx = {0}; ecs_entity_t o = ecs_observer_init(world, &(ecs_observer_desc_t){ .query.terms = {{ Tag }}, .events = { EcsOnRemove }, diff --git a/test/core/src/Sparse.c b/test/core/src/Sparse.c index 3ab5c5914d..a48b870183 100644 --- a/test/core/src/Sparse.c +++ b/test/core/src/Sparse.c @@ -1295,7 +1295,7 @@ void Sparse_on_add_observer(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }}, @@ -1324,7 +1324,7 @@ void Sparse_on_set_observer_set(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }}, @@ -1355,7 +1355,7 @@ void Sparse_on_set_observer_modified(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }}, @@ -1391,7 +1391,7 @@ void Sparse_on_set_observer_insert(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }}, @@ -1421,7 +1421,7 @@ void Sparse_on_remove_observer_remove(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }}, @@ -1453,7 +1453,7 @@ void Sparse_on_remove_observer_clear(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }}, @@ -1485,7 +1485,7 @@ void Sparse_on_remove_observer_delete(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }}, @@ -1517,7 +1517,7 @@ void Sparse_on_remove_observer_fini(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }}, @@ -1565,7 +1565,7 @@ void Sparse_on_set_after_remove_override(void) { ecs_set(world, e, Position, {30, 40}); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ ecs_id(Position) }}, @@ -1618,7 +1618,7 @@ void Sparse_on_add_observer_2_terms(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); ecs_add_id(world, ecs_id(Velocity), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }, { .id = ecs_id(Velocity) }}, @@ -1652,7 +1652,7 @@ void Sparse_on_set_observer_2_terms(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); ecs_add_id(world, ecs_id(Velocity), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }, { .id = ecs_id(Velocity) }}, @@ -1687,7 +1687,7 @@ void Sparse_on_remove_observer_2_terms(void) { ecs_add_id(world, ecs_id(Position), EcsSparse); ecs_add_id(world, ecs_id(Velocity), EcsSparse); - Probe ctx; + Probe ctx = {0}; ecs_observer(world, { .query.terms = {{ .id = ecs_id(Position) }, { .id = ecs_id(Velocity) }},