diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2024-01-12 14:08:33 -0500 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2024-01-12 14:09:45 -0500 |
| commit | c4514c2e62a711189cf3c914297885d97fb51a09 (patch) | |
| tree | 9cea57c0ce23c6fdaf627495c7bd4f4f8dc9019d /tests/de_tier_tag.cpp | |
| parent | 3a89d7f6ea2679ff7b9bb1e3c37da9480be6c115 (diff) | |
| download | dynamic-extension-c4514c2e62a711189cf3c914297885d97fb51a09.tar.gz | |
Initial pass at unit test refactoring
Restructured unit tests to be a bit more modular. I have some further
plans to expand on this, particular for the query tests (including both
shard and framework level test functions that can be injected at will).
Diffstat (limited to 'tests/de_tier_tag.cpp')
| -rw-r--r-- | tests/de_tier_tag.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/tests/de_tier_tag.cpp b/tests/de_tier_tag.cpp index 46f2ee7..9d4fe7d 100644 --- a/tests/de_tier_tag.cpp +++ b/tests/de_tier_tag.cpp @@ -13,7 +13,7 @@ #include <random> #include <algorithm> -#include "testing.h" +#include "include/testing.h" #include "framework/DynamicExtension.h" #include "framework/scheduling/SerialScheduler.h" #include "shard/ISAMTree.h" @@ -24,4 +24,35 @@ using namespace de; typedef DynamicExtension<Rec, ISAMTree<Rec>, rq::Query<ISAMTree<Rec>, Rec>, LayoutPolicy::TEIRING, DeletePolicy::TAGGING, SerialScheduler> DE; -#include "dynamic_extension_tests.inc" +#include "include/dynamic_extension.h" + + +Suite *unit_testing() +{ + Suite *unit = suite_create("DynamicExtension: Tagged Tiering Testing"); + inject_dynamic_extension_tests(unit); + + return unit; +} + + +int shard_unit_tests() +{ + int failed = 0; + Suite *unit = unit_testing(); + SRunner *unit_shardner = srunner_create(unit); + + srunner_run_all(unit_shardner, CK_NORMAL); + failed = srunner_ntests_failed(unit_shardner); + srunner_free(unit_shardner); + + return failed; +} + + +int main() +{ + int unit_failed = shard_unit_tests(); + + return (unit_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} |