test.ctest 462 B

1234567891011121314151617
  1. set(LOCK_FILE "${TEST_NAME}.lock")
  2. # Delete the old lock file in case it's lingering from a previous failed test run
  3. file(REMOVE "${LOCK_FILE}")
  4. if("${TEST_NAME}" STREQUAL "i_want_to_be_alone")
  5. file(GLOB LOCK_FILES *.lock)
  6. if(LOCK_FILES)
  7. message(FATAL_ERROR "found lock files of other tests even though this test should be running by itself: ${LOCK_FILES}")
  8. endif()
  9. endif()
  10. file(WRITE "${LOCK_FILE}")
  11. ctest_sleep(3)
  12. file(REMOVE "${LOCK_FILE}")
  13. return()