update CppUnitLite to not rely on boost
parent
798e4c79c4
commit
775d2e877e
|
@ -15,8 +15,6 @@
|
||||||
#include "TestResult.h"
|
#include "TestResult.h"
|
||||||
#include "Failure.h"
|
#include "Failure.h"
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
Test::Test (const std::string& testName)
|
Test::Test (const std::string& testName)
|
||||||
: name_ (testName), next_(0), lineNumber_(-1), safeCheck_(true)
|
: name_ (testName), next_(0), lineNumber_(-1), safeCheck_(true)
|
||||||
{
|
{
|
||||||
|
|
|
@ -144,7 +144,7 @@ std::to_string(actualTemp))); return; } }
|
||||||
double expectedTemp = expected; \
|
double expectedTemp = expected; \
|
||||||
if (!std::isfinite(actualTemp) || !std::isfinite(expectedTemp) || fabs ((expectedTemp)-(actualTemp)) > threshold) \
|
if (!std::isfinite(actualTemp) || !std::isfinite(expectedTemp) || fabs ((expectedTemp)-(actualTemp)) > threshold) \
|
||||||
{ result_.addFailure (Failure (name_, __FILE__, __LINE__, \
|
{ result_.addFailure (Failure (name_, __FILE__, __LINE__, \
|
||||||
std::to_string(expectedTemp), std::to_string(actualTemp))); return; } }
|
std::to_string((double)expectedTemp), std::to_string((double)actualTemp))); return; } }
|
||||||
|
|
||||||
|
|
||||||
/* EXPECTs: tests will continue running after a failure */
|
/* EXPECTs: tests will continue running after a failure */
|
||||||
|
@ -164,7 +164,7 @@ std::to_string(actualTemp))); } }
|
||||||
double expectedTemp = expected; \
|
double expectedTemp = expected; \
|
||||||
if (!std::isfinite(actualTemp) || !std::isfinite(expectedTemp) || fabs ((expectedTemp)-(actualTemp)) > threshold) \
|
if (!std::isfinite(actualTemp) || !std::isfinite(expectedTemp) || fabs ((expectedTemp)-(actualTemp)) > threshold) \
|
||||||
{ result_.addFailure (Failure (name_, __FILE__, __LINE__, \
|
{ result_.addFailure (Failure (name_, __FILE__, __LINE__, \
|
||||||
std::to_string(expectedTemp), std::to_string(actualTemp))); } }
|
std::to_string((double)expectedTemp), std::to_string((double)actualTemp))); } }
|
||||||
|
|
||||||
|
|
||||||
#define FAIL(text) \
|
#define FAIL(text) \
|
||||||
|
|
|
@ -12,6 +12,6 @@ add_executable(example
|
||||||
)
|
)
|
||||||
|
|
||||||
# By using CMake exported targets, a simple "link" dependency introduces the
|
# By using CMake exported targets, a simple "link" dependency introduces the
|
||||||
# include directories (-I) flags, links against Boost, and add any other
|
# include directories (-I) flags, and add any other
|
||||||
# required build flags (e.g. C++11, etc.)
|
# required build flags (e.g. C++11, etc.)
|
||||||
target_link_libraries(example PRIVATE gtsam)
|
target_link_libraries(example PRIVATE gtsam)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Macro for adding categorized tests in a "tests" folder, with
|
# Macro for adding categorized tests in a "tests" folder, with
|
||||||
# optional exclusion of tests and convenience library linking options
|
# optional exclusion of tests and convenience library linking options
|
||||||
#
|
#
|
||||||
# By default, all tests are linked with CppUnitLite and boost
|
# By default, all tests are linked with CppUnitLite
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# - subdir The name of the category for this test
|
# - subdir The name of the category for this test
|
||||||
# - local_libs A list of convenience libraries to use (if GTSAM_BUILD_CONVENIENCE_LIBRARIES is true)
|
# - local_libs A list of convenience libraries to use (if GTSAM_BUILD_CONVENIENCE_LIBRARIES is true)
|
||||||
|
@ -32,7 +32,6 @@ endfunction()
|
||||||
# Macro for adding categorized timing scripts in a "tests" folder, with
|
# Macro for adding categorized timing scripts in a "tests" folder, with
|
||||||
# optional exclusion of tests and convenience library linking options
|
# optional exclusion of tests and convenience library linking options
|
||||||
#
|
#
|
||||||
# By default, all tests are linked with boost
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# - subdir The name of the category for this timing script
|
# - subdir The name of the category for this timing script
|
||||||
# - local_libs A list of convenience libraries to use (if GTSAM_BUILD_CONVENIENCE_LIBRARIES is true)
|
# - local_libs A list of convenience libraries to use (if GTSAM_BUILD_CONVENIENCE_LIBRARIES is true)
|
||||||
|
@ -51,8 +50,7 @@ macro(gtsam_add_subdir_timing subdir local_libs full_libs excluded_srcs)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# Macro for adding executables matching a pattern - builds one executable for
|
# Macro for adding executables matching a pattern - builds one executable for
|
||||||
# each file matching the pattern. These exectuables are automatically linked
|
# each file matching the pattern.
|
||||||
# with boost.
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# - pattern The glob pattern to match source files
|
# - pattern The glob pattern to match source files
|
||||||
# - local_libs A list of convenience libraries to use (if GTSAM_BUILD_CONVENIENCE_LIBRARIES is true)
|
# - local_libs A list of convenience libraries to use (if GTSAM_BUILD_CONVENIENCE_LIBRARIES is true)
|
||||||
|
@ -138,9 +136,9 @@ macro(gtsam_add_grouped_scripts group pattern target_prefix pretty_prefix_name l
|
||||||
|
|
||||||
# Linking and dependendencies
|
# Linking and dependendencies
|
||||||
if (GTSAM_BUILD_CONVENIENCE_LIBRARIES)
|
if (GTSAM_BUILD_CONVENIENCE_LIBRARIES)
|
||||||
target_link_libraries(${script_bin} ${local_libs} ${GTSAM_BOOST_LIBRARIES})
|
target_link_libraries(${script_bin} ${local_libs})
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${script_bin} ${full_libs} ${GTSAM_BOOST_LIBRARIES})
|
target_link_libraries(${script_bin} ${full_libs})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add .run target
|
# Add .run target
|
||||||
|
|
|
@ -71,17 +71,17 @@ TEST(Lago, findMinimumSpanningTree) {
|
||||||
auto gPlus = initialize::buildPoseGraph<Pose2>(g);
|
auto gPlus = initialize::buildPoseGraph<Pose2>(g);
|
||||||
lago::PredecessorMap tree = lago::findMinimumSpanningTree(gPlus);
|
lago::PredecessorMap tree = lago::findMinimumSpanningTree(gPlus);
|
||||||
|
|
||||||
// We should recover the following spanning tree:
|
/* We should recover the following spanning tree:
|
||||||
//
|
x2
|
||||||
// x2
|
/ \
|
||||||
// / \
|
/ \
|
||||||
// / \
|
x3 x1
|
||||||
// x3 x1
|
/
|
||||||
// /
|
/
|
||||||
// /
|
x0
|
||||||
// x0
|
|
|
||||||
// |
|
a
|
||||||
// a
|
*/
|
||||||
using initialize::kAnchorKey;
|
using initialize::kAnchorKey;
|
||||||
EXPECT_LONGS_EQUAL(kAnchorKey, tree[kAnchorKey]);
|
EXPECT_LONGS_EQUAL(kAnchorKey, tree[kAnchorKey]);
|
||||||
EXPECT_LONGS_EQUAL(kAnchorKey, tree[x0]);
|
EXPECT_LONGS_EQUAL(kAnchorKey, tree[x0]);
|
||||||
|
|
Loading…
Reference in New Issue