cmCTestBuildAndTestHandler.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <sstream>
  6. #include <string>
  7. #include <vector>
  8. #include <stddef.h>
  9. #include "cmCTestGenericHandler.h"
  10. #include "cmDuration.h"
  11. class cmake;
  12. /** \class cmCTestBuildAndTestHandler
  13. * \brief A class that handles ctest -S invocations
  14. *
  15. */
  16. class cmCTestBuildAndTestHandler : public cmCTestGenericHandler
  17. {
  18. public:
  19. using Superclass = cmCTestGenericHandler;
  20. /*
  21. * The main entry point for this class
  22. */
  23. int ProcessHandler() override;
  24. //! Set all the build and test arguments
  25. int ProcessCommandLineArguments(
  26. const std::string& currentArg, size_t& idx,
  27. const std::vector<std::string>& allArgs) override;
  28. /*
  29. * Get the output variable
  30. */
  31. const char* GetOutput();
  32. cmCTestBuildAndTestHandler();
  33. void Initialize() override;
  34. protected:
  35. //! Run CMake and build a test and then run it as a single test.
  36. int RunCMakeAndTest(std::string* output);
  37. int RunCMake(std::string* outstring, std::ostringstream& out,
  38. std::string& cmakeOutString, cmake* cm);
  39. std::string Output;
  40. std::string BuildGenerator;
  41. std::string BuildGeneratorPlatform;
  42. std::string BuildGeneratorToolset;
  43. std::vector<std::string> BuildOptions;
  44. bool BuildTwoConfig;
  45. std::string BuildMakeProgram;
  46. std::string ConfigSample;
  47. std::string SourceDir;
  48. std::string BinaryDir;
  49. std::string BuildProject;
  50. std::string TestCommand;
  51. bool BuildNoClean;
  52. std::string BuildRunDir;
  53. std::string ExecutableDirectory;
  54. std::vector<std::string> TestCommandArgs;
  55. std::vector<std::string> BuildTargets;
  56. bool BuildNoCMake;
  57. cmDuration Timeout;
  58. };