diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ff92d6..273b1cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,30 +2,32 @@ on: [push] jobs: build_x86-64: - runs-on: ubuntu-18.04 - name: Build on ubuntu18.04 x86_64 + name: Build on ubuntu22.04 x86_64 + runs-on: ubuntu-22.04 + timeout-minutes: 720 steps: - - uses: actions/checkout@v2.1.0 + - uses: actions/checkout@v3.5.3 - run: | curl -sL https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 -o /tmp/bazel chmod 755 /tmp/bazel cd example - run: | - cd example && /tmp/bazel build "@pcl//..." --verbose_failures --show_progress_rate_limit=10 + cd example && /tmp/bazel test "@pcl//..." --verbose_failures --show_progress_rate_limit=10 build_aarch64: - runs-on: ubuntu-18.04 - name: Build on ubuntu18.04 aarch64 + name: Build on ubuntu22.04 aarch64 + runs-on: ubuntu-22.04 + timeout-minutes: 720 steps: - - uses: actions/checkout@v2.1.0 - - uses: uraimo/run-on-arch-action@v2.1.1 + - uses: actions/checkout@v3.5.3 + - uses: uraimo/run-on-arch-action@v2.5.0 name: Build and run tests on embedded platforms with: arch: aarch64 - distro: ubuntu18.04 + distro: ubuntu22.04 # Not required, but speeds up builds githubToken: ${{ github.token }} @@ -43,4 +45,6 @@ jobs: chmod 755 /usr/bin/bazel run: | - cd example && bazel build "@pcl//..." --verbose_failures --show_progress_rate_limit=10 + # Only run small tests because the enumlated environment is super slow, so large tests + # would timeout and fail. + cd example && bazel test "@pcl//..." --verbose_failures --show_progress_rate_limit=10 --test_size_filters="small" diff --git a/bzl/pcl.bzl b/bzl/pcl.bzl index 31a8b79..b345ef4 100644 --- a/bzl/pcl.bzl +++ b/bzl/pcl.bzl @@ -24,7 +24,7 @@ _PCL_DEFAULT_COMPILER_CONFIG = { def _compiler_config_value(value, kwargs): # NOTE: __pcl_linux-aarch64 is defined by the pcl_config macro. - default_architecture_value = select({ + default_architecture_value = select({ ":__pcl_linux-aarch64": _PCL_AARCH64_COMPILER_CONFIG[value], "//conditions:default": _PCL_DEFAULT_COMPILER_CONFIG[value], }) @@ -158,6 +158,7 @@ def pcl_library(name, **kwargs): native.cc_library( name = name, srcs = native.glob([ + "{}/src/**/*.c".format(name), "{}/src/**/*.cpp".format(name), "{}/include/**/*.hpp".format(name), ], exclude = exclude_srcs), diff --git a/bzl/repositories.bzl b/bzl/repositories.bzl index aec6b50..8eda325 100644 --- a/bzl/repositories.bzl +++ b/bzl/repositories.bzl @@ -2,26 +2,32 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def pcl_repositories(): + # Latest commit as of: Dec 23, 2023 + # NOTE: We cannot update beyond this commit without breaking aarch64 support due to lzma. + # See: https://github.com/nelhage/rules_boost/issues/374 maybe( http_archive, name = "com_github_nelhage_rules_boost", - strip_prefix = "rules_boost-96e9b631f104b43a53c21c87b01ac538ad6f3b48", - urls = ["https://github.com/nelhage/rules_boost/archive/96e9b631f104b43a53c21c87b01ac538ad6f3b48.tar.gz"], + sha256 = "490d11425393eed068966a4990ead1ff07c658f823fd982fddac67006ccc44ab", + strip_prefix = "rules_boost-57c99395e15720e287471d79178d36a85b64d6f6", + urls = ["https://github.com/nelhage/rules_boost/archive/57c99395e15720e287471d79178d36a85b64d6f6.tar.gz"], ) - + + maybe( + http_archive, + name = "com_google_googletest", + sha256 = "8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7", + strip_prefix = "googletest-1.14.0", + urls = ["https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz"], + ) + maybe( http_archive, name = "eigen", build_file = "@rules_pcl//third_party:eigen.BUILD", - sha256 = "a8d87c8df67b0404e97bcef37faf3b140ba467bc060e2b883192165b319cea8d", - strip_prefix = "eigen-git-mirror-3.3.7", - # NOTE: The official repo is hosted on gitlab, but gitlab appears to return a 406 error when - # trying to fetch archives. So we are using the deprecated github mirror instead until - # either bazel or gitlab fixes this issue. - # See: - # https://github.com/bazelbuild/bazel/issues/11187 - # https://stackoverflow.com/questions/60864626/cannot-fetch-eigen-with-bazel-406-not-acceptable - urls = ["https://github.com/eigenteam/eigen-git-mirror/archive/3.3.7.tar.gz"], + sha256 = "8586084f71f9bde545ee7fa6d00288b264a2b7ac3607b974e54d13e7162c1c72", + strip_prefix = "eigen-3.4.0", + urls = ["https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz"], ) # Latest commit as of April 6, 2019 @@ -38,9 +44,9 @@ def pcl_repositories(): http_archive, name = "lz4", build_file = "@rules_pcl//third_party:lz4.BUILD", - sha256 = "030644df4611007ff7dc962d981f390361e6c97a34e5cbc393ddfbe019ffe2c1", - strip_prefix = "lz4-1.9.3", - urls = ["https://github.com/lz4/lz4/archive/refs/tags/v1.9.3.tar.gz"], + sha256 = "0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b", + strip_prefix = "lz4-1.9.4", + urls = ["https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz"], ) maybe( @@ -70,10 +76,10 @@ def pcl_repositories(): maybe( http_archive, name = "pcl", - sha256 = "b52e1424686843c94c5771795a79d7a33296708ce23173a3f32769c30ee3a993", + sha256 = "8ab98a9db371d822de0859084a375a74bdc7f31c96d674147710cf4101b79621", build_file = "@rules_pcl//third_party:pcl.BUILD", - strip_prefix = "pcl-pcl-1.10.0", - urls = ["https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.10.0.zip"], + strip_prefix = "pcl-pcl-1.13.1", + urls = ["https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.13.1.tar.gz"], ) maybe( diff --git a/example/.bazelrc b/example/.bazelrc index 49d72a5..782fc6b 100644 --- a/example/.bazelrc +++ b/example/.bazelrc @@ -1 +1,29 @@ -build --cxxopt='-std=c++14' +# Helpful flags: https://blog.aspect.dev/bazelrc-flags + +# Build in release mode with debug symbols by default. +# These are disabled for quicker build-times in CI, but in your code you almost definitely want to +# set -c opt. +#build --compilation_mode opt +#build --copt -g + +build --keep_going +# Fix the wrong default to generate __init__.py to delimit a Python package. +build --incompatible_default_to_explicit_init_py +build --cxxopt='-std=c++17' +# Ensure that you don't accidentally make non-hermetic actions/tests +# which depend on remote services. Tag an individual target with +# tags=["requires-network"] to opt-out of the enforcement. +build --sandbox_default_allow_network=false +# Don't let environment variables like $PATH sneak into the build, +# which can cause massive cache misses when they change. +build --incompatible_strict_action_env +# Helps debugging when Bazel runs out of memory +build --heap_dump_on_oom +# Speed up all builds by not checking if output files have been modified. +build --noexperimental_check_output_files + +build --nolegacy_external_runfiles +run --nolegacy_external_runfiles +test --nolegacy_external_runfiles + +test --test_output=errors diff --git a/example/.bazelversion b/example/.bazelversion index ee74734..024b066 100644 --- a/example/.bazelversion +++ b/example/.bazelversion @@ -1 +1 @@ -4.1.0 +6.2.1 diff --git a/gen_test_targets.py b/gen_test_targets.py new file mode 100755 index 0000000..5b2bebf --- /dev/null +++ b/gen_test_targets.py @@ -0,0 +1,206 @@ +#!/usr/bin/env python3 +import argparse +import os + +EXCLUDE_TESTS = { + # This test loads a file in code using an env var rather than taking an argument. + "geometry": ["test_mesh_io"], + # This test has internal timeout testing that cannot be increased. It fails in CI on the aarch64 + # target because it's running in an enumlated environment (so everything runs 5x slower than + # normal). Just disable it to prevent it from causing non-deterministic timing failures. + "sample_consensus": ["test_sample_consensus"], +} + +MEDIUM_TESTS = { + "io": ["test_io"], +} +LARGE_TESTS = { + "common": ["test_eigen"], + # NOTE: The below tests only take a long time when running in CI's aarch64 emulated environment. + "filters": ["test_crop_hull"], + "octree": ["test_test_octree"], + "search": ["test_flann_search", "test_kdtree_search"], +} + +RENAME_DEPS = { + ":gtest": ":test", + "FLANN::FLANN": "@flann", +} + +EXTRA_SRCS = { + "geometry": { + "all": ["test/geometry/test_mesh_common_functions.h"], + }, + "search": { + "all": ["test/search/precise_distances.h"], + }, +} + +# These targets are missing required deps, which works with cmake but not bazel. +EXTRA_DEPS = { + "2d": { + "test_2d_keypoint_instantiation_with_precompile": [":2d"], + "test_2d_keypoint_instantiation_without_precompile": [":2d"], + }, + "io": { + "test_buffers": [":io"] + }, + "octree": { + "test_octree": [":octree"], + }, + "registration": { + "test_correspondence_estimation": [":io"], + }, +} + +PARSER_STATE_NONE = "NONE" +PARSER_STATE_TEST_NAME = "TEST_NAME" +PARSER_STATE_SRCS = "SRCS" +PARSER_STATE_DEPS = "DEPS" +PARSER_STATE_ARGS = "ARGS" + + +def parse_args() -> tuple[list[str], any]: + parser = argparse.ArgumentParser( + description="Generates bazel BUILD targets for test targets") + parser.add_argument("--pcl_path", help="Path to the local pcl source code") + parser.add_argument("--pcl_lib", + help="The pcl library to generate tests for") + parser.add_argument("--out", "-o", help="Path to the output BUILD file") + return parser.parse_args() + + +def main(): + args = parse_args() + test_lib_path = os.path.join(args.pcl_path, "test", args.pcl_lib) + cmakelists_path = os.path.join(test_lib_path, "CMakeLists.txt") + with open(cmakelists_path) as cmakelists_file: + with open(args.out, "w") as out_file: + parser_state = PARSER_STATE_NONE + test_name = None + srcs = [] + deps = [] + arguments = [] + target_complete = False + for line in cmakelists_file: + line = line.strip() + # Example line defining a test: + # PCL_ADD_TEST(common_test_wrappers test_wrappers FILES test_wrappers.cpp LINK_WITH pcl_gtest pcl_common) + words = line.split() + word_index = 0 + if parser_state == PARSER_STATE_NONE: + if not line.startswith("PCL_ADD_TEST"): + continue + # Handle spurious whitespace like "PCL_ADD_TEST (foo ...". + test_line_parts = line.split("(") + assert (len(test_line_parts) == 2) + words = test_line_parts[1].split() + test_name = words[1] + parser_state = PARSER_STATE_SRCS + print(test_name) + word_index = 2 + + while word_index < len(words): + word = words[word_index] + if word == "FILES": + parser_state = PARSER_STATE_SRCS + word_index += 1 + continue + if word == "LINK_WITH": + parser_state = PARSER_STATE_DEPS + word_index += 1 + continue + if word == "ARGUMENTS": + parser_state = PARSER_STATE_ARGS + word_index += 1 + continue + + if word.endswith(")"): + target_complete = True + word = word.rstrip(")").strip() + + if parser_state == PARSER_STATE_SRCS: + srcs.append(os.path.join("test", args.pcl_lib, word)) + elif parser_state == PARSER_STATE_DEPS: + dep = word.replace("pcl_", ":") + if dep in RENAME_DEPS: + dep = RENAME_DEPS[dep] + deps.append(dep) + elif parser_state == PARSER_STATE_ARGS: + arguments.append(word) + + if target_complete: + if args.pcl_lib in EXCLUDE_TESTS and test_name in EXCLUDE_TESTS[ + args.pcl_lib]: + print( + f"WARNING: Skipping excluded test {test_name}") + elif len(arguments) > 0: + # Some PCL tests require pass arguments. Maybe I'll figure out later how to landle + # this... + print( + f"WARNING: Skipping test {test_name} because it requires args" + ) + else: + if args.pcl_lib in EXTRA_SRCS: + if "all" in EXTRA_SRCS[args.pcl_lib]: + for extra_src in EXTRA_SRCS[ + args.pcl_lib]["all"]: + if extra_src not in srcs: + srcs.append(extra_src) + if test_name in EXTRA_SRCS[args.pcl_lib]: + srcs.extend( + EXTRA_SRCS[args.pcl_lib][test_name]) + if args.pcl_lib in EXTRA_DEPS and test_name in EXTRA_DEPS[ + args.pcl_lib]: + deps.extend( + EXTRA_DEPS[args.pcl_lib][test_name]) + srcs.sort() + deps.sort() + arguments.sort() + size = "small" + if args.pcl_lib in LARGE_TESTS and test_name in LARGE_TESTS[ + args.pcl_lib]: + size = "large" + elif args.pcl_lib in MEDIUM_TESTS and test_name in MEDIUM_TESTS[ + args.pcl_lib]: + size = "medium" + out_file.write("cc_test(\n") + out_file.write( + f" name = \"{args.pcl_lib}_{test_name}\",\n" + ) + out_file.write(f" size = \"{size}\",\n") + if len(srcs) == 1: + out_file.write( + f" srcs = [\"{srcs[0]}\"],\n") + else: + out_file.write(" srcs = [\n") + for src in srcs: + out_file.write(f" \"{src}\",\n") + out_file.write(" ],\n") + if len(deps) == 1: + out_file.write( + f" deps = [\"{deps[0]}\"],\n") + else: + out_file.write(" deps = [\n") + for dep in deps: + out_file.write(f" \"{dep}\",\n") + out_file.write(" ],\n") + out_file.write(")\n") + out_file.write("\n") + + # Reset state + parser_state = PARSER_STATE_NONE + test_name = None + srcs = [] + deps = [] + arguments = [] + target_complete = False + + # Ignore the rest of the line. + break + + word_index += 1 + + +if __name__ == "__main__": + main() diff --git a/third_party/eigen.BUILD b/third_party/eigen.BUILD index 11af1d2..42c47e1 100644 --- a/third_party/eigen.BUILD +++ b/third_party/eigen.BUILD @@ -1,17 +1,3 @@ -# Copyright 2018 The Cartographer Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - # Description: # Eigen is a C++ template library for linear algebra: vectors, # matrices, and related algorithms. @@ -27,39 +13,24 @@ exports_files(["COPYING.MPL2"]) EIGEN_FILES = [ "Eigen/**", - "unsupported/Eigen/CXX11/**", - "unsupported/Eigen/FFT", - "unsupported/Eigen/KroneckerProduct", - "unsupported/Eigen/src/FFT/**", - "unsupported/Eigen/src/KroneckerProduct/**", - "unsupported/Eigen/src/NonLinearOptimization/**", - "unsupported/Eigen/src/NumericalDiff/**", - "unsupported/Eigen/src/Polynomials/**", - "unsupported/Eigen/MatrixFunctions", - "unsupported/Eigen/NonLinearOptimization", - "unsupported/Eigen/NumericalDiff", - "unsupported/Eigen/Polynomials", - "unsupported/Eigen/SpecialFunctions", - "unsupported/Eigen/src/MatrixFunctions/**", - "unsupported/Eigen/src/SpecialFunctions/**", + "unsupported/Eigen/**", ] -# List of files picked up by glob but actually part of another target. -EIGEN_EXCLUDE_FILES = [ - "Eigen/src/Core/arch/AVX/PacketMathGoogleTest.cc", +# Non MPL2 files +EIGEN_RESTRICTED_FILES = [ + "unsupported/Eigen/src/IterativeSolvers/IterationController.h", + "unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h", ] EIGEN_MPL2_HEADER_FILES = glob( EIGEN_FILES, - exclude = EIGEN_EXCLUDE_FILES, + exclude = EIGEN_RESTRICTED_FILES, ) cc_library( name = "eigen", hdrs = EIGEN_MPL2_HEADER_FILES, - includes = [ - ".", - "eigen3", - ], + defines = ["EIGEN_MPL2_ONLY"], + includes = ["."], visibility = ["//visibility:public"], ) diff --git a/third_party/lz4.BUILD b/third_party/lz4.BUILD index 22cdc7d..bdac182 100644 --- a/third_party/lz4.BUILD +++ b/third_party/lz4.BUILD @@ -15,9 +15,7 @@ cc_library( "lib/lz4hc.h", "lib/xxhash.h", ], - include_prefix = "lz4", includes = ["lib"], - strip_include_prefix = "lib", # This c file is included by lib/lz4hc.c textual_hdrs = ["lib/lz4.c"], visibility = ["//visibility:public"], diff --git a/third_party/pcl.BUILD b/third_party/pcl.BUILD index cb4a336..e247453 100644 --- a/third_party/pcl.BUILD +++ b/third_party/pcl.BUILD @@ -1,10 +1,10 @@ # Description: # Point Cloud Library (PCL) pointclouds.org -licenses(["notice"]) # BSD 3-Clause - load("@rules_pcl//bzl:pcl.bzl", "pcl_library") +licenses(["notice"]) # BSD 3-Clause + exports_files(["pcl_config.h.in"]) pcl_library( @@ -13,7 +13,6 @@ pcl_library( deps = [ ":common", ":filters", - "@boost//:smart_ptr", ], ) @@ -22,17 +21,13 @@ pcl_library( deps = [ "@//:pcl_config", "@boost//:algorithm", - "@boost//:cstdint", "@boost//:current_function", - "@boost//:date_time", - "@boost//:foreach", + "@boost//:filesystem", "@boost//:fusion", "@boost//:mpl", - "@boost//:optional", "@boost//:predef", "@boost//:preprocessor", "@boost//:signals2", - "@boost//:smart_ptr", "@eigen", ], ) @@ -48,7 +43,6 @@ pcl_library( ":search", "@boost//:graph", "@boost//:property_map", - "@boost//:smart_ptr", "@eigen", ], ) @@ -67,7 +61,7 @@ pcl_library( "@boost//:mpl", "@boost//:optional", "@boost//:random", - "@boost//:smart_ptr", + "@boost//:sort", "@eigen", ], ) @@ -76,9 +70,7 @@ pcl_library( name = "geometry", deps = [ ":common", - "@boost//:concept_check", "@boost//:operators", - "@boost//:smart_ptr", "@boost//:version", "@eigen", ], @@ -86,12 +78,7 @@ pcl_library( pcl_library( name = "ml", - deps = [ - ":common", - "@boost//:intrusive", - "@boost//:smart_ptr", - "@eigen", - ], + deps = [":common"], ) # TODO(kgreenek): This one is going to be hard because it depends on a lot of the external @@ -203,8 +190,6 @@ pcl_library( "@boost//:asio", "@boost//:circular_buffer", "@boost//:core", - "@boost//:date_time", - "@boost//:exception", "@boost//:filesystem", "@boost//:foreach", "@boost//:format", @@ -215,11 +200,12 @@ pcl_library( "@boost//:mpl", "@boost//:multiprecision", # See: https://github.com/kgreenek/rules_pcl/issues/4 "@boost//:numeric_conversion", + "@boost//:predef", "@boost//:property_tree", "@boost//:signals2", "@boost//:smart_ptr", - "@boost//:system", "@boost//:tokenizer", + "@boost//:utility", "@boost//:version", "@org_libpng_libpng//:libpng", ], @@ -229,7 +215,6 @@ pcl_library( name = "kdtree", deps = [ ":common", - "@boost//:smart_ptr", "@flann", ], ) @@ -239,9 +224,10 @@ pcl_library( deps = [ ":common", ":features", + ":filters", ":octree", + ":search", "@//:pcl_config", - "@boost//:smart_ptr", "@eigen", ], ) @@ -251,9 +237,6 @@ pcl_library( deps = [ ":common", "@boost//:graph", - "@boost//:smart_ptr", - "@boost//:tuple", - "@eigen", ], ) @@ -264,16 +247,14 @@ pcl_library( # exclude_hdrs = ["outofcore/include/pcl/outofcore/visualization/**"], # deps = [ # ":common", -# ":io", # ":filters", +# ":io", # ":octree", -# "@boost//:core", +# ":visualization", # "@boost//:filesystem", # "@boost//:foreach", # "@boost//:random", -# "@boost//:smart_ptr", # "@boost//:uuid", -# "@eigen//:eigen", # ], #) # @@ -284,9 +265,7 @@ pcl_library( # ":outofcore", # "@boost//:accumulators", # "@boost//:algorithm", -# "@boost//:filesystem", # "@boost//:foreach", -# "@eigen//:eigen", # ], #) # @@ -294,10 +273,10 @@ pcl_library( # name = "outofcore_process", # srcs = ["outofcore/tools/outofcore_process.cpp"], # deps = [ +# ":common", +# ":io", # ":outofcore", -# "@boost//:filesystem", # "@boost//:foreach", -# "@eigen//:eigen", # ], #) # @@ -305,29 +284,25 @@ pcl_library( # name = "outofcore_viewer", # srcs = ["outofcore/tools/outofcore_viewer.cpp"], # deps = [ +# ":common", +# ":io", # ":outofcore", # ":visualization", -# "@boost//:date_time", # "@boost//:filesystem", -# "@eigen//:eigen", -# "vtk", # ], #) pcl_library( name = "people", + # This file depends on ":visualization". + exclude_hdrs = ["include/pcl/people/person_cluster.h"], deps = [ ":common", - ":features", ":filters", - ":geometry", - ":io", ":kdtree", - ":octree", ":sample_consensus", - ":search", ":segmentation", - "@eigen", + #":visualization", ], ) @@ -336,7 +311,9 @@ pcl_library( deps = [ ":common", ":features", + ":filters", ":io", + ":kdtree", ":ml", ":registration", ":search", @@ -344,25 +321,28 @@ pcl_library( "@boost//:filesystem", "@boost//:graph", "@boost//:random", - "@boost//:smart_ptr", - "@boost//:unordered", "@eigen", ], ) pcl_library( name = "registration", - exclude_srcs = ["registration/src/pairwise_graph_registration.cpp"], + exclude_hdrs = ["registration/include/pcl/registration/transformation_estimation_dq.h"], + exclude_srcs = [ + "registration/include/pcl/registration/impl/transformation_estimation_dq.hpp", + "registration/src/pairwise_graph_registration.cpp", + "registration/src/transformation_estimation_dq.cpp", + ], deps = [ ":common", ":features", ":filters", ":kdtree", - ":octree", ":sample_consensus", ":search", "@boost//:core", "@boost//:graph", + "@boost//:noncopyable", "@boost//:property_map", "@boost//:smart_ptr", "@eigen", @@ -378,7 +358,6 @@ pcl_library( "@boost//:math", "@boost//:multiprecision", # See: https://github.com/kgreenek/rules_pcl/issues/4 "@boost//:random", - "@boost//:smart_ptr", "@eigen", ], ) @@ -390,20 +369,15 @@ pcl_library( ":features", ":filters", ":geometry", - ":kdtree", ":ml", ":octree", ":sample_consensus", ":search", "@boost//:bimap", "@boost//:concept", - "@boost//:current_function", "@boost//:graph", "@boost//:multi_array", - "@boost//:property_map", "@boost//:ptr_container", - "@boost//:smart_ptr", - "@boost//:tuple", "@boost//:version", "@eigen", "@flann", @@ -415,8 +389,6 @@ pcl_library( deps = [ ":common", ":io", - "@boost//:signals2", - "@eigen", ], ) @@ -430,19 +402,6 @@ SURFACE_ON_NURBS_HDRS = [ "surface/include/pcl/surface/on_nurbs", ] -SURFACE_QHULL_SRCS = [ - "surface/include/pcl/surface/impl/concave_hull.hpp", - "surface/include/pcl/surface/impl/convex_hull.hpp", - "surface/src/concave_hull.cpp", - "surface/src/convex_hull.cpp", -] - -SURFACE_QHULL_HDRS = [ - "surface/include/pcl/surface/concave_hull.h", - "surface/include/pcl/surface/convex_hull.h", - "surface/include/pcl/surface/qhull.h", -] - SURFACE_VTK_SRCS = ["surface/src/vtk_smoothing/**"] SURFACE_VTK_HDRS = ["surface/include/pcl/surface/vtk_smoothing/**"] @@ -451,11 +410,9 @@ pcl_library( name = "surface", exclude_hdrs = SURFACE_ON_NURBS_HDRS + - #SURFACE_QHULL_HDRS + SURFACE_VTK_HDRS, exclude_srcs = SURFACE_ON_NURBS_SRCS + - #SURFACE_QHULL_SRCS + SURFACE_VTK_SRCS, deps = [ ":common", @@ -465,9 +422,9 @@ pcl_library( "@//:pcl_config", "@boost//:current_function", "@boost//:dynamic_bitset", - "@boost//:smart_ptr", "@eigen", "@qhull//:libqhull", + "@qhull//:libqhull_r", ], ) @@ -477,23 +434,26 @@ pcl_library( ":common", ":kdtree", ":octree", - "@boost//:smart_ptr", "@eigen", "@flann", ], ) +pcl_library( + name = "test", + deps = [ + ":common", + "@com_google_googletest//:gtest", + ], +) + pcl_library( name = "tracking", deps = [ ":common", ":filters", - ":kdtree", ":octree", ":search", - "@boost//:random", - "@boost//:smart_ptr", - "@eigen", ], ) @@ -503,26 +463,34 @@ pcl_library( # name = "visualization", # deps = [ # ":common", +# ":filters", +# ":features", # ":geometry", # ":io", # ":kdtree", -# ":octree", +# ":registration", # ":search", # "@//:pcl_config", # "@boost//:algorithm", -# "@boost//:date_time", -# "@boost//:filesystem", # "@boost//:foreach", +# "@boost//:filesystem", # "@boost//:signals2", # "@boost//:smart_ptr", +# "@boost//:version", # "@boost//:uuid", -# "@eigen//:eigen", +# "@eigen", # ], #) -# -------------------------------------------------------------------------------------------------- +#################################################################################################### # Examples -# -------------------------------------------------------------------------------------------------- +#################################################################################################### +cc_binary( + name = "common_example_check_if_point_is_valid", + srcs = ["examples/common/example_check_if_point_is_valid.cpp"], + deps = [":common"], +) + cc_binary( name = "common_example_copy_point_cloud", srcs = ["examples/common/example_copy_point_cloud.cpp"], @@ -530,9 +498,9 @@ cc_binary( ) cc_binary( - name = "common_example_scope_time", - srcs = ["examples/common/example_scope_time.cpp"], - deps = [":common"], + name = "common_example_get_max_min_coordinates", + srcs = ["examples/common/example_get_max_min_coordinates.cpp"], + deps = [":io"], ) cc_binary( @@ -542,15 +510,21 @@ cc_binary( ) cc_binary( - name = "common_example_check_if_point_is_valid", - srcs = ["examples/common/example_check_if_point_is_valid.cpp"], + name = "common_example_scope_time", + srcs = ["examples/common/example_scope_time.cpp"], deps = [":common"], ) cc_binary( - name = "common_example_get_max_min_coordinates", - srcs = ["examples/common/example_get_max_min_coordinates.cpp"], - deps = [":io"], + name = "features_example_difference_of_normals", + srcs = ["examples/features/example_difference_of_normals.cpp"], + deps = [ + ":common", + ":features", + ":filters", + ":io", + ":segmentation", + ], ) cc_binary( @@ -590,8 +564,8 @@ cc_binary( ) cc_binary( - name = "features_example_shape_contexts", - srcs = ["examples/features/example_shape_contexts.cpp"], + name = "features_example_principal_curvatures_estimation", + srcs = ["examples/features/example_principal_curvatures_estimation.cpp"], deps = [ ":common", ":features", @@ -602,8 +576,8 @@ cc_binary( ) cc_binary( - name = "features_example_spin_images", - srcs = ["examples/features/example_spin_images.cpp"], + name = "features_example_rift_estimation", + srcs = ["examples/features/example_rift_estimation.cpp"], deps = [ ":common", ":features", @@ -614,8 +588,8 @@ cc_binary( ) cc_binary( - name = "features_example_rift_estimation", - srcs = ["examples/features/example_rift_estimation.cpp"], + name = "features_example_shape_contexts", + srcs = ["examples/features/example_shape_contexts.cpp"], deps = [ ":common", ":features", @@ -626,22 +600,20 @@ cc_binary( ) cc_binary( - name = "features_example_difference_of_normals", - srcs = ["examples/features/example_difference_of_normals.cpp"], + name = "features_example_spin_images", + srcs = ["examples/features/example_spin_images.cpp"], deps = [ ":common", ":features", ":io", ":kdtree", - ":sample_consensus", ":search", - ":segmentation", ], ) cc_binary( - name = "filters_example_remove_nan_from_point_cloud", - srcs = ["examples/filters/example_remove_nan_from_point_cloud.cpp"], + name = "filters_example_extract_indices", + srcs = ["examples/filters/example_extract_indices.cpp"], deps = [ ":common", ":filters", @@ -649,8 +621,8 @@ cc_binary( ) cc_binary( - name = "filters_example_extract_indices", - srcs = ["examples/filters/example_extract_indices.cpp"], + name = "filters_example_remove_nan_from_point_cloud", + srcs = ["examples/filters/example_remove_nan_from_point_cloud.cpp"], deps = [ ":common", ":filters", @@ -666,45 +638,39 @@ cc_binary( ], ) -# TODO(kgreenek): Finish this once the visualization lib is done. -#cc_binary( -# name = "keypoints_example_sift_keypoint_estimation", -# srcs = ["examples/keypoints/example_sift_keypoint_estimation.cpp"], -# deps = [ -# ":common", -# ":io", -# ":keypoints", -# ":visualization", -# ], -#) +cc_binary( + name = "keypoints_example_get_keypoints_indices", + srcs = ["examples/keypoints/example_get_keypoints_indices.cpp"], + deps = [ + ":common", + ":io", + ":keypoints", + ], +) -# TODO(kgreenek): Finish this once the visualization lib is done. -#cc_binary( -# name = "keypoints_example_sift_normal_keypoint_estimation", -# srcs = ["examples/keypoints/example_sift_normal_keypoint_estimation.cpp"], -# deps = [ -# ":common", -# ":io", -# ":keypoints", -# ":visualization", -# ], -#) +cc_binary( + name = "keypoints_example_sift_keypoint_estimation", + srcs = ["examples/keypoints/example_sift_keypoint_estimation.cpp"], + deps = [ + ":common", + ":io", + ":keypoints", + ], +) -# TODO(kgreenek): Finish this once the visualization lib is done. -#cc_binary( -# name = "keypoints_example_sift_z_keypoint_estimation", -# srcs = ["examples/keypoints/example_sift_z_keypoint_estimation.cpp"], -# deps = [ -# ":common", -# ":io", -# ":keypoints", -# ":visualization", -# ], -#) +cc_binary( + name = "keypoints_example_sift_normal_keypoint_estimation", + srcs = ["examples/keypoints/example_sift_normal_keypoint_estimation.cpp"], + deps = [ + ":common", + ":io", + ":keypoints", + ], +) cc_binary( - name = "keypoints_example_get_keypoints_indices", - srcs = ["examples/keypoints/example_get_keypoints_indices.cpp"], + name = "keypoints_example_sift_z_keypoint_estimation", + srcs = ["examples/keypoints/example_sift_z_keypoint_estimation.cpp"], deps = [ ":common", ":io", @@ -712,29 +678,38 @@ cc_binary( ], ) +# TODO(kgreenek): Finish this once the visualization lib is done. +#cc_binary( +# name = "outofcore_example_outofcore", +# srcs = ["examples/outofcore/example_outofcore.cpp"], +# deps = [ +# ":common", +# ":io", +# ":outofcore", +# ], +#) + # TODO(kgreenek): Finish this once the visualization lib is done. #cc_binary( # name = "outofcore_example_outofcore_with_lod", # srcs = ["examples/outofcore/example_outofcore_with_lod.cpp"], # deps = [ # ":common", -# ":filters", # ":io", -# ":octree", # ":outofcore", # ], #) # TODO(kgreenek): Finish this once the visualization lib is done. #cc_binary( -# name = "outofcore_example_outofcore", -# srcs = ["examples/outofcore/example_outofcore.cpp"], +# name = "segmentation_example_cpc_segmentation", +# srcs = ["examples/segmentation/example_cpc_segmentation.cpp"], # deps = [ # ":common", -# ":filters", # ":io", -# ":octree", -# ":outofcore", +# ":segmentation", +# ":visualization", +# "@boost//:format", # ], #) @@ -743,19 +718,33 @@ cc_binary( srcs = ["examples/segmentation/example_extract_clusters_normals.cpp"], deps = [ ":common", + ":features", ":io", - ":keypoints", ":segmentation", ], ) +# TODO(kgreenek): Finish this once the visualization lib is done. +#cc_binary( +# name = "segmentation_example_lccp_segmentation", +# srcs = ["examples/segmentation/example_lccp_segmentation.cpp"], +# deps = [ +# ":common", +# ":io", +# ":segmentation", +# ":visualization", +# "@boost//:format", +# ], +#) + cc_binary( name = "segmentation_example_region_growing", srcs = ["examples/segmentation/example_region_growing.cpp"], deps = [ ":common", + ":features", + ":filters", ":io", - ":keypoints", ":segmentation", ], ) @@ -766,9 +755,7 @@ cc_binary( # srcs = ["examples/segmentation/example_supervoxels.cpp"], # deps = [ # ":common", -# ":features", -# ":kdtree", -# ":octree", +# ":io", # ":segmentation", # ":visualization", # ], @@ -776,45 +763,44 @@ cc_binary( # TODO(kgreenek): Finish this once the visualization lib is done. #cc_binary( -# name = "segmentation_example_lccp_segmentation", -# srcs = ["examples/segmentation/example_lccp_segmentation.cpp"], +# name = "stereo_example_stereo_baseline", +# srcs = ["examples/stereo/example_stereo_baseline.cpp"], # deps = [ # ":common", # ":io", -# ":segmentation", +# ":stereo", # ":visualization", # ], #) # TODO(kgreenek): Finish this once the visualization lib is done. #cc_binary( -# name = "segmentation_example_cpc_segmentation", -# srcs = ["examples/segmentation/example_cpc_segmentation.cpp"], +# name = "surface_example_nurbs_fitting_closed_curve", +# srcs = ["examples/surface/example_nurbs_fitting_closed_curve.cpp"], # deps = [ # ":common", # ":io", -# ":sample_consensur", -# ":segmentation", +# ":surface", # ":visualization", # ], #) # TODO(kgreenek): Finish this once the visualization lib is done. #cc_binary( -# name = "stereo_example_stereo_baseline", -# srcs = ["examples/stereo/example_stereo_baseline.cpp"], +# name = "surface_example_nurbs_fitting_closed_curve3d", +# srcs = ["examples/surface/example_nurbs_fitting_closed_curve3d.cpp"], # deps = [ # ":common", # ":io", -# ":stereo", +# ":surface", # ":visualization", # ], #) # TODO(kgreenek): Finish this once the visualization lib is done. #cc_binary( -# name = "surface_test_nurbs_fitting_surface", -# srcs = ["examples/surface/test_nurbs_fitting_surface.cpp"], +# name = "surface_example_nurbs_fitting_curve2d", +# srcs = ["examples/surface/example_nurbs_fitting_curve2d.cpp"], # deps = [ # ":common", # ":io", @@ -825,8 +811,8 @@ cc_binary( # TODO(kgreenek): Finish this once the visualization lib is done. #cc_binary( -# name = "surface_example_nurbs_fitting_surface", -# srcs = ["examples/surface/example_nurbs_fitting_surface.cpp"], +# name = "surface_test_nurbs_fitting_surface", +# srcs = ["examples/surface/test_nurbs_fitting_surface.cpp"], # deps = [ # ":common", # ":io", @@ -841,7 +827,6 @@ cc_binary( # srcs = ["examples/surface/example_nurbs_viewer_surface.cpp"], # deps = [ # ":common", -# ":io", # ":surface", # ":visualization", # ], @@ -849,36 +834,804 @@ cc_binary( # TODO(kgreenek): Finish this once the visualization lib is done. #cc_binary( -# name = "surface_example_nurbs_fitting_closed_curve", -# srcs = ["examples/surface/example_nurbs_fitting_closed_curve.cpp"], +# name = "surface_test_nurbs_fitting_surface", +# srcs = ["examples/surface/test_nurbs_fitting_surface.cpp"], # deps = [ # ":common", -# ":io", # ":surface", # ":visualization", # ], #) -# TODO(kgreenek): Finish this once the visualization lib is done. -#cc_binary( -# name = "surface_example_nurbs_fitting_curve2d", -# srcs = ["examples/surface/example_nurbs_fitting_curve2d.cpp"], -# deps = [ -# ":common", -# ":io", -# ":surface", -# ":visualization", -# ], -#) +#################################################################################################### +# TESTS - All the fules below are generated using the gen_test_targests.py script. +# NOTE: Any tests that require passing an argument to the command are excluded. So these shouldn't +# be considered thorough tests, only a sanity check. +#################################################################################################### + +#################################################################################################### +# 2d tests +#################################################################################################### +cc_test( + name = "2d_test_2d_keypoint_instantiation_with_precompile", + size = "small", + srcs = ["test/2d/keypoint_instantiation.cpp"], + deps = [ + ":2d", + ":common", + ":test", + ], +) -# TODO(kgreenek): Finish this once the visualization lib is done. -#cc_binary( -# name = "surface_example_nurbs_fitting_closed_curve3d", -# srcs = ["examples/surface/example_nurbs_fitting_closed_curve3d.cpp"], -# deps = [ -# ":common", -# ":io", -# ":surface", -# ":visualization", -# ], -#) +cc_test( + name = "2d_test_2d_keypoint_instantiation_without_precompile", + size = "small", + srcs = ["test/2d/keypoint_instantiation.cpp"], + deps = [ + ":2d", + ":common", + ":test", + ], +) + +#################################################################################################### +# common tests +#################################################################################################### +cc_test( + name = "common_test_wrappers", + size = "small", + srcs = ["test/common/test_wrappers.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_macros", + size = "small", + srcs = ["test/common/test_macros.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_vector_average", + size = "small", + srcs = ["test/common/test_vector_average.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_common", + size = "small", + srcs = ["test/common/test_common.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_pointcloud", + size = "small", + srcs = ["test/common/test_pointcloud.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_parse", + size = "small", + srcs = ["test/common/test_parse.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_geometry", + size = "small", + srcs = ["test/common/test_geometry.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_copy_point", + size = "small", + srcs = ["test/common/test_copy_point.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_transforms", + size = "small", + srcs = ["test/common/test_transforms.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_plane_intersection", + size = "small", + srcs = ["test/common/test_plane_intersection.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_pca", + size = "small", + srcs = ["test/common/test_pca.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_spring", + size = "small", + srcs = ["test/common/test_spring.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_gaussian", + size = "small", + srcs = ["test/common/test_gaussian.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_operators", + size = "small", + srcs = ["test/common/test_operators.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_eigen", + size = "large", + srcs = ["test/common/test_eigen.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_intensity", + size = "small", + srcs = ["test/common/test_intensity.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_generator", + size = "small", + srcs = ["test/common/test_generator.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_common_io", + size = "small", + srcs = ["test/common/test_io.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_copy_make_borders", + size = "small", + srcs = ["test/common/test_copy_make_borders.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_bearing_angle_image", + size = "small", + srcs = ["test/common/test_bearing_angle_image.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_polygon_mesh_concatenate", + size = "small", + srcs = ["test/common/test_polygon_mesh.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_common_point_type_conversion", + size = "small", + srcs = ["test/common/test_point_type_conversion.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_common_point_type_static_member_functions", + size = "small", + srcs = ["test/common/test_point_type_static_member_functions.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_colors", + size = "small", + srcs = ["test/common/test_colors.cpp"], + deps = [ + ":common", + ":test", + ], +) + +cc_test( + name = "common_test_type_traits", + size = "small", + srcs = ["test/common/test_type_traits.cpp"], + deps = [ + ":common", + ":test", + ], +) + +#################################################################################################### +# features tests +#################################################################################################### +cc_test( + name = "features_test_features_ptr", + size = "small", + srcs = ["test/features/test_ptr.cpp"], + deps = [ + ":features", + ":test", + ], +) + +cc_test( + name = "features_test_gradient_estimation", + size = "small", + srcs = ["test/features/test_gradient_estimation.cpp"], + deps = [ + ":features", + ":test", + ], +) + +cc_test( + name = "features_test_rift_estimation", + size = "small", + srcs = ["test/features/test_rift_estimation.cpp"], + deps = [ + ":features", + ":test", + ], +) + +cc_test( + name = "features_test_narf", + size = "small", + srcs = ["test/features/test_narf.cpp"], + deps = [ + ":features", + ":test", + "@flann", + ], +) + +cc_test( + name = "features_test_organized_edge_detection", + size = "small", + srcs = ["test/features/test_organized_edge_detection.cpp"], + deps = [ + ":features", + ":io", + ":test", + ], +) + +#################################################################################################### +# filters tests +#################################################################################################### +cc_test( + name = "filters_test_filters_grid_minimum", + size = "small", + srcs = ["test/filters/test_grid_minimum.cpp"], + deps = [ + ":common", + ":filters", + ":test", + ], +) + +cc_test( + name = "filters_test_morphological", + size = "small", + srcs = ["test/filters/test_morphological.cpp"], + deps = [ + ":common", + ":filters", + ":test", + ], +) + +cc_test( + name = "filters_test_filters_functor", + size = "small", + srcs = ["test/filters/test_functor_filter.cpp"], + deps = [ + ":common", + ":filters", + ":test", + ], +) + +cc_test( + name = "filters_test_filters_local_maximum", + size = "small", + srcs = ["test/filters/test_local_maximum.cpp"], + deps = [ + ":common", + ":filters", + ":octree", + ":search", + ":test", + ], +) + +cc_test( + name = "filters_test_uniform_sampling", + size = "small", + srcs = ["test/filters/test_uniform_sampling.cpp"], + deps = [ + ":common", + ":filters", + ":test", + ], +) + +cc_test( + name = "filters_test_convolution", + size = "small", + srcs = ["test/filters/test_convolution.cpp"], + deps = [ + ":filters", + ":test", + ], +) + +cc_test( + name = "filters_test_crop_hull", + size = "large", + srcs = ["test/filters/test_crop_hull.cpp"], + deps = [ + ":filters", + ":test", + ], +) + +cc_test( + name = "filters_test_clipper", + size = "small", + srcs = ["test/filters/test_clipper.cpp"], + deps = [ + ":filters", + ":test", + ], +) + +#################################################################################################### +# geometry tests +#################################################################################################### +cc_test( + name = "geometry_test_iterator", + size = "small", + srcs = [ + "test/geometry/test_iterator.cpp", + "test/geometry/test_mesh_common_functions.h", + ], + deps = [ + ":geometry", + ":test", + ], +) + +cc_test( + name = "geometry_test_mesh_circulators", + size = "small", + srcs = [ + "test/geometry/test_mesh_circulators.cpp", + "test/geometry/test_mesh_common_functions.h", + ], + deps = [ + ":geometry", + ":test", + ], +) + +cc_test( + name = "geometry_test_mesh_conversion", + size = "small", + srcs = [ + "test/geometry/test_mesh_common_functions.h", + "test/geometry/test_mesh_conversion.cpp", + ], + deps = [ + ":geometry", + ":test", + ], +) + +cc_test( + name = "geometry_test_mesh_data", + size = "small", + srcs = [ + "test/geometry/test_mesh_common_functions.h", + "test/geometry/test_mesh_data.cpp", + ], + deps = [ + ":geometry", + ":test", + ], +) + +cc_test( + name = "geometry_test_mesh_get_boundary", + size = "small", + srcs = [ + "test/geometry/test_mesh_common_functions.h", + "test/geometry/test_mesh_get_boundary.cpp", + ], + deps = [ + ":geometry", + ":test", + ], +) + +cc_test( + name = "geometry_test_mesh_indices", + size = "small", + srcs = [ + "test/geometry/test_mesh_common_functions.h", + "test/geometry/test_mesh_indices.cpp", + ], + deps = [ + ":geometry", + ":test", + ], +) + +cc_test( + name = "geometry_test_mesh", + size = "small", + srcs = [ + "test/geometry/test_mesh.cpp", + "test/geometry/test_mesh_common_functions.h", + ], + deps = [ + ":geometry", + ":test", + ], +) + +cc_test( + name = "geometry_test_polygon_mesh", + size = "small", + srcs = [ + "test/geometry/test_mesh_common_functions.h", + "test/geometry/test_polygon_mesh.cpp", + ], + deps = [ + ":geometry", + ":test", + ], +) + +cc_test( + name = "geometry_test_quad_mesh", + size = "small", + srcs = [ + "test/geometry/test_mesh_common_functions.h", + "test/geometry/test_quad_mesh.cpp", + ], + deps = [ + ":geometry", + ":test", + ], +) + +cc_test( + name = "geometry_test_triangle_mesh", + size = "small", + srcs = [ + "test/geometry/test_mesh_common_functions.h", + "test/geometry/test_triangle_mesh.cpp", + ], + deps = [ + ":geometry", + ":test", + ], +) + +#################################################################################################### +# io tests +#################################################################################################### +cc_test( + name = "io_test_timestamp", + size = "small", + srcs = ["test/io/test_timestamp.cpp"], + deps = [ + ":io", + ":test", + ], +) + +cc_test( + name = "io_test_io", + size = "medium", + srcs = ["test/io/test_io.cpp"], + deps = [ + ":io", + ":test", + ], +) + +cc_test( + name = "io_test_split", + size = "small", + srcs = ["test/io/test_split.cpp"], + deps = [ + ":io", + ":test", + ], +) + +cc_test( + name = "io_test_iterators", + size = "small", + srcs = ["test/io/test_iterators.cpp"], + deps = [ + ":io", + ":test", + ], +) + +cc_test( + name = "io_test_range_coder", + size = "small", + srcs = ["test/io/test_range_coder.cpp"], + deps = [ + ":io", + ":test", + ], +) + +cc_test( + name = "io_test_ply_io", + size = "small", + srcs = ["test/io/test_ply_io.cpp"], + deps = [ + ":io", + ":test", + ], +) + +cc_test( + name = "io_test_point_cloud_image_extractors", + size = "small", + srcs = ["test/io/test_point_cloud_image_extractors.cpp"], + deps = [ + ":io", + ":test", + ], +) + +cc_test( + name = "io_test_buffers", + size = "small", + srcs = ["test/io/test_buffers.cpp"], + deps = [ + ":common", + ":io", + ":test", + ], +) + +#################################################################################################### +# ml tests +#################################################################################################### +cc_test( + name = "ml_test_ml_kmeans", + size = "small", + srcs = ["test/ml/test_kmeans.cpp"], + deps = [ + ":common", + ":ml", + ":test", + ], +) + +#################################################################################################### +# octree tests +#################################################################################################### +cc_test( + name = "octree_test_octree", + size = "large", + srcs = ["test/octree/test_octree.cpp"], + deps = [ + ":common", + ":octree", + ":test", + ], +) + +cc_test( + name = "octree_test_octree_iterator", + size = "small", + srcs = ["test/octree/test_octree_iterator.cpp"], + deps = [ + ":common", + ":octree", + ":test", + ], +) + +#################################################################################################### +# registration tests +#################################################################################################### +cc_test( + name = "registration_test_warps", + size = "small", + srcs = ["test/registration/test_warps.cpp"], + deps = [ + ":registration", + ":test", + ], +) + +cc_test( + name = "registration_test_correspondence_estimation", + size = "small", + srcs = ["test/registration/test_correspondence_estimation.cpp"], + deps = [ + ":features", + ":io", + ":registration", + ":test", + ], +) + +#################################################################################################### +# sample_consensus tests +#################################################################################################### +cc_test( + name = "sample_consensus_test_sample_consensus_quadric_models", + size = "small", + srcs = ["test/sample_consensus/test_sample_consensus_quadric_models.cpp"], + deps = [ + ":sample_consensus", + ":test", + ], +) + +cc_test( + name = "sample_consensus_test_sample_consensus_line_models", + size = "small", + srcs = ["test/sample_consensus/test_sample_consensus_line_models.cpp"], + deps = [ + ":sample_consensus", + ":test", + ], +) + +#################################################################################################### +# search tests +#################################################################################################### +cc_test( + name = "search_test_kdtree_search", + size = "large", + srcs = [ + "test/search/precise_distances.h", + "test/search/test_kdtree.cpp", + ], + deps = [ + ":kdtree", + ":search", + ":test", + ], +) + +cc_test( + name = "search_test_flann_search", + size = "large", + srcs = [ + "test/search/precise_distances.h", + "test/search/test_flann_search.cpp", + ], + deps = [ + ":kdtree", + ":search", + ":test", + ], +) + +cc_test( + name = "search_test_organized_search", + size = "small", + srcs = [ + "test/search/precise_distances.h", + "test/search/test_organized.cpp", + ], + deps = [ + ":kdtree", + ":search", + ":test", + ], +) + +cc_test( + name = "search_test_octree_search", + size = "small", + srcs = [ + "test/search/precise_distances.h", + "test/search/test_octree.cpp", + ], + deps = [ + ":common", + ":octree", + ":search", + ":test", + ], +)