From 2a71a0390c6c1130c9b50f717a751dc815310073 Mon Sep 17 00:00:00 2001 From: Zack Galbreath Date: Tue, 20 Aug 2019 10:55:12 -0400 Subject: [PATCH] ctest: rename TRACK to GROUP Update command-line options, script variables, and documentation to use the term "group" instead of "track". The old terms are still available for now, but they are now undocumented. This makes our terminology more consistent with CDash. The goal of this change is to make it more clear to our users how CTest and CDash interact with each other. --- Help/command/ctest_start.rst | 29 +++++------ Help/manual/ctest.1.rst | 11 +++-- Source/CTest/cmCTestStartCommand.cxx | 14 +++--- Source/CTest/cmCTestSubmitHandler.cxx | 11 +++-- Source/cmCTest.cxx | 48 +++++++++++-------- Source/cmCTest.h | 6 +-- Source/ctest.cxx | 4 +- .../AppendDifferentGroup-stderr.txt | 1 + .../AppendDifferentGroup-stdout.txt | 8 ++++ .../AppendDifferentTrack-stderr.txt | 2 +- .../AppendDifferentTrack-stdout.txt | 2 +- .../ctest_start/MissingGroupArg-result.txt | 1 + .../ctest_start/MissingGroupArg-stderr.txt | 2 + .../MissingGroupArgAppend-result.txt | 1 + .../MissingGroupArgAppend-stderr.txt | 2 + .../MissingGroupArgQuiet-result.txt | 1 + .../MissingGroupArgQuiet-stderr.txt | 2 + .../ctest_start/MissingTrackArg-stderr.txt | 2 +- .../MissingTrackArgAppend-stderr.txt | 2 +- .../MissingTrackArgQuiet-stderr.txt | 2 +- .../NoAppendDifferentGroup-stdout.txt | 7 +++ .../NoAppendDifferentTrack-stdout.txt | 2 +- Tests/RunCMake/ctest_start/RunCMakeTest.cmake | 6 +++ ...WriteModelToTagNoMatchingGroup-check.cmake | 1 + 24 files changed, 109 insertions(+), 58 deletions(-) create mode 100644 Tests/RunCMake/ctest_start/AppendDifferentGroup-stderr.txt create mode 100644 Tests/RunCMake/ctest_start/AppendDifferentGroup-stdout.txt create mode 100644 Tests/RunCMake/ctest_start/MissingGroupArg-result.txt create mode 100644 Tests/RunCMake/ctest_start/MissingGroupArg-stderr.txt create mode 100644 Tests/RunCMake/ctest_start/MissingGroupArgAppend-result.txt create mode 100644 Tests/RunCMake/ctest_start/MissingGroupArgAppend-stderr.txt create mode 100644 Tests/RunCMake/ctest_start/MissingGroupArgQuiet-result.txt create mode 100644 Tests/RunCMake/ctest_start/MissingGroupArgQuiet-stderr.txt create mode 100644 Tests/RunCMake/ctest_start/NoAppendDifferentGroup-stdout.txt create mode 100644 Tests/RunCMake/ctest_start/WriteModelToTagNoMatchingGroup-check.cmake diff --git a/Help/command/ctest_start.rst b/Help/command/ctest_start.rst index 6db9a485a8..f0704aca54 100644 --- a/Help/command/ctest_start.rst +++ b/Help/command/ctest_start.rst @@ -5,9 +5,9 @@ Starts the testing for a given model :: - ctest_start( [ []] [TRACK ] [QUIET]) + ctest_start( [ []] [GROUP ] [QUIET]) - ctest_start([ [ []]] [TRACK ] APPEND [QUIET]) + ctest_start([ [ []]] [GROUP ] APPEND [QUIET]) Starts the testing for a given model. The command should be called after the binary directory is initialized. @@ -26,20 +26,21 @@ The parameters are as follows: Set the binary directory. If not specified, the value of :variable:`CTEST_BINARY_DIRECTORY` is used instead. -``TRACK `` - If ``TRACK`` is used, the submissions will go to the specified track on the - CDash server. If no ``TRACK`` is specified, the name of the model is used by - default. +``GROUP `` + If ``GROUP`` is used, the submissions will go to the specified group on the + CDash server. If no ``GROUP`` is specified, the name of the model is used by + default. This replaces the deprecated option ``TRACK``. Despite the name + change its behavior is unchanged. ``APPEND`` If ``APPEND`` is used, the existing ``TAG`` is used rather than creating a new one based on the current time stamp. If you use ``APPEND``, you can omit the - ```` and ``TRACK `` parameters, because they will be read from + ```` and ``GROUP `` parameters, because they will be read from the generated ``TAG`` file. For example: .. code-block:: cmake - ctest_start(Experimental TRACK TrackExperimental) + ctest_start(Experimental GROUP GroupExperimental) Later, in another ``ctest -S`` script: @@ -48,11 +49,11 @@ The parameters are as follows: ctest_start(APPEND) When the second script runs ``ctest_start(APPEND)``, it will read the - ``Experimental`` model and ``TrackExperimental`` track from the ``TAG`` file + ``Experimental`` model and ``GroupExperimental`` group from the ``TAG`` file generated by the first ``ctest_start()`` command. Please note that if you - call ``ctest_start(APPEND)`` and specify a different model or track than + call ``ctest_start(APPEND)`` and specify a different model or group than in the first ``ctest_start()`` command, a warning will be issued, and the - new model and track will be used. + new model and group will be used. ``QUIET`` If ``QUIET`` is used, CTest will suppress any non-error messages that it @@ -65,11 +66,11 @@ equivalent: .. code-block:: cmake - ctest_start(Experimental path/to/source path/to/binary TRACK SomeTrack QUIET APPEND) + ctest_start(Experimental path/to/source path/to/binary GROUP SomeGroup QUIET APPEND) - ctest_start(TRACK SomeTrack Experimental QUIET path/to/source APPEND path/to/binary) + ctest_start(GROUP SomeGroup Experimental QUIET path/to/source APPEND path/to/binary) - ctest_start(APPEND QUIET Experimental path/to/source TRACK SomeTrack path/to/binary) + ctest_start(APPEND QUIET Experimental path/to/source GROUP SomeGroup path/to/binary) However, for the sake of readability, it is recommended that you order your parameters in the order listed at the top of this page. diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index c6b1425601..9d93bb8ebd 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -482,14 +482,17 @@ a `CDash`_ server. The command-line signature used to submit to `CDash`_ is:: Options for Dashboard Client include: -``--track `` - Specify the track to submit dashboard to +``--group `` + Specify what group you'd like to submit results to - Submit dashboard to specified track instead of default one. By + Submit dashboard to specified group instead of default one. By default, the dashboard is submitted to Nightly, Experimental, or - Continuous track, but by specifying this option, the track can be + Continuous group, but by specifying this option, the group can be arbitrary. + This replaces the deprecated option ``--track``. + Despite the name change its behavior is unchanged. + ``-A , --add-notes `` Add a notes file with submission. diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 67ff2db056..e4a184426e 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -33,14 +33,16 @@ bool cmCTestStartCommand::InitialPass(std::vector const& args, const char* bld_dir = nullptr; while (cnt < args.size()) { - if (args[cnt] == "TRACK") { + if (args[cnt] == "GROUP" || args[cnt] == "TRACK") { cnt++; if (cnt >= args.size() || args[cnt] == "APPEND" || args[cnt] == "QUIET") { - this->SetError("TRACK argument missing track name"); + std::ostringstream e; + e << args[cnt - 1] << " argument missing group name"; + this->SetError(e.str()); return false; } - this->CTest->SetSpecificTrack(args[cnt].c_str()); + this->CTest->SetSpecificGroup(args[cnt].c_str()); cnt++; } else if (args[cnt] == "APPEND") { cnt++; @@ -113,10 +115,10 @@ bool cmCTestStartCommand::InitialPass(std::vector const& args, << " Build directory: " << bld_dir << std::endl, this->Quiet); } - const char* track = this->CTest->GetSpecificTrack(); - if (track) { + const char* group = this->CTest->GetSpecificGroup(); + if (group) { cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Track: " << track << std::endl, this->Quiet); + " Group: " << group << std::endl, this->Quiet); } // Log startup actions. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index a30999b0a9..4ebb1c82ca 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -569,6 +569,11 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, << curl.Escape(this->CTest->GetCTestConfiguration("BuildName")) << "&" << "site=" << curl.Escape(this->CTest->GetCTestConfiguration("Site")) << "&" + << "group=" << curl.Escape(this->CTest->GetTestModelString()) + << "&" + // For now, we send both "track" and "group" to CDash in case we're + // submitting to an older instance that still expects the prior + // terminology. << "track=" << curl.Escape(this->CTest->GetTestModelString()) << "&" << "starttime=" << timeNow << "&" << "endtime=" << timeNow << "&" @@ -837,10 +842,10 @@ int cmCTestSubmitHandler::ProcessHandler() } cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Submit files\n", this->Quiet); - const char* specificTrack = this->CTest->GetSpecificTrack(); - if (specificTrack) { + const char* specificGroup = this->CTest->GetSpecificGroup(); + if (specificGroup) { cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Send to track: " << specificTrack << std::endl, + " Send to group: " << specificGroup << std::endl, this->Quiet); } this->SetLogFile(&ofs); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index e7a16b5566..54f0896c3e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -155,7 +155,7 @@ struct cmCTest::Private bool TomorrowTag = false; int TestModel = cmCTest::EXPERIMENTAL; - std::string SpecificTrack; + std::string SpecificGroup; cmDuration TimeOut = cmDuration::zero(); @@ -508,10 +508,10 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) day != lctime->tm_mday) { tag.clear(); } - std::string track; - if (cmSystemTools::GetLineFromStream(tfin, track) && + std::string group; + if (cmSystemTools::GetLineFromStream(tfin, group) && !this->Impl->Parts[PartStart] && !command) { - this->Impl->SpecificTrack = track; + this->Impl->SpecificGroup = group; } std::string model; if (cmSystemTools::GetLineFromStream(tfin, model) && @@ -564,13 +564,13 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) } } } else { - std::string track; + std::string group; std::string modelStr; int model = cmCTest::UNKNOWN; if (tfin) { cmSystemTools::GetLineFromStream(tfin, tag); - cmSystemTools::GetLineFromStream(tfin, track); + cmSystemTools::GetLineFromStream(tfin, group); if (cmSystemTools::GetLineFromStream(tfin, modelStr)) { model = GetTestModelFromString(modelStr.c_str()); } @@ -605,15 +605,15 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) quiet); } - if (!this->Impl->SpecificTrack.empty() && - track != this->Impl->SpecificTrack) { + if (!this->Impl->SpecificGroup.empty() && + group != this->Impl->SpecificGroup) { cmCTestOptionalLog(this, WARNING, - "Track given in TAG does not match " - "track given in ctest_start()" + "Group given in TAG does not match " + "group given in ctest_start()" << std::endl, quiet); } else { - this->Impl->SpecificTrack = track; + this->Impl->SpecificGroup = group; } cmCTestOptionalLog(this, OUTPUT, @@ -1021,8 +1021,8 @@ int cmCTest::ProcessSteps() std::string cmCTest::GetTestModelString() { - if (!this->Impl->SpecificTrack.empty()) { - return this->Impl->SpecificTrack; + if (!this->Impl->SpecificGroup.empty()) { + return this->Impl->SpecificGroup; } switch (this->Impl->TestModel) { case cmCTest::NIGHTLY: @@ -1908,9 +1908,15 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, this->Impl->Debug = true; this->Impl->ShowLineNumbers = true; } + if (this->CheckArgument(arg, "--group") && i < args.size() - 1) { + i++; + this->Impl->SpecificGroup = args[i]; + } + // This is an undocumented / deprecated option. + // "Track" has been renamed to "Group". if (this->CheckArgument(arg, "--track") && i < args.size() - 1) { i++; - this->Impl->SpecificTrack = args[i]; + this->Impl->SpecificGroup = args[i]; } if (this->CheckArgument(arg, "--show-line-numbers")) { this->Impl->ShowLineNumbers = true; @@ -2769,21 +2775,21 @@ std::vector& cmCTest::GetInitialCommandLineArguments() return this->Impl->InitialCommandLineArguments; } -const char* cmCTest::GetSpecificTrack() +const char* cmCTest::GetSpecificGroup() { - if (this->Impl->SpecificTrack.empty()) { + if (this->Impl->SpecificGroup.empty()) { return nullptr; } - return this->Impl->SpecificTrack.c_str(); + return this->Impl->SpecificGroup.c_str(); } -void cmCTest::SetSpecificTrack(const char* track) +void cmCTest::SetSpecificGroup(const char* group) { - if (!track) { - this->Impl->SpecificTrack.clear(); + if (!group) { + this->Impl->SpecificGroup.clear(); return; } - this->Impl->SpecificTrack = track; + this->Impl->SpecificGroup = group; } void cmCTest::SetFailover(bool failover) diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 7f6637863c..7fe3455949 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -404,9 +404,9 @@ public: std::vector& GetInitialCommandLineArguments(); - /** Set the track to submit to */ - void SetSpecificTrack(const char* track); - const char* GetSpecificTrack(); + /** Set the group to submit to */ + void SetSpecificGroup(const char* group); + const char* GetSpecificGroup(); void SetFailover(bool failover); bool GetFailover() const; diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 77a84fd0f9..a69ba1532a 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -83,7 +83,9 @@ static const char* cmDocumentationOptions[][2] = { { "-T , --test-action ", "Sets the dashboard action to " "perform" }, - { "--track ", "Specify the track to submit dashboard to" }, + { "--group ", + "Specify what build group on the dashboard you'd like to " + "submit results to." }, { "-S