cmCTestCoverageCommand.cxx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmCTestCoverageCommand.h"
  4. #include <set>
  5. #include <cmext/string_view>
  6. #include "cmCTest.h"
  7. #include "cmCTestCoverageHandler.h"
  8. class cmCTestGenericHandler;
  9. void cmCTestCoverageCommand::BindArguments()
  10. {
  11. this->cmCTestHandlerCommand::BindArguments();
  12. this->Bind("LABELS"_s, this->Labels);
  13. }
  14. cmCTestGenericHandler* cmCTestCoverageCommand::InitializeHandler()
  15. {
  16. this->CTest->SetCTestConfigurationFromCMakeVariable(
  17. this->Makefile, "CoverageCommand", "CTEST_COVERAGE_COMMAND", this->Quiet);
  18. this->CTest->SetCTestConfigurationFromCMakeVariable(
  19. this->Makefile, "CoverageExtraFlags", "CTEST_COVERAGE_EXTRA_FLAGS",
  20. this->Quiet);
  21. cmCTestCoverageHandler* handler = this->CTest->GetCoverageHandler();
  22. handler->Initialize();
  23. // If a LABELS option was given, select only files with the labels.
  24. if (this->Labels) {
  25. handler->SetLabelFilter(
  26. std::set<std::string>(this->Labels->begin(), this->Labels->end()));
  27. }
  28. handler->SetQuiet(this->Quiet);
  29. return handler;
  30. }