|
From: | David Myers |
Subject: | Re: C++ Boost QA-tests linking issues |
Date: | Mon, 5 Apr 2021 14:23:50 -0400 |
Hello all,
Longtime GNU Radio user, new member to the list here.
I can’t get any C++ (Boost) QA tests to run in my OOTM. Specifically, I'm running into this linking error during the "make" step.
usr/bin/ld: CMakeFiles/time_triggers_qa_Related_Clocks.cc.dir/qa_Related_Clocks.cc.o: in function `test_add1::test_method()': qa_Related_Clocks.cc:(.text+0x4d): undefined reference to `gr::time_triggers::Related_Clocks::Related_Clocks()'
I'm running GNU Radio 3.8.1.0 as installed from Ubuntu 20.04 apt-get. The class being tested (Related_Clocks) has no issues compiling/linking/installing when used in blocks.
I’ve really been beating my head against this one, and any guidance would be greatly appreciated!
Thank you!From lib/CMakeLists.txt
--------------------------------------
########################################################################
# Setup library
########################################################################
include(GrPlatform) #define LIB_SUFFIX
list(APPEND time_triggers_sources
Related_Clocks.cc
multi_response_1_impl.cc
)[...............]
########################################################################
# Build and register unit test
########################################################################
include(GrTest)
list(APPEND test_time_triggers_sources
qa_Related_Clocks.cc
)
list(APPEND GR_TEST_TARGET_DEPS gnuradio-time_triggers)
foreach(qa_file ${test_time_triggers_sources})
GR_ADD_CPP_TEST("time_triggers_${qa_file}"
${CMAKE_CURRENT_SOURCE_DIR}/${qa_file}
)
endforeach(qa_file)From qa_Related_Clocks.cc:
-----------------------------------------
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <gnuradio/attributes.h>
#include <stdio.h>
#include <boost/test/unit_test.hpp>
#include "Related_Clocks.h"
BOOST_AUTO_TEST_CASE(test_add1)
{
gr::time_triggers::Related_Clocks clk;
clk.add_clock("clk1", (uint64_t)0);
clk.add_clock("clk2", (uint64_t)1);
clk.set_time("clk1", (uint64_t)10);
BOOST_REQUIRE_EQUAL(11, clk.get_time("clk2"));
}
[Prev in Thread] | Current Thread | [Next in Thread] |