 
add_executable(TestAuxModem TestAuxModem.cc)
target_link_libraries(TestAuxModem falcon_meas)
add_test(TestAuxModem TestAuxModem)

add_executable(TestTrafficGenerator TestTrafficGenerator.cc)
target_link_libraries(TestTrafficGenerator falcon_meas)
add_test(TestTrafficGenerator TestTrafficGenerator)

add_executable(TestMibConsistency TestMibConsistency.cc)
target_compile_options(TestMibConsistency PRIVATE -std=c++11 -UNDEBUG)
add_test(TestMibConsistency TestMibConsistency)
set_tests_properties(TestMibConsistency PROPERTIES LABELS falcon-reliability)

add_executable(TestMibCellValid TestMibCellValid.cc)
target_compile_options(TestMibCellValid PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestMibCellValid falcon_rf ${SRSLTE_LIBRARIES} m)
add_test(TestMibCellValid TestMibCellValid)
set_tests_properties(TestMibCellValid PROPERTIES LABELS falcon-reliability)

add_executable(TestScanTypes TestScanTypes.cc)
target_compile_options(TestScanTypes PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanTypes falcon_phy)
add_test(TestScanTypes TestScanTypes)
set_tests_properties(TestScanTypes PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestBandTable TestBandTable.cc)
target_compile_options(TestBandTable PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestBandTable falcon_phy)
add_test(TestBandTable TestBandTable)
set_tests_properties(TestBandTable PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestScanPlanner TestScanPlanner.cc)
target_compile_options(TestScanPlanner PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanPlanner falcon_phy ${SRSLTE_LIBRARIES})
add_test(TestScanPlanner TestScanPlanner)
set_tests_properties(TestScanPlanner PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestScanBackend TestScanBackend.cc)
target_compile_options(TestScanBackend PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanBackend falcon_phy ${SRSLTE_LIBRARIES})
add_test(TestScanBackend TestScanBackend)
set_tests_properties(TestScanBackend PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestRetuneScanBackend TestRetuneScanBackend.cc)
target_compile_options(TestRetuneScanBackend PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestRetuneScanBackend falcon_phy ${SRSLTE_LIBRARIES})
add_test(TestRetuneScanBackend TestRetuneScanBackend)
set_tests_properties(TestRetuneScanBackend PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestScanConfirm TestScanConfirm.cc)
target_compile_options(TestScanConfirm PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanConfirm falcon_phy ${SRSLTE_LIBRARIES})
add_test(TestScanConfirm TestScanConfirm)
set_tests_properties(TestScanConfirm PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestScanDeduplication TestScanDeduplication.cc)
target_compile_options(TestScanDeduplication PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanDeduplication falcon_phy ${SRSLTE_LIBRARIES})
add_test(TestScanDeduplication TestScanDeduplication)
set_tests_properties(TestScanDeduplication PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestCellScanner TestCellScanner.cc)
target_compile_options(TestCellScanner PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestCellScanner falcon_phy ${SRSLTE_LIBRARIES})
add_test(TestCellScanner TestCellScanner)
set_tests_properties(TestCellScanner PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestScanJsonIO TestScanJsonIO.cc)
target_compile_options(TestScanJsonIO PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanJsonIO falcon_phy)
add_test(NAME TestScanJsonIO COMMAND $<TARGET_FILE:TestScanJsonIO>)
set_tests_properties(TestScanJsonIO PROPERTIES
  LABELS "falcon-reliability;falcon-scan"
  WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")

add_executable(TestScanCsvIO TestScanCsvIO.cc)
target_compile_options(TestScanCsvIO PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanCsvIO falcon_phy falcon_common)
add_test(NAME TestScanCsvIO COMMAND $<TARGET_FILE:TestScanCsvIO>)
set_tests_properties(TestScanCsvIO PROPERTIES
  LABELS "falcon-reliability;falcon-scan"
  WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")

add_executable(TestEarfcnHelpers TestEarfcnHelpers.cc)
target_compile_options(TestEarfcnHelpers PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestEarfcnHelpers falcon_phy ${SRSLTE_LIBRARIES})
add_test(TestEarfcnHelpers TestEarfcnHelpers)
set_tests_properties(TestEarfcnHelpers PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestReceiverRecovery TestReceiverRecovery.cc)
target_compile_options(TestReceiverRecovery PRIVATE -std=c++11 -UNDEBUG)
add_test(TestReceiverRecovery TestReceiverRecovery)
set_tests_properties(TestReceiverRecovery PROPERTIES LABELS falcon-reliability)

add_executable(TestSubframeWorkerGeneration TestSubframeWorkerGeneration.cc)
target_compile_options(TestSubframeWorkerGeneration PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestSubframeWorkerGeneration eye_phy falcon_phy falcon_util
  falcon_common falcon_prof ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestSubframeWorkerGeneration TestSubframeWorkerGeneration)
set_tests_properties(TestSubframeWorkerGeneration PROPERTIES LABELS falcon-reliability)

add_executable(TestPhyHealthMetrics TestPhyHealthMetrics.cc)
target_compile_options(TestPhyHealthMetrics PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestPhyHealthMetrics eye_phy falcon_phy falcon_common falcon_prof
  ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestPhyHealthMetrics TestPhyHealthMetrics)
set_tests_properties(TestPhyHealthMetrics PROPERTIES LABELS falcon-reliability)

add_executable(TestSfnContinuity TestSfnContinuity.cc)
target_compile_options(TestSfnContinuity PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestSfnContinuity eye_phy falcon_phy falcon_common falcon_prof
  ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestSfnContinuity TestSfnContinuity)
set_tests_properties(TestSfnContinuity PROPERTIES LABELS falcon-reliability)

add_executable(TestDCIPcapWriter TestDCIPcapWriter.cc)
target_compile_options(TestDCIPcapWriter PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestDCIPcapWriter eye_phy falcon_phy falcon_common falcon_prof
  ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestDCIPcapWriter TestDCIPcapWriter)
set_tests_properties(TestDCIPcapWriter PROPERTIES LABELS falcon-reliability)

add_executable(TestDeterministicPdcch TestDeterministicPdcch.cc synth_pdcch.cc)
target_compile_options(TestDeterministicPdcch PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestDeterministicPdcch eye_phy falcon_phy falcon_util
  falcon_common falcon_prof ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestDeterministicPdcch TestDeterministicPdcch)
set_tests_properties(TestDeterministicPdcch PROPERTIES LABELS falcon-reliability)

add_executable(TestBroadcastDecodeValidation TestBroadcastDecodeValidation.cc synth_pdcch.cc)
target_compile_options(TestBroadcastDecodeValidation PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestBroadcastDecodeValidation eye_phy falcon_phy falcon_util
  falcon_common falcon_prof ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestBroadcastDecodeValidation TestBroadcastDecodeValidation)
set_tests_properties(TestBroadcastDecodeValidation PROPERTIES LABELS falcon-reliability)

add_executable(TestMacPcapWriter TestMacPcapWriter.cc)
target_compile_options(TestMacPcapWriter PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestMacPcapWriter eye_phy falcon_phy falcon_common falcon_prof
  ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestMacPcapWriter TestMacPcapWriter)
set_tests_properties(TestMacPcapWriter PROPERTIES LABELS falcon-reliability)

add_executable(TestMacSduExtractor TestMacSduExtractor.cc)
target_compile_options(TestMacSduExtractor PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestMacSduExtractor eye_phy falcon_phy falcon_common falcon_prof
  ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestMacSduExtractor TestMacSduExtractor)
set_tests_properties(TestMacSduExtractor PROPERTIES LABELS falcon-reliability)

add_executable(TestRlcPcapWriter TestRlcPcapWriter.cc)
target_compile_options(TestRlcPcapWriter PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestRlcPcapWriter eye_phy falcon_phy falcon_common falcon_prof
  ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestRlcPcapWriter TestRlcPcapWriter)
set_tests_properties(TestRlcPcapWriter PROPERTIES LABELS falcon-reliability)

add_executable(TestPagingTmsiExtractor TestPagingTmsiExtractor.cc)
target_compile_options(TestPagingTmsiExtractor PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestPagingTmsiExtractor eye_phy falcon_phy falcon_common falcon_prof
  ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestPagingTmsiExtractor TestPagingTmsiExtractor)
set_tests_properties(TestPagingTmsiExtractor PROPERTIES LABELS falcon-reliability)

add_executable(TestPagingTmsiCsvWriter TestPagingTmsiCsvWriter.cc)
target_compile_options(TestPagingTmsiCsvWriter PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestPagingTmsiCsvWriter eye_phy falcon_phy falcon_common falcon_prof
  ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestPagingTmsiCsvWriter TestPagingTmsiCsvWriter)
set_tests_properties(TestPagingTmsiCsvWriter PROPERTIES LABELS falcon-reliability)

add_executable(TestUlGrantCsvWriter TestUlGrantCsvWriter.cc)
target_compile_options(TestUlGrantCsvWriter PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestUlGrantCsvWriter eye_phy falcon_phy falcon_common falcon_prof
  ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(TestUlGrantCsvWriter TestUlGrantCsvWriter)
set_tests_properties(TestUlGrantCsvWriter PROPERTIES LABELS falcon-reliability)

add_executable(TestArgManagerMacPcap TestArgManagerMacPcap.cc)
target_compile_options(TestArgManagerMacPcap PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestArgManagerMacPcap falcon_eye eye_phy falcon_phy
  falcon_common falcon_prof ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(NAME TestArgManagerMacPcap COMMAND TestArgManagerMacPcap)
set_tests_properties(TestArgManagerMacPcap PROPERTIES LABELS falcon-reliability)

add_executable(TestScanArgParsing TestScanArgParsing.cc)
target_compile_options(TestScanArgParsing PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanArgParsing falcon_eye eye_phy falcon_phy
  falcon_common falcon_prof ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(NAME TestScanArgParsing COMMAND TestScanArgParsing)
set_tests_properties(TestScanArgParsing PROPERTIES LABELS "falcon-reliability;falcon-scan")

add_executable(TestScanLiveFix TestScanLiveFix.cc)
target_compile_options(TestScanLiveFix PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanLiveFix falcon_eye eye_phy falcon_phy
  falcon_common falcon_prof ${SRSLTE_LIBRARIES} ${FFT_LIBRARIES})
add_test(NAME TestScanLiveFix COMMAND TestScanLiveFix)
set_tests_properties(TestScanLiveFix PROPERTIES LABELS "falcon-reliability;falcon-scan")

set(CMAKE_AUTOMOC ON)
add_executable(TestScanController TestScanController.cc)
target_compile_options(TestScanController PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanController falcon_scan_controller falcon_phy
  falcon_common Qt5::Core Qt5::Test ${SRSLTE_LIBRARIES})
add_test(NAME TestScanController COMMAND TestScanController)
set_tests_properties(TestScanController PROPERTIES LABELS "falcon-scan")

add_executable(TestScanTab TestScanTab.cc)
target_compile_options(TestScanTab PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestScanTab falcon_scan_widgets falcon_scan_controller
  falcon_phy falcon_common Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test
  ${SRSLTE_LIBRARIES})
add_test(NAME TestScanTab COMMAND TestScanTab)
set_tests_properties(TestScanTab PROPERTIES LABELS "falcon-scan")

add_executable(TestMainWindowScan TestMainWindowScan.cc)
target_compile_options(TestMainWindowScan PRIVATE -std=c++11 -UNDEBUG)
# mainwindow.h -> colorpicker.h includes ui_mainwindow.h, generated by AUTOUIC
# into falcon_gui_main's autogen include dir.
target_include_directories(TestMainWindowScan PRIVATE
  ${PROJECT_BINARY_DIR}/src/gui/falcon_gui_main_autogen/include)
target_link_libraries(TestMainWindowScan falcon_gui_main falcon_scan_widgets
  falcon_scan_controller Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test)
add_test(NAME TestMainWindowScan COMMAND TestMainWindowScan)
set_tests_properties(TestMainWindowScan PROPERTIES LABELS "falcon-scan")

add_executable(TestReceiverReset TestReceiverReset.cc)
target_compile_options(TestReceiverReset PRIVATE -std=c++11 -UNDEBUG)
target_link_libraries(TestReceiverReset falcon_util)
add_test(TestReceiverReset TestReceiverReset)
set_tests_properties(TestReceiverReset PROPERTIES LABELS falcon-reliability)

add_executable(TestAcquireMetadata TestAcquireMetadata.cc)
target_compile_options(TestAcquireMetadata PRIVATE -std=c++11 -UNDEBUG)
add_test(TestAcquireMetadata TestAcquireMetadata)
set_tests_properties(TestAcquireMetadata PROPERTIES LABELS falcon-reliability)

add_executable(TestDecimator TestDecimator.c)
target_compile_options(TestDecimator PRIVATE -UNDEBUG)
target_link_libraries(TestDecimator falcon_rf ${SRSLTE_LIBRARIES} m)
add_test(TestDecimator TestDecimator)
set_tests_properties(TestDecimator PROPERTIES LABELS falcon-reliability)

add_executable(TestDecimatorSubframeBoundary TestDecimatorSubframeBoundary.c)
target_compile_options(TestDecimatorSubframeBoundary PRIVATE -UNDEBUG)
# falcon_rf is an OBJECT library over every .c file in its directory (see
# CMakeLists.txt in lib/src/phy/falcon_rf), not just falcon_decim.c, so
# linking it pulls in rf_imp.c/rf_utils.c's srslte_rf_* references too --
# same as TestDecimator above, this needs SRSLTE_LIBRARIES to resolve them.
target_link_libraries(TestDecimatorSubframeBoundary falcon_rf ${SRSLTE_LIBRARIES} m)
add_test(TestDecimatorSubframeBoundary TestDecimatorSubframeBoundary)
set_tests_properties(TestDecimatorSubframeBoundary PROPERTIES LABELS falcon-reliability)

# These tests exercise patched dependency internals, including alignment reads.
if(TARGET srslte_phy AND EXISTS "${CMAKE_BINARY_DIR}/srsLTE-src/lib/src/phy/ue/ue_sync.c")
  add_executable(TestReceiverSync TestReceiverSync.c)
  target_compile_options(TestReceiverSync PRIVATE -UNDEBUG)
  target_compile_definitions(TestReceiverSync PRIVATE
    FALCON_UE_SYNC_SOURCE="${CMAKE_BINARY_DIR}/srsLTE-src/lib/src/phy/ue/ue_sync.c")
  target_link_libraries(TestReceiverSync srslte_phy)
  add_test(TestReceiverSync TestReceiverSync)

  add_executable(TestMibDeadline TestMibDeadline.c)
  target_compile_options(TestMibDeadline PRIVATE -UNDEBUG)
  target_compile_definitions(TestMibDeadline PRIVATE
    FALCON_UE_MIB_SOURCE="${CMAKE_BINARY_DIR}/srsLTE-src/lib/src/phy/ue/ue_mib.c")
  target_link_libraries(TestMibDeadline srslte_phy)
  add_test(TestMibDeadline TestMibDeadline)

  add_executable(TestPbchCombiningResetCallSite TestPbchCombiningResetCallSite.c)
  target_compile_options(TestPbchCombiningResetCallSite PRIVATE -UNDEBUG)
  target_compile_definitions(TestPbchCombiningResetCallSite PRIVATE
    FALCON_UE_MIB_SOURCE="${CMAKE_BINARY_DIR}/srsLTE-src/lib/src/phy/ue/ue_mib.c")
  target_link_libraries(TestPbchCombiningResetCallSite srslte_phy)
  add_test(TestPbchCombiningResetCallSite TestPbchCombiningResetCallSite)

  # TestAcquisitionDeadline.c #includes rf_utils.c textually (see above), and
  # rf_utils.c's decimating receive wrapper (Gate 3 Task 2) now calls into
  # falcon_decim_init()/_run()/_reset(). Those live in falcon_decim.c, which
  # is not itself #included, so it must be compiled in directly here rather
  # than linked via the falcon_rf OBJECT library, whose own compiled copy of
  # rf_utils.c would otherwise duplicate-define every symbol TestAcquisitionDeadline.c
  # already got from its textual #include.
  add_executable(TestAcquisitionDeadline TestAcquisitionDeadline.c
    ../src/phy/falcon_rf/falcon_decim.c)
  target_compile_options(TestAcquisitionDeadline PRIVATE -UNDEBUG)
  target_link_libraries(TestAcquisitionDeadline srslte_phy)
  add_test(TestAcquisitionDeadline TestAcquisitionDeadline)

  add_executable(TestAcquisitionRetry TestAcquisitionRetry.c
    ../src/phy/falcon_rf/falcon_decim.c)
  target_compile_options(TestAcquisitionRetry PRIVATE -UNDEBUG)
  target_link_libraries(TestAcquisitionRetry srslte_phy)
  add_test(TestAcquisitionRetry TestAcquisitionRetry)

  add_executable(TestSyntheticPbchSfn TestSyntheticPbchSfn.c)
  target_compile_options(TestSyntheticPbchSfn PRIVATE -UNDEBUG)
  target_link_libraries(TestSyntheticPbchSfn srslte_phy)
  add_test(TestSyntheticPbchSfn TestSyntheticPbchSfn)

  set_tests_properties(TestReceiverSync TestMibDeadline TestPbchCombiningResetCallSite TestAcquisitionDeadline TestAcquisitionRetry TestSyntheticPbchSfn PROPERTIES
    TIMEOUT 10 LABELS falcon-reliability)

  # falcon_cell_search_callback()/falcon_mib_decoder_callback() live in
  # falcon_rf (lib/src/phy/falcon_rf/rf_utils.c), which also pulls in
  # rf_cell_search()/rf_mib_decoder() and therefore needs a real RF backend
  # (via SRSLTE_LIBRARIES) to link, unlike the other tests in this block.
  if(RF_FOUND)
    add_executable(TestNegativeFixtures TestNegativeFixtures.cc)
    target_compile_options(TestNegativeFixtures PRIVATE -std=c++11 -UNDEBUG)
    target_link_libraries(TestNegativeFixtures falcon_rf ${SRSLTE_LIBRARIES})
    add_test(TestNegativeFixtures TestNegativeFixtures)
    # Cell search over a full synthetic buffer may take longer than the
    # other tests in this block; give it its own, more generous timeout.
    set_tests_properties(TestNegativeFixtures PROPERTIES
      TIMEOUT 30 LABELS falcon-reliability)

    add_executable(TestSyncCfoAccuracy TestSyncCfoAccuracy.cc synth_subframe.cc)
    target_compile_options(TestSyncCfoAccuracy PRIVATE -std=c++11 -UNDEBUG)
    target_link_libraries(TestSyncCfoAccuracy falcon_rf ${SRSLTE_LIBRARIES})
    add_test(TestSyncCfoAccuracy TestSyncCfoAccuracy)
    # Cell search over several full synthetic buffers (including a
    # multi-point noise sweep for the Gate 4 requirement 5 threshold
    # calibration) may take longer than the other tests in this block.
    set_tests_properties(TestSyncCfoAccuracy PROPERTIES
      TIMEOUT 30 LABELS falcon-reliability)

    add_executable(TestMultiFrameLock TestMultiFrameLock.cc synth_subframe.cc)
    target_compile_options(TestMultiFrameLock PRIVATE -std=c++11 -UNDEBUG)
    target_link_libraries(TestMultiFrameLock falcon_rf ${SRSLTE_LIBRARIES})
    add_test(TestMultiFrameLock TestMultiFrameLock)
    # This test's fixtures are larger than TestSyncCfoAccuracy.cc's (a
    # higher nof_valid_pss_frames budget plus a blind 3-N_id_2-hypothesis
    # scan for the interfering-cell case), so it gets the same generous
    # timeout.
    set_tests_properties(TestMultiFrameLock PROPERTIES
      TIMEOUT 30 LABELS falcon-reliability)

    add_executable(TestPbchStageCapture TestPbchStageCapture.cc pbch_stage_capture.cc)
    target_compile_options(TestPbchStageCapture PRIVATE -std=c++11 -UNDEBUG)
    target_link_libraries(TestPbchStageCapture falcon_rf ${SRSLTE_LIBRARIES})
    add_test(TestPbchStageCapture TestPbchStageCapture)
    set_tests_properties(TestPbchStageCapture PROPERTIES
      TIMEOUT 30 LABELS falcon-reliability)

    add_executable(TestReferenceFixtureConsistency TestReferenceFixtureConsistency.cc)
    target_compile_options(TestReferenceFixtureConsistency PRIVATE -std=c++11 -UNDEBUG)
    target_link_libraries(TestReferenceFixtureConsistency falcon_rf ${SRSLTE_LIBRARIES})
    add_test(TestReferenceFixtureConsistency TestReferenceFixtureConsistency)
    set_tests_properties(TestReferenceFixtureConsistency PROPERTIES
      TIMEOUT 30 LABELS falcon-reliability)

    # CTest runs each test with its binary's directory as the working
    # directory, not the repo root, so these two tests' repo-root-relative
    # fixture default (external/fixtures/data/...) never resolves under
    # ctest and both silently SKIP (exit 0) instead of asserting anything.
    # Point FALCON_FIXTURE_DIR at the real location so ctest exercises the
    # same fixture-backed decode path a manual repo-root run does.
    set_tests_properties(TestPbchStageCapture TestReferenceFixtureConsistency PROPERTIES
      ENVIRONMENT "FALCON_FIXTURE_DIR=${CMAKE_SOURCE_DIR}/external/fixtures/data")

    add_executable(TestPbchCombiningReset TestPbchCombiningReset.cc)
    target_compile_options(TestPbchCombiningReset PRIVATE -std=c++11 -UNDEBUG)
    target_link_libraries(TestPbchCombiningReset falcon_rf ${SRSLTE_LIBRARIES})
    add_test(TestPbchCombiningReset TestPbchCombiningReset)
    set_tests_properties(TestPbchCombiningReset PROPERTIES
      TIMEOUT 30 LABELS falcon-reliability)

    add_executable(TestRsCfoEstimator TestRsCfoEstimator.cc synth_subframe.cc)
    target_compile_options(TestRsCfoEstimator PRIVATE -std=c++11 -UNDEBUG)
    target_link_libraries(TestRsCfoEstimator falcon_rf ${SRSLTE_LIBRARIES})
    add_test(TestRsCfoEstimator TestRsCfoEstimator)
    set_tests_properties(TestRsCfoEstimator PROPERTIES
      TIMEOUT 30 LABELS falcon-reliability)
  endif()
endif()

if(SOAPYSDR_FOUND AND EXISTS "${CMAKE_BINARY_DIR}/srsLTE-src/lib/src/phy/rf/rf_soapy_imp.c")
  add_executable(TestSoapyReceive TestSoapyReceive.c)
  target_compile_options(TestSoapyReceive PRIVATE -UNDEBUG)
  target_include_directories(TestSoapyReceive PRIVATE
    "${CMAKE_BINARY_DIR}/srsLTE-src/lib/src/phy/rf"
    ${SOAPYSDR_INCLUDE_DIRS})
  target_link_libraries(TestSoapyReceive ${SOAPYSDR_LIBRARIES} srslte_phy pthread)
  add_test(TestSoapyReceive TestSoapyReceive)
  set_tests_properties(TestSoapyReceive PROPERTIES
    TIMEOUT 10 LABELS falcon-reliability)
endif()

if(SOAPYSDR_FOUND AND LIBHACKRF_FOUND)
  add_executable(TestContinuityProbeArgs TestContinuityProbeArgs.cc)
  target_compile_options(TestContinuityProbeArgs PRIVATE -std=c++11 -UNDEBUG)
  target_include_directories(TestContinuityProbeArgs PRIVATE
    ${SOAPYSDR_INCLUDE_DIRS}
    ${LIBHACKRF_INCLUDE_DIRS})
  target_link_libraries(TestContinuityProbeArgs ${SOAPYSDR_LIBRARIES} ${LIBHACKRF_LIBRARIES} pthread)
  add_test(TestContinuityProbeArgs TestContinuityProbeArgs)
  set_tests_properties(TestContinuityProbeArgs PROPERTIES
    TIMEOUT 10 LABELS falcon-reliability)
endif()
