mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-21 06:27:01 +00:00
Enabling CTest
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@301 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
201b446c47
commit
a032dfaefd
@ -56,6 +56,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
|
||||
################################################################################
|
||||
# Googletest - http://code.google.com/p/googletest/
|
||||
################################################################################
|
||||
enable_testing()
|
||||
set(GTEST_DIR $ENV{GTEST_DIR})
|
||||
if(GTEST_DIR)
|
||||
message("GTEST root folder at ${GTEST_DIR}")
|
||||
@ -67,6 +68,7 @@ else()
|
||||
endif(GTEST_DIR)
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
# Boost - http://www.boost.org
|
||||
################################################################################
|
||||
|
@ -84,7 +84,34 @@ include_directories(
|
||||
add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc)
|
||||
target_link_libraries(run_tests ${Boost_LIBRARIES} glog gflags ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
install(TARGETS run_tests DESTINATION ${CMAKE_SOURCE_DIR}/install)
|
||||
|
||||
|
||||
#########################################################
|
||||
# Adding Tests to Ctest
|
||||
#########################################################
|
||||
|
||||
|
||||
set(CMAKE_CTEST_COMMAND ctest -V)
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
|
||||
|
||||
add_executable(control_thread_test EXCLUDE_FROM_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/control_thread/control_message_factory_test.cc
|
||||
)
|
||||
target_link_libraries(control_thread_test ${Boost_LIBRARIES} glog gflags ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
add_test(control_thread_test control_thread_test)
|
||||
|
||||
add_executable(gnss_block_test EXCLUDE_FROM_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/file_signal_source_test.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/fir_filter_test.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_acquisition_test.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/galileo_e1_pcps_ambiguous_acquisition_test.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc
|
||||
#${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/galileo_e1_dll_pll_veml_tracking_test.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/file_output_filter_test.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gnss_block_factory_test.cc
|
||||
)
|
||||
target_link_libraries(gnss_block_test ${Boost_LIBRARIES} gflags glog ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
add_test(gnss_block_test gnss_block_test)
|
||||
|
||||
|
||||
|
53
src/tests/single_test_main.cc
Normal file
53
src/tests/single_test_main.cc
Normal file
@ -0,0 +1,53 @@
|
||||
/*!
|
||||
* \file single_test_main.cc
|
||||
* \brief This file contains the main function for tests (used with CTest).
|
||||
* \author Carles Fernandez-Prades, 2012. cfernandez(at)cttc.es
|
||||
*
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2013 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
#include <gtest/gtest.h>
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
#include <gflags/gflags.h>
|
||||
#include <gnuradio/gr_msg_queue.h>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include "concurrent_queue.h"
|
||||
#include "gps_navigation_message.h"
|
||||
|
||||
concurrent_queue<Gps_Navigation_Message> global_gps_nav_msg_queue;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
google::InitGoogleLogging(argv[0]);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
Loading…
Reference in New Issue
Block a user