forked from facebookresearch/habitat-sim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revive the C++ tests, make them pass and enable them on the CI (faceb…
…ookresearch#160) * CMake: run tests using CTest. And disable tests for gflags -- we don't want these to run. * Use absolute paths to test files in the tests. * Execute CTest in build.sh, enable tests on the CI. * tests: don't use C designated initializers. GCC has issues with those: SimTest.cpp:26:41: sorry, unimplemented: non-trivial designated initializers not supported * tests: skip a test if (licensed) datasets are not found. We can't use them on the CI but we still want the tests to be run. * tests: reduce verbosity of some loud tests. * tests: srsly?
- Loading branch information
Showing
14 changed files
with
97 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule googletest
updated
214 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,43 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
macro(TEST TEST_NAME) | ||
add_executable(${TEST_NAME} "${TEST_NAME}.cpp") | ||
target_link_libraries(${TEST_NAME} core gtest_main) | ||
set(DEPENDENCIES "${ARGN}") | ||
foreach(DEPENDENCY IN LISTS DEPENDENCIES) | ||
target_link_libraries(${TEST_NAME} ${DEPENDENCY}) | ||
endforeach() | ||
# set_target_properties(${TEST_NAME} PROPERTIES FOLDER "tests" | ||
# RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests") | ||
add_test(${TEST_NAME} ${TEST_NAME}) | ||
endmacro(TEST) | ||
|
||
set(SCENE_DATASETS ${CMAKE_CURRENT_SOURCE_DIR}/../../data/scene_datasets) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake | ||
${CMAKE_CURRENT_BINARY_DIR}/configure.h) | ||
|
||
TEST(CoreTest io) | ||
|
||
TEST(NavTest nav assets) | ||
target_include_directories(NavTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
TEST(IOTest io) | ||
target_include_directories(IOTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
TEST(GeoTest geo) | ||
|
||
TEST(Mp3dTest scene) | ||
target_include_directories(Mp3dTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
TEST(SimTest sim) | ||
target_include_directories(SimTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
TEST(SuncgTest scene) | ||
TEST(main) | ||
|
||
# file(GLOB_RECURSE TEST_SRCS "*.cpp") | ||
# foreach(test_src ${TEST_SRCS}) | ||
# get_filename_component(test_name ${test_src} NAME_WE) | ||
# add_executable(${test_name} "${test_src}") | ||
# # target_link_libraries(${test_name} ${Caffe2_MAIN_LIBS} gtest_main) | ||
# target_link_libraries(${test_name} assets glog gtest_main) | ||
# add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>) | ||
# endforeach() | ||
target_include_directories(SuncgTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
# Some tests are LOUD, we don't want to include their full log (but OTOH we | ||
# want to have full log from others, so this is a compromise) | ||
set_tests_properties( | ||
NavTest | ||
Mp3dTest | ||
SuncgTest | ||
PROPERTIES ENVIRONMENT GLOG_minloglevel=1 | ||
) | ||
set_tests_properties(SimTest PROPERTIES | ||
ENVIRONMENT "GLOG_minloglevel=1;MAGNUM_LOG=QUIET") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright (c) Facebook, Inc. and its affiliates. | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
|
||
#define SCENE_DATASETS "${SCENE_DATASETS}" | ||
|
||
#define FILE_THAT_EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/IOTest.cpp" |
This file was deleted.
Oops, something went wrong.