cmTestGenerator.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmTestGenerator_h
  4. #define cmTestGenerator_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmScriptGenerator.h"
  7. #include <iosfwd>
  8. #include <string>
  9. #include <vector>
  10. class cmLocalGenerator;
  11. class cmTest;
  12. /** \class cmTestGenerator
  13. * \brief Support class for generating install scripts.
  14. *
  15. */
  16. class cmTestGenerator : public cmScriptGenerator
  17. {
  18. CM_DISABLE_COPY(cmTestGenerator)
  19. public:
  20. cmTestGenerator(cmTest* test,
  21. std::vector<std::string> const& configurations =
  22. std::vector<std::string>());
  23. ~cmTestGenerator() override;
  24. void Compute(cmLocalGenerator* lg);
  25. /** Test if this generator installs the test for a given configuration. */
  26. bool TestsForConfig(const std::string& config);
  27. cmTest* GetTest() const;
  28. protected:
  29. void GenerateScriptConfigs(std::ostream& os, Indent indent) override;
  30. void GenerateScriptActions(std::ostream& os, Indent indent) override;
  31. void GenerateScriptForConfig(std::ostream& os, const std::string& config,
  32. Indent indent) override;
  33. void GenerateScriptNoConfig(std::ostream& os, Indent indent) override;
  34. bool NeedsScriptNoConfig() const override;
  35. void GenerateOldStyle(std::ostream& os, Indent indent);
  36. cmLocalGenerator* LG;
  37. cmTest* Test;
  38. bool TestGenerated;
  39. };
  40. #endif