ONNX will build googletest from a Git checkout. Patch CMake to use our googletest package and enable tests by default. diff --git a/CMakeLists.txt b/CMakeLists.txt index 0aa9fda2..a573170c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ option(BUILD_ONNX_PYTHON "Build Python binaries" OFF) option(ONNX_GEN_PB_TYPE_STUBS "Generate protobuf python type stubs" ON) option(ONNX_WERROR "Build with Werror" OFF) option(ONNX_COVERAGE "Build with coverage instrumentation" OFF) -option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" OFF) +option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" ON) option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF) option(ONNXIFI_ENABLE_EXT "Enable onnxifi extensions." OFF) if(NOT DEFINED ONNX_ML) @@ -82,8 +82,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX") endif() if(ONNX_BUILD_TESTS) - list(APPEND CMAKE_MODULE_PATH ${ONNX_ROOT}/cmake/external) - include(googletest) + find_package(GTest REQUIRED) + if(NOT GTest_FOUND) + message(FATAL_ERROR "cannot find googletest") + endif() endif() if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf)) diff --git a/cmake/unittest.cmake b/cmake/unittest.cmake index e29a93ff..ae146390 100644 --- a/cmake/unittest.cmake +++ b/cmake/unittest.cmake @@ -6,8 +6,8 @@ include(${ONNX_ROOT}/cmake/Utils.cmake) find_package(Threads) -set(${UT_NAME}_libs ${googletest_STATIC_LIBRARIES}) -set(${ONNXIFI_TEST_DRIVER}_libs ${googletest_STATIC_LIBRARIES}) +set(${UT_NAME}_libs ${GTEST_LIBRARIES}) +set(${ONNXIFI_TEST_DRIVER}_libs ${GTEST_LIBRARIES}) list(APPEND ${UT_NAME}_libs onnx) list(APPEND ${UT_NAME}_libs onnx_proto) @@ -31,10 +31,10 @@ function(AddTest) list(REMOVE_DUPLICATES _UT_SOURCES) add_executable(${_UT_TARGET} ${_UT_SOURCES}) - add_dependencies(${_UT_TARGET} onnx onnx_proto googletest) + add_dependencies(${_UT_TARGET} onnx onnx_proto) target_include_directories(${_UT_TARGET} - PUBLIC ${googletest_INCLUDE_DIRS} + PUBLIC ${GTEST_INCLUDE_DIRS} ${ONNX_INCLUDE_DIRS} ${PROTOBUF_INCLUDE_DIRS} ${ONNX_ROOT} 09929fa0860e17aa15de4'>pam.scm
AgeCommit message (Expand)Author
2023-08-15tests: pam-limits: Confirm actual ulimits are installed....This revised system test is superior to the one accepted when #61744 was closed because it confirms whether the configured limits are actually being enforced upon login. The previous test merely validated the serialization of one particular config in the config file. * gnu/tests/pam.scm (pam-limits-service): Revise test to confirm limits on login. (%test-pam-limits)[description]: Update. (%test-pam-limits-deprecated): Remove. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Felix Lechner
2023-05-06tests: Add missing module imports for marionette-evaluated code....This missing imports became apparent with commit a09c7da8f8d8e732f969cf0a09aaa78f87032ab1, which runs the marionette service in a fresh Guile process with fewer imports. * gnu/tests/databases.scm (run-postgresql-test, run-timescaledb-test) (run-mysql-test): Add missing module imports for code passed to 'marionette-eval'. * gnu/tests/docker.scm (run-docker-test, run-docker-system-test): Likewise. * gnu/tests/mail.scm (run-dovecot-test, run-getmail-test): Likewise. * gnu/tests/monitoring.scm (run-zabbix-server-test): Likewise. * gnu/tests/pam.scm (run-test-pam-limits): Likewise. * gnu/tests/reconfigure.scm (run-switch-to-system-test) (run-install-bootloader-test): Likewise. * gnu/tests/security-token.scm (run-pcscd-test): Likewise. * gnu/tests/install.scm (gui-test-program): Likewise. * gnu/tests/telephony.scm (run-jami-test): Add modules to the #:imported-modules argument of 'marionette-operating-system'. [test]: Remove them from 'with-imported-modules'; remove 'with-extensions'. Add "d-bus tooling loaded" test to set up %load-path and %load-compiled-path so the marionette process can find guile-ac-d-bus and guile-packrat. Ludovic Courtès
2023-03-30services: pam-limits-service-type: Deprecate file-like object support in favo......* doc/guix.texi (Base Services): Document it. * gnu/local.mk: Register test. * gnu/services/base.scm (pam-limits-service-type): Accept both lists and file-like objects. Deprecate file-like object support. * gnu/tests/pam.scm: New file. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Bruno Victal