Skip to content
Draft
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 .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ jobs:
}

# CMake exits with non-0 status if there are any warnings during the build, so
cmake --build $env:BUILD_BUILDDIRECTORY -j --target tiledb_unit unit_vfs tiledb_regression all_link_complete --config $CMakeBuildType
cmake --build $env:BUILD_BUILDDIRECTORY -j --target tiledb_unit unit_vfs tiledb_regression --config $CMakeBuildType

if ($env:TILEDB_AZURE -eq "ON") {
if($env.TILEDB_USE_CUSTOM_NODE_JS) {
Expand Down
34 changes: 5 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ list(APPEND TILEDB_C_API_RELATIVE_HEADERS
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/object/object_api_external.h"
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/query/query_api_enum.h"
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/query/query_api_external.h"
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/query/query_api_external_experimental.h"
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/query_aggregate/query_aggregate_api_external_experimental.h"
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/query_condition/query_condition_api_external.h"
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/query_condition/query_condition_api_external_experimental.h"
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/query_field/query_field_api_external_experimental.h"
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/query_plan/query_plan_api_external_experimental.h"
"${CMAKE_SOURCE_DIR}/tiledb/api/c_api/string/string_api_external.h"
Expand Down Expand Up @@ -483,32 +486,13 @@ if(TILEDB_TESTS)
endif()

# -------------------------------------------------------
# Accumulators for object libraries and unit tests
# Accumulators for unit tests
# -------------------------------------------------------
#
# All link-completeness targets from object libraries are aggregated onto a
# single target.
#
# 1. Before any subdirectories are added:
# a) Declare a target for all link-completeness checks. It's a phantom target
# having only dependencies and with no build actions of its own.
# b) Declare an accumulator for link-completeness targets.
# 2. For each object library within the various subdirectories, add a
# link-completeness target, either
# a) manually, as an explicit dependency of the `all_link_complete` target.
# b) automatically, as an implicit part of an object library environment.
# The environment puts the link-completess target into the accumulator.
# 3. After all the subdirectories are added:
# a) The list of all targets from the accumulator is added as a dependency
# of `all_link_complete`.
#
# All unit tests are similarly aggregated onto the target `all_unit_tests`.
# All unit tests are aggregated onto the target `all_unit_tests`.
#
include(accumulator)

add_custom_target(all_link_complete)
define_accumulator(object_library_compile_targets)

define_accumulator(unit_test_targets)
#
# This is the legacy position of this target declaration; it should appear in
Expand Down Expand Up @@ -592,14 +576,6 @@ if (TILEDB_TESTS)
)
endif()

# -------------------------------------------------------
#
# All the compile-targets from object library definitions are dependencies of
# the `all_link_complete` phantom target.
#
retrieve_from(Compile_Targets ACCUMULATOR object_library_compile_targets)
add_dependencies(all_link_complete ${Compile_Targets})

###########################################################
# Uninstall
###########################################################
Expand Down
14 changes: 0 additions & 14 deletions cmake/object_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,6 @@ macro(TileDB_Environment_object_library_end)
#
#target_link_libraries(${TileDB_Environment_object_library_end_Library} PUBLIC configuration_definitions)

# Compile test
add_executable(${TileDB_Environment_object_library_end_Compile} EXCLUDE_FROM_ALL)
target_link_libraries(${TileDB_Environment_object_library_end_Compile} PRIVATE ${TileDB_Environment_object_library_end_Library})
# Link assert since it is used everywhere (good)
target_link_libraries(${TileDB_Environment_object_library_end_Compile} PRIVATE assert)
# There must be a file named `test/compile_<object_library>_main.cc` for each object library.
# TODO: Add explicit check for missing `..._main.cc` file.
target_sources(${TileDB_Environment_object_library_end_Compile} PRIVATE
test/${TileDB_Environment_object_library_end_Compile}_main.cc $<TARGET_OBJECTS:${TileDB_Environment_object_library_end_Library}>
)
# Append the current link-complete compile target to the complete list of them
put_into(ACCUMULATOR object_library_compile_targets LIST ${TileDB_Environment_object_library_end_Compile})
# ----------------------------------

message(${TileDB_Environment_object_library_end_Log_Level} "<<< object-library conclude end <<<")
endmacro()

Expand Down
2 changes: 1 addition & 1 deletion cmake/unit_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ macro(TileDB_Environment_unit_test_end)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

# Append the current link-complete compile target to the complete list of them
# Append the current unit test target to the complete list of them
put_into(ACCUMULATOR unit_test_targets LIST ${TileDB_Environment_unit_test_end_Unit_Test})
# ----------------------------------

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/build_libtiledb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ cmake --build . -j4 --target install

ls -la

cmake --build . -j4 --target tiledb_unit unit_vfs tiledb_regression all_link_complete
cmake --build . -j4 --target tiledb_unit unit_vfs tiledb_regression
1 change: 1 addition & 0 deletions test/src/test-capi-dimension-label.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "test/support/src/vfs_helpers.h"
#include "tiledb/api/c_api/array_schema/array_schema_api_internal.h"
#include "tiledb/api/c_api/context/context_api_internal.h"
#include "tiledb/sm/array_schema/dimension.h"
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/c_api/tiledb_experimental.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
Expand Down
6 changes: 3 additions & 3 deletions test/src/test-cppapi-aggregates.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

#include "test/support/src/helpers.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
#include "tiledb/api/c_api/query/query_api_internal.h"
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/cpp_api/tiledb_experimental"
#include "tiledb/sm/query/readers/aggregators/count_aggregator.h"
Expand Down Expand Up @@ -2188,7 +2188,7 @@ TEST_CASE_METHOD(
// first attribute get a var size overflow, which should not impact
// the results of the second attribute as we don't request data for
// the second attribute.
query.ptr()->query_->add_aggregator_to_default_channel(
query.ptr()->query()->add_aggregator_to_default_channel(
"NullCount2",
std::make_shared<
tiledb::sm::NullCountAggregator>(tiledb::sm::FieldInfo(
Expand Down Expand Up @@ -2331,7 +2331,7 @@ TEST_CASE_METHOD(
// Add another aggregator on the second attribute. We will make this
// attribute get a var size overflow, which should impact the result
// of the first one hence throw an exception.
query.ptr()->query_->add_aggregator_to_default_channel(
query.ptr()->query()->add_aggregator_to_default_channel(
"NullCount2",
std::make_shared<
tiledb::sm::NullCountAggregator>(tiledb::sm::FieldInfo(
Expand Down
8 changes: 4 additions & 4 deletions test/src/test-cppapi-dense-array-dimension-label.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "test/support/src/helpers.h"
#include "test/support/src/vfs_helpers.h"

#include "tiledb/sm/c_api/tiledb_struct_def.h"
#include "tiledb/api/c_api/query/query_api_internal.h"
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/cpp_api/tiledb_experimental"

Expand Down Expand Up @@ -587,10 +587,10 @@ TEST_CASE(
query.set_layout(TILEDB_ROW_MAJOR).set_subarray(subarray);

// Check the query subarray was updated with expected dimension ranges.
CHECK(query.ptr()->query_->subarray()->range_num() == 0);
CHECK(query.ptr()->query()->subarray()->range_num() == 0);
query.submit();
CHECK(query.ptr()->query_->subarray()->range_num() == 1);
CHECK(query.ptr()->query()->subarray()->range_num() == 1);
CHECK(
query.ptr()->query_->subarray()->ranges_for_dim(0) ==
query.ptr()->query()->subarray()->ranges_for_dim(0) ==
expected_subarray.ptr()->ranges_for_dim(0));
}
1 change: 1 addition & 0 deletions test/src/unit-Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "tiledb/sm/enums/encryption_type.h"
#include "tiledb/sm/misc/types.h"
#include "tiledb/sm/query/legacy/reader.h"
#include "tiledb/sm/query/query_state.h"
#include "tiledb/type/range/range.h"

#ifdef _WIN32
Expand Down
8 changes: 4 additions & 4 deletions test/src/unit-capi-serialized_queries.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
#include <test/support/tdb_catch.h>
#include "test/support/src/helpers.h"
#include "test/support/src/vfs_helpers.h"
#include "tiledb/api/c_api/query/query_api_internal.h"
#include "tiledb/common/common.h"
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/c_api/tiledb_serialization.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/query/legacy/reader.h"
#include "tiledb/sm/query/writers/writer_base.h"
Expand Down Expand Up @@ -97,7 +97,7 @@ struct SerializationFx {
}

static void check_read_stats(const Query& query) {
auto stats = ((sm::WriterBase*)query.ptr()->query_->strategy())->stats();
auto stats = ((sm::WriterBase*)query.ptr()->query()->strategy())->stats();
REQUIRE(stats != nullptr);
auto counters = stats->counters();
REQUIRE(counters != nullptr);
Expand All @@ -107,7 +107,7 @@ struct SerializationFx {
}

static void check_write_stats(const Query& query) {
auto stats = ((sm::Reader*)query.ptr()->query_->strategy())->stats();
auto stats = ((sm::Reader*)query.ptr()->query()->strategy())->stats();
REQUIRE(stats != nullptr);
auto counters = stats->counters();
REQUIRE(counters != nullptr);
Expand All @@ -130,7 +130,7 @@ struct SerializationFx {
}

static void check_delete_stats(const Query& query) {
auto stats = ((sm::Reader*)query.ptr()->query_->strategy())->stats();
auto stats = ((sm::Reader*)query.ptr()->query()->strategy())->stats();
REQUIRE(stats != nullptr);
auto counters = stats->counters();
REQUIRE(counters != nullptr);
Expand Down
4 changes: 2 additions & 2 deletions test/src/unit-capi-update-queries.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
#include "test/support/src/vfs_helpers.h"
#include "test/support/tdb_catch.h"
#include "tiledb/api/c_api/array/array_api_internal.h"
#include "tiledb/api/c_api/query/query_api_internal.h"
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/c_api/tiledb_experimental.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
#ifdef _WIN32
#include "tiledb/sm/filesystem/path_win.h"
#include "tiledb/sm/filesystem/win.h"
Expand Down Expand Up @@ -220,7 +220,7 @@ TEST_CASE_METHOD(

// Check the update value.
CHECK_THROWS(
query->query_->update_values()[0].check(array->array_schema_latest()));
query->query()->update_values()[0].check(array->array_schema_latest()));

// Clean up.
tiledb_query_free(&query);
Expand Down
4 changes: 2 additions & 2 deletions test/src/unit-cppapi-deletes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
#include "test/support/src/vfs_helpers.h"
#include "tiledb/api/c_api/array/array_api_internal.h"
#include "tiledb/api/c_api/context/context_api_internal.h"
#include "tiledb/api/c_api/query_condition/query_condition_api_internal.h"
#include "tiledb/common/stdx_string.h"
#include "tiledb/sm/array/array_directory.h"
#include "tiledb/sm/array/array_operations.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
#include "tiledb/sm/cpp_api/group.h"
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/enums/encryption_type.h"
Expand Down Expand Up @@ -396,7 +396,7 @@ void DeletesFx::check_delete_conditions(

for (uint64_t i = 0; i < qcs.size(); i++) {
// Compare to negated condition.
auto cmp = qcs[i].ptr()->query_condition_->negated_condition();
auto cmp = qcs[i].ptr()->query_condition()->negated_condition();
CHECK(tiledb::test::ast_equal(delete_conditions.at(i).ast(), cmp.ast()));
}

Expand Down
12 changes: 6 additions & 6 deletions test/src/unit-cppapi-max-fragment-size.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
#include "test/support/src/vfs_helpers.h"
#include "tiledb/api/c_api/array_schema/array_schema_api_internal.h"
#include "tiledb/api/c_api/fragment_info/fragment_info_api_internal.h"
#include "tiledb/api/c_api/query/query_api_internal.h"
#include "tiledb/api/c_api/subarray/subarray_api_internal.h"
#include "tiledb/common/arithmetic.h"
#include "tiledb/common/scoped_executor.h"
#include "tiledb/common/stdx_string.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/misc/constants.h"
#include "tiledb/sm/query/writers/global_order_writer.h"
Expand Down Expand Up @@ -96,7 +96,7 @@ struct CPPMaxFragmentSizeFx {
Query query(ctx_, array, TILEDB_WRITE);

// Set the maximum size for the fragments.
query.ptr().get()->query_->set_fragment_size(fragment_size);
query.ptr().get()->query()->set_fragment_size(fragment_size);
query.set_layout(TILEDB_GLOBAL_ORDER);

// Perform writes of the requested sizes.
Expand Down Expand Up @@ -173,7 +173,7 @@ struct CPPMaxFragmentSizeFx {
Query query(ctx_, array, TILEDB_WRITE);

// Set the maximum size for the fragments.
query.ptr().get()->query_->set_fragment_size(fragment_size);
query.ptr().get()->query()->set_fragment_size(fragment_size);
query.set_layout(TILEDB_GLOBAL_ORDER);

// Perform writes of the requested sizes.
Expand Down Expand Up @@ -504,7 +504,7 @@ TEST_CASE(
Query query(ctx, array);

// Set our max fragment size to force fragment writes
query.ptr()->query_->set_fragment_size(1080000);
query.ptr()->query()->set_fragment_size(1080000);

query.set_layout(TILEDB_GLOBAL_ORDER).set_data_buffer("dim", data);

Expand Down Expand Up @@ -618,7 +618,7 @@ instance_dense_global_order(
Query query(ctx, array, TILEDB_WRITE);
query.set_layout(TILEDB_GLOBAL_ORDER);
query.set_subarray(sub);
query.ptr().get()->query_->set_fragment_size(max_fragment_size);
query.ptr().get()->query()->set_fragment_size(max_fragment_size);

smsubarray = sub.ptr()->subarray()->ndrange(0);

Expand Down Expand Up @@ -666,7 +666,7 @@ instance_dense_global_order(
templates::query::num_cells<Asserter>(attributes, cursor));

const auto w = dynamic_cast<const sm::GlobalOrderWriter*>(
query.ptr()->query_->strategy());
query.ptr()->query()->strategy());
ASSERTER(w);
const auto g = w->get_global_state();
ASSERTER(g);
Expand Down
1 change: 1 addition & 0 deletions test/src/unit-cppapi-metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <test/support/tdb_catch.h>
#include <chrono>
#include <iostream>
#include <numeric>
#include <thread>

using namespace tiledb;
Expand Down
12 changes: 6 additions & 6 deletions test/src/unit-cppapi-query-condition-enumerations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "test/support/src/ast_helpers.h"
#include "test/support/tdb_catch.h"
#include "tiledb/api/c_api/array/array_api_internal.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
#include "tiledb/api/c_api/query_condition/query_condition_api_internal.h"
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/cpp_api/tiledb_experimental"
#include "tiledb/sm/serialization/query.h"
Expand Down Expand Up @@ -546,7 +546,7 @@ TEST_CASE_METHOD(

auto qc =
QueryCondition::create(ctx_, "cell_type", std::string("fish"), TILEDB_NE);
auto core_qc = qc.ptr().get()->query_condition_;
auto core_qc = qc.ptr().get()->query_condition();
core_qc->rewrite_for_schema(core_array->array_schema_latest());

auto matcher = Catch::Matchers::ContainsSubstring(
Expand All @@ -569,7 +569,7 @@ TEST_CASE_METHOD(

auto qc =
QueryCondition::create(ctx_, "cell_type", std::string("fish"), TILEDB_EQ);
auto core_qc = qc.ptr().get()->query_condition_;
auto core_qc = qc.ptr().get()->query_condition();
core_qc->rewrite_for_schema(core_array->array_schema_latest());

auto matcher = Catch::Matchers::ContainsSubstring(
Expand Down Expand Up @@ -1120,10 +1120,10 @@ QueryCondition CPPQueryConditionEnumerationFx::serialize_deserialize_qc(
using namespace tiledb::sm::serialization;
using Condition = tiledb::sm::serialization::capnp::Condition;

auto qc_ptr = qc.ptr().get()->query_condition_;
auto qc_ptr = qc.ptr().get()->query_condition();

QueryCondition ret(ctx_);
auto ret_ptr = ret.ptr().get()->query_condition_;
auto ret_ptr = ret.ptr().get()->query_condition();

// Serialize the query condition.
::capnp::MallocMessageBuilder message;
Expand Down Expand Up @@ -1163,7 +1163,7 @@ void CPPQueryConditionEnumerationFx::validate_query_condition(
core_array->load_all_enumerations();

auto qc = creator(ctx_);
auto core_qc = qc.ptr().get()->query_condition_;
auto core_qc = qc.ptr().get()->query_condition();
core_qc->rewrite_for_schema(core_array->array_schema_latest());

REQUIRE(core_qc->check(core_array->array_schema_latest()).ok());
Expand Down
8 changes: 4 additions & 4 deletions test/src/unit-cppapi-query-condition-sets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "test/support/src/vfs_helpers.h"
#include "test/support/tdb_catch.h"
#include "tiledb/api/c_api/array/array_api_internal.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
#include "tiledb/api/c_api/query_condition/query_condition_api_internal.h"
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/cpp_api/tiledb_experimental"
#include "tiledb/sm/serialization/query.h"
Expand Down Expand Up @@ -763,7 +763,7 @@ void CPPQueryConditionFx::check_read(
qc = serialize_deserialize_qc(qc);
}

auto core_qc = qc.ptr().get()->query_condition_;
auto core_qc = qc.ptr().get()->query_condition();
throw_if_not_ok(core_qc->check(array.ptr().get()->array_schema_latest()));

query.set_condition(qc)
Expand Down Expand Up @@ -947,10 +947,10 @@ QueryCondition CPPQueryConditionFx::serialize_deserialize_qc(
using namespace tiledb::sm::serialization;
using Condition = tiledb::sm::serialization::capnp::Condition;

auto qc_ptr = qc.ptr().get()->query_condition_;
auto qc_ptr = qc.ptr().get()->query_condition();

QueryCondition ret(ctx_);
auto ret_ptr = ret.ptr().get()->query_condition_;
auto ret_ptr = ret.ptr().get()->query_condition();

// Serialize the query condition.
::capnp::MallocMessageBuilder message;
Expand Down
Loading
Loading