Skip to content

Commit

Permalink
tests: extend find-omnetpp test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
riebl committed Jul 23, 2021
1 parent 4e24d5e commit ab76e33
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/TestSuiteHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ macro(expect_strequal expected actual)
message(FATAL_ERROR "Expected ${actual} to equal \"${expected}\", but it is \"${${actual}}\"")
endif()
endmacro()

macro(expect_target target)
if(NOT TARGET ${target})
message(FATAL_ERROR "expect_target: target ${target} does not exist")
endif()
endmacro()
20 changes: 20 additions & 0 deletions tests/find-omnetpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,23 @@ find_package(OmnetPP REQUIRED)
require_envvar(EXPECTED_OMNETPP_ROOT EXPECTED_OMNETPP_VERSION)
expect_strequal($ENV{EXPECTED_OMNETPP_ROOT} OMNETPP_ROOT)
expect_strequal($ENV{EXPECTED_OMNETPP_VERSION} OMNETPP_VERSION)

expect_target(OmnetPP::cmdenv)
expect_target(OmnetPP::common)
expect_target(OmnetPP::envir)
expect_target(OmnetPP::eventlog)
expect_target(OmnetPP::header)
expect_target(OmnetPP::layout)
expect_target(OmnetPP::main)
expect_target(OmnetPP::nedxml)
expect_target(OmnetPP::scave)
expect_target(OmnetPP::sim)
expect_target(OmnetPP::tkenv)

get_property(opp_include_dirs TARGET OmnetPP::header PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
set(opp_include_dirs_expected $ENV{EXPECTED_OMNETPP_ROOT}/include)
if(NOT opp_include_dirs STREQUAL opp_include_dirs_expected)
message(FATAL_ERROR "OMNeT++ include directory is incorrect:
expected: ${opp_include_dirs_expected}
actual: ${opp_include_dirs}")
endif()

0 comments on commit ab76e33

Please sign in to comment.