-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
378 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
#include "EntityFactory.h" | ||
#include "EntityFactory.h" | ||
|
||
|
||
namespace ecs::benchmarks::pico_ecs::entities { | ||
|
||
namespace details { | ||
|
||
void VelocityComponent_constructor(ecs_t* ecs, ecs_id_t entity_id, void* ptr, void* args) { | ||
(void)ecs; | ||
(void)entity_id; | ||
(void)args; | ||
|
||
ecs::benchmarks::base::components::VelocityComponent* comp = | ||
reinterpret_cast<ecs::benchmarks::base::components::VelocityComponent*>(ptr); | ||
comp->x = 1.0F; | ||
comp->y = 1.0F; | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
#define PICO_ECS_IMPLEMENTATION | ||
#include <pico_ecs.h> | ||
#include <pico_ecs.h> | ||
|
||
#undef PICO_ECS_IMPLEMENTATION | ||
#include "entities/EntityFactory.h" | ||
namespace ecs::benchmarks::pico_ecs::entities { | ||
size_t EntityFactory::getEntitiesCount(details::EntityManager& registry) { | ||
return registry.ecs->entity_pool.capacity-registry.ecs->entity_pool.size; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,37 @@ | ||
add_executable(${CMAKE_PROJECT_NAME}-constexpr-tests) | ||
target_sources(${CMAKE_PROJECT_NAME}-constexpr-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-constexpr-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-constexpr-tests PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-constexpr-tests PRIVATE ${PROJECT_BINARY_DIR}/include) | ||
target_link_libraries(${CMAKE_PROJECT_NAME}-constexpr-tests PRIVATE project_warnings project_options) | ||
target_compile_definitions(${CMAKE_PROJECT_NAME}-constexpr-tests PRIVATE -DCONSTEXPR_TESTING) | ||
add_executable(ecs-benchmark-constexpr-tests) | ||
target_sources(ecs-benchmark-constexpr-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) | ||
target_include_directories(ecs-benchmark-constexpr-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_include_directories(ecs-benchmark-constexpr-tests PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
target_include_directories(ecs-benchmark-constexpr-tests PRIVATE ${PROJECT_BINARY_DIR}/include) | ||
target_link_libraries(ecs-benchmark-constexpr-tests PRIVATE project_warnings project_options) | ||
target_compile_definitions(ecs-benchmark-constexpr-tests PRIVATE -DCONSTEXPR_TESTING) | ||
|
||
# @NOTE: add libs here | ||
target_link_libraries(${CMAKE_PROJECT_NAME}-constexpr-tests PRIVATE ${CMAKE_PROJECT_NAME}::base) | ||
target_link_system_library(${CMAKE_PROJECT_NAME}-constexpr-tests PRIVATE Catch2::Catch2) | ||
target_link_system_library(${CMAKE_PROJECT_NAME}-constexpr-tests PRIVATE Catch2::Catch2WithMain) | ||
target_link_libraries(ecs-benchmark-constexpr-tests PRIVATE ecs-benchmark::base) | ||
target_link_system_libraries(ecs-benchmark-constexpr-tests PRIVATE Catch2::Catch2 Catch2::Catch2WithMain) | ||
|
||
# automatically discover tests that are defined in catch based test files you can modify the unittests. TEST_PREFIX to whatever you want, or | ||
# use different for different binaries | ||
catch_discover_tests(${CMAKE_PROJECT_NAME}-constexpr-tests) | ||
catch_discover_tests(ecs-benchmark-constexpr-tests) | ||
|
||
|
||
|
||
# Disable the constexpr portion of the test, and build again this allows us to have an executable that we can debug when things go wrong | ||
# with the constexpr testing | ||
add_executable(${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests) | ||
target_sources(${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests PRIVATE ${${CMAKE_PROJECT_NAME}_CONSTEXPR_TEST_SOURCE} | ||
${${CMAKE_PROJECT_NAME}_CONSTEXPR_TEST_HEADERS}) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests PRIVATE ${PROJECT_BINARY_DIR}/include) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include) | ||
target_link_libraries(${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests PRIVATE project_warnings project_options) | ||
target_compile_definitions(${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests PRIVATE -DRELAXED_CONSTEXPR_TESTING) | ||
target_compile_definitions(${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests PRIVATE -DCATCH_CONFIG_RUNTIME_STATIC_REQUIRE) | ||
add_executable(ecs-benchmark-relaxed-constexpr-tests) | ||
target_sources(ecs-benchmark-constexpr-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests.cpp) | ||
target_include_directories(ecs-benchmark-relaxed-constexpr-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_include_directories(ecs-benchmark-relaxed-constexpr-tests PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
target_include_directories(ecs-benchmark-relaxed-constexpr-tests PRIVATE ${PROJECT_BINARY_DIR}/include) | ||
target_include_directories(ecs-benchmark-relaxed-constexpr-tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include) | ||
target_link_libraries(ecs-benchmark-relaxed-constexpr-tests PRIVATE project_warnings project_options) | ||
target_compile_definitions(ecs-benchmark-relaxed-constexpr-tests PRIVATE -DRELAXED_CONSTEXPR_TESTING) | ||
target_compile_definitions(ecs-benchmark-relaxed-constexpr-tests PRIVATE -DCATCH_CONFIG_RUNTIME_STATIC_REQUIRE) | ||
|
||
# @NOTE: add libs here | ||
target_link_libraries(ecs-benchmark-relaxed-constexpr-tests PRIVATE ecs-benchmark::base) | ||
target_link_system_libraries(ecs-benchmark-relaxed-constexpr-tests PRIVATE Catch2::Catch2 Catch2::Catch2WithMain) | ||
|
||
catch_discover_tests( | ||
${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests | ||
TEST_PREFIX | ||
"relaxed_constexpr." | ||
REPORTER | ||
xml | ||
OUTPUT_DIR | ||
. | ||
OUTPUT_PREFIX | ||
"relaxed_constexpr." | ||
OUTPUT_SUFFIX | ||
.xml) | ||
|
||
if(ENABLE_COVERAGE) | ||
setup_target_for_coverage_gcovr_html( | ||
NAME | ||
${CMAKE_PROJECT_NAME}-coverage-constexpr-test | ||
EXECUTABLE | ||
${CMAKE_PROJECT_NAME}-constexpr-tests | ||
EXCLUDE | ||
"${PROJECT_SOURCE_DIR}/benchmark" | ||
"${PROJECT_SOURCE_DIR}/src/app/desktop" | ||
"${PROJECT_SOURCE_DIR}/src/app/raspberrypi" | ||
"${PROJECT_SOURCE_DIR}/src/core" | ||
"${PROJECT_SOURCE_DIR}/src/persistence" | ||
"${PROJECT_SOURCE_DIR}/test" | ||
"${PROJECT_SOURCE_DIR}/test/tests" | ||
"${PROJECT_SOURCE_DIR}/thirdparty" | ||
"${CMAKE_BINARY_DIR}/_deps") | ||
|
||
setup_target_for_coverage_gcovr_html( | ||
NAME | ||
${CMAKE_PROJECT_NAME}-coverage-relaxed-constexpr-test | ||
EXECUTABLE | ||
${CMAKE_PROJECT_NAME}-relaxed-constexpr-tests | ||
EXCLUDE | ||
"${PROJECT_SOURCE_DIR}/benchmark" | ||
"${PROJECT_SOURCE_DIR}/src/app/engine" | ||
"${PROJECT_SOURCE_DIR}/test" | ||
"${PROJECT_SOURCE_DIR}/test/constexpr_tests" | ||
"${PROJECT_SOURCE_DIR}/test/integrartion_tests" | ||
"${PROJECT_SOURCE_DIR}/test/tests" | ||
"${PROJECT_SOURCE_DIR}/thirdparty" | ||
"${CMAKE_BINARY_DIR}/_deps") | ||
endif() | ||
# automatically discover tests that are defined in catch based test files you can modify the unittests. TEST_PREFIX to whatever you want, or | ||
# use different for different binaries | ||
catch_discover_tests(ecs-benchmark-relaxed-constexpr-tests) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,19 @@ | ||
add_executable(${CMAKE_PROJECT_NAME}-integration-tests) | ||
target_sources(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests.cpp) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE ${PROJECT_BINARY_DIR}/include) | ||
target_include_directories(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include) | ||
target_link_libraries(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE project_warnings project_options) | ||
target_compile_definitions(${CMAKE_PROJECT_NAME}-integration-tests PUBLIC -DINTEGRATION_TESTING) | ||
add_executable(ecs-benchmark-integration-tests) | ||
target_sources(ecs-benchmark-integration-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests.cpp) | ||
target_include_directories(ecs-benchmark-integration-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_include_directories(ecs-benchmark-integration-tests PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
target_include_directories(ecs-benchmark-integration-tests PRIVATE ${PROJECT_BINARY_DIR}/include) | ||
target_include_directories(ecs-benchmark-integration-tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include) | ||
target_link_libraries(ecs-benchmark-integration-tests PRIVATE project_warnings project_options) | ||
target_compile_definitions(ecs-benchmark-integration-tests PUBLIC -DINTEGRATION_TESTING) | ||
|
||
# @NOTE: add libs here | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
find_package(Threads REQUIRED) | ||
target_link_libraries(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE ${CMAKE_PROJECT_NAME}::base) | ||
target_link_system_library(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE Threads::Threads) | ||
target_link_system_library(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE Catch2::Catch2) | ||
target_link_system_library(${CMAKE_PROJECT_NAME}-integration-tests PRIVATE Catch2::Catch2 Catch2::Catch2WithMain) | ||
target_link_libraries(ecs-benchmark-integration-tests PRIVATE ecs-benchmark::base) | ||
target_link_system_libraries(ecs-benchmark-integration-tests PRIVATE Threads::Threads) | ||
target_link_system_libraries(ecs-benchmark-integration-tests PRIVATE Catch2::Catch2 Catch2::Catch2WithMain) | ||
|
||
# automatically discover tests that are defined in catch based test files you can modify the unittests. TEST_PREFIX to whatever you want, or | ||
# use different for different binaries | ||
catch_discover_tests(${CMAKE_PROJECT_NAME}-integration-tests | ||
|
||
if(ENABLE_COVERAGE) | ||
setup_target_for_coverage_gcovr_html( | ||
NAME | ||
${CMAKE_PROJECT_NAME}-coverage-integration-test | ||
EXECUTABLE | ||
${CMAKE_PROJECT_NAME}-integration-test | ||
EXCLUDE | ||
"${PROJECT_SOURCE_DIR}/benchmark" | ||
"${PROJECT_SOURCE_DIR}/test" | ||
"${PROJECT_SOURCE_DIR}/test/constexpr_tests" | ||
"${PROJECT_SOURCE_DIR}/test/integrartion_tests" | ||
"${PROJECT_SOURCE_DIR}/test/tests" | ||
"${PROJECT_SOURCE_DIR}/thirdparty" | ||
"${CMAKE_BINARY_DIR}/_deps") | ||
endif() | ||
catch_discover_tests(ecs-benchmark-integration-tests) |
Oops, something went wrong.