set(testfile "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake")
if(EXISTS "${testfile}")
  file(READ "${testfile}" testfile_contents)
else()
  message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.")
endif()
if(testfile_contents MATCHES "add_test[(]DoesNotUseEmulator ^(pseudo_emulator)+$")
  message(SEND_ERROR "Used emulator when it should not be used.")
endif()
if(NOT testfile_contents MATCHES "add_test[(]UsesEmulator .+pseudo_emulator.+$")
  message(SEND_ERROR "Did not use emulator when it should be used.")
endif()