README 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. If you think about adding a new testcase then here is a small checklist you
  2. can run through to find a proper place for it. Go through the list from the
  3. beginning and stop once you find something that matches your tests needs,
  4. i.e. if you will test a module and only need the configure mode use the
  5. instructions from section 2, not 3.
  6. 1. Your testcase can run in CMake script mode, i.e. "cmake -P something"
  7. Put your test in Tests/CMakeTests/ directory as a .cmake.in file. It will be
  8. put into the test binary directory by configure_file(... @ONLY) and run from
  9. there. Use the AddCMakeTest() macro in Tests/CMakeTests/CMakeLists.txt to add
  10. your test to the test runs.
  11. 2. Your test needs CMake to run in configure mode, but will not build anything
  12. This includes tests that will build something using try_compile() and friends,
  13. but nothing that expects add_executable(), add_library(), or add_test() to run.
  14. If the test configures the project only once and it must succeed then put it
  15. into the Tests/CMakeOnly/ directory. Create a subdirectory named like your
  16. test and write the CMakeLists.txt you need into that subdirectory. Use the
  17. add_CMakeOnly_test() macro from Tests/CMakeOnly/CMakeLists.txt to add your
  18. test to the test runs.
  19. If the test configures the project with multiple variations and verifies
  20. success or failure each time then put it into the Tests/RunCMake/ directory.
  21. Read the instructions in Tests/RunCMake/CMakeLists.txt to add a test.
  22. 3. If you are testing something from the Modules directory
  23. Put your test in the Tests/Modules/ directory. Create a subdirectory there
  24. named after your test. Use the ADD_TEST_MACRO macro from Tests/CMakeLists.txt
  25. to add your test to the test run. If you have put your stuff in
  26. Tests/Modules/Foo then you call it using ADD_TEST_MACRO(Module.Foo Foo).
  27. 4. You are doing other stuff.
  28. Find a good place ;) In doubt mail to [email protected] and ask for
  29. advise.