Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Nov 17, 2024
1 parent 9c15e44 commit f0b8aeb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-engine-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
ccache-
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCUBOS_CORE_SAMPLES=ON -DCUBOS_CORE_TESTS=ON -DCUBOS_ENGINE_TESTS=ON -DCUBOS_ENGINE_SAMPLES=ON -DUSE_CLANG_TIDY=OFF
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCUBOS_CORE_SAMPLES=ON -DCUBOS_CORE_TESTS=ON -DCUBOS_ENGINE_TESTS=ON -DCUBOS_CORE_SHARED=OFF -DCUBOS_ENGINE_SAMPLES=ON -DUSE_CLANG_TIDY=OFF
shell: bash

- name: CCache Prolog
Expand Down
57 changes: 30 additions & 27 deletions core/tests/ecs/stress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,41 @@ static Action* randomAction(ExpectedWorld& expected)
// NOLINTBEGIN(readability-function-size)
TEST_CASE("ecs::* stress test")
{
srand(1337);

for (int i = 0; i < 200; ++i)
for (int j = 0; j < 100; ++j)
{
ExpectedWorld expected{};
World world{};

// Register the types.
world.registerComponent(expected.registerComponent("cA"));
world.registerComponent(expected.registerComponent("cB"));
world.registerComponent(expected.registerComponent("cC"));
world.registerComponent(expected.registerComponent("cD"));
world.registerComponent(expected.registerComponent("cE"));
world.registerComponent(expected.registerComponent("cF"));
world.registerRelation(expected.registerRelation("rA"));
world.registerRelation(expected.registerSymmetricRelation("rB"));
world.registerRelation(expected.registerTreeRelation("rC"));
expected.testTypes(world);
srand(1337);

// Execute random actions.
std::string code;
for (int i = 0; i < 50; ++i)
for (int i = 0; i < 200; ++i)
{
auto* action = randomAction(expected);
code += action->constructor() + ".test(world, expected);\n";
ExpectedWorld expected{};
World world{};

// Register the types.
world.registerComponent(expected.registerComponent("cA"));
world.registerComponent(expected.registerComponent("cB"));
world.registerComponent(expected.registerComponent("cC"));
world.registerComponent(expected.registerComponent("cD"));
world.registerComponent(expected.registerComponent("cE"));
world.registerComponent(expected.registerComponent("cF"));
world.registerRelation(expected.registerRelation("rA"));
world.registerRelation(expected.registerSymmetricRelation("rB"));
world.registerRelation(expected.registerTreeRelation("rC"));
expected.testTypes(world);

// Execute random actions.
std::string code;
for (int i = 0; i < 50; ++i)
{
auto* action = randomAction(expected);
code += action->constructor() + ".test(world, expected);\n";
INFO(code);
action->test(world, expected);
delete action;
}

INFO(code);
action->test(world, expected);
delete action;
expected.testEntities(world);
}

INFO(code);
expected.testEntities(world);
}
}
// NOLINTEND(readability-function-size)

0 comments on commit f0b8aeb

Please sign in to comment.