Skip to content

Commit

Permalink
Added printing of system and agent info to test_summary log
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWot committed Oct 6, 2015
1 parent de66b27 commit c16dbfb
Show file tree
Hide file tree
Showing 5 changed files with 330 additions and 57 deletions.
29 changes: 16 additions & 13 deletions src/hexl/hexl_base/HexlTestRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "Stats.hpp"
#include "HexlTest.hpp"
#include "HexlResource.hpp"
#include "RuntimeCommon.hpp"
#include <sstream>
#include "Utils.hpp"
#include <time.h>
Expand Down Expand Up @@ -155,15 +156,15 @@ void HTestRunner::BeforeTest(const std::string& path, Test* test)
if (cpath != pathPrev) {
if (!pathPrev.empty()) {
RunnerLog() << " ";
RunnerLog(testSummary) << " ";
SummaryLog() << " ";
pathStats.TestSet().PrintShort(RunnerLog());
pathStats.TestSet().PrintShort(RunnerLog(testSummary));
pathStats.TestSet().PrintShort(SummaryLog());
RunnerLog() << std::endl;
RunnerLog(testSummary) << std::endl;
SummaryLog() << std::endl;
}
pathStats.Clear();
RunnerLog() << cpath << " " << std::endl;
RunnerLog(testSummary) << cpath << " " << std::endl;
SummaryLog() << cpath << " " << std::endl;
pathPrev = cpath;
}
}
Expand All @@ -185,11 +186,13 @@ bool HTestRunner::BeforeTestSet(TestSet& testSet)
return false;
}
RunnerLog() << "UTC Start Date & Time: " << asctime(time_begin_UTC) << std::endl;
RunnerLog(testSummary) << "UTC Start Date & Time: " << asctime(time_begin_UTC) << std::endl;
SummaryLog() << "UTC Start Date & Time: " << asctime(time_begin_UTC) << std::endl;
if (context->Opts()->GetBoolean("dsign")) {
RunnerLog(testSummary) << "Digital Signature: " << "NNNNNNNNNNNNN" << std::endl << std::endl;
SummaryLog() << "Digital Signature: " << "NNNNNNNNNNNNN" << std::endl << std::endl;
testLog << "Digital Signature: " << "NNNNNNNNNNNNN" << std::endl << std::endl;
}
context->Runtime()->PrintInfo(SummaryLog());
SummaryLog() << std::endl << std::endl;
return true;
}

Expand All @@ -199,21 +202,21 @@ bool HTestRunner::AfterTestSet(TestSet& testSet)
tm* time_end_UTC = gmtime(&time_end);
// Process first path.
RunnerLog() << " ";
RunnerLog(testSummary) << " ";
SummaryLog() << " ";
pathStats.TestSet().PrintShort(RunnerLog());
pathStats.TestSet().PrintShort(RunnerLog(testSummary));
pathStats.TestSet().PrintShort(SummaryLog());
RunnerLog() << std::endl;
RunnerLog(testSummary) << std::endl;
SummaryLog() << std::endl;

// Totals
RunnerLog() << std::endl << "Testrun" << std::endl << " ";
RunnerLog(testSummary) << std::endl << "Testrun" << std::endl << " ";
SummaryLog() << std::endl << "Testrun" << std::endl << " ";
Stats().TestSet().PrintShort(RunnerLog()); RunnerLog() << std::endl;
Stats().TestSet().PrintShort(RunnerLog(testSummary)); RunnerLog(testSummary) << std::endl;
Stats().TestSet().PrintShort(SummaryLog()); SummaryLog() << std::endl;
RunnerLog() << std::endl << "UTC Finish Date & Time: " << asctime(time_end_UTC) << std::endl;
RunnerLog(testSummary) << std::endl << "UTC Finish Date & Time: " << asctime(time_end_UTC) << std::endl;
SummaryLog() << std::endl << "UTC Finish Date & Time: " << asctime(time_end_UTC) << std::endl;
if (context->Opts()->GetBoolean("dsign")) {
RunnerLog(testSummary) << "Digital Signature: " << "NNNNNNNNNNNNN" << std::endl;
SummaryLog() << "Digital Signature: " << "NNNNNNNNNNNNN" << std::endl;
testLog << "Digital Signature: " << "NNNNNNNNNNNNN" << std::endl;
}
testLog.close();
Expand Down
2 changes: 1 addition & 1 deletion src/hexl/hexl_base/HexlTestRunner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class HTestRunner : public TestRunnerBase {

protected:
std::ostream& RunnerLog() { return std::cout; }
std::ofstream& RunnerLog(std::ofstream& of) { return of; }
std::ofstream& SummaryLog() { return testSummary; }
std::ostream* TestOut() { return &testOut; }
virtual bool BeforeTestSet(TestSet& testSet);
virtual bool AfterTestSet(TestSet& testSet);
Expand Down
7 changes: 4 additions & 3 deletions src/hexl/hexl_base/RuntimeCommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace hexl {
BrigSamplerCoordNormalization Coord() const { return coord; }
BrigSamplerFilter Filter() const { return filter; }
BrigSamplerAddressing Addressing() const { return addressing; }

void Coord(BrigSamplerCoordNormalization coord_) { coord = coord_; }
void Filter(BrigSamplerFilter filter_) { filter = filter_; }
void Addressing(BrigSamplerAddressing addressing_) { addressing = addressing_; }
Expand Down Expand Up @@ -135,7 +135,7 @@ namespace hexl {
virtual ~RuntimeState() { }

virtual void Print(std::ostream& out) const { }

virtual Context* GetContext() = 0;

virtual void Set(const std::string& key, Value value);
Expand Down Expand Up @@ -190,8 +190,9 @@ namespace hexl {
RuntimeContext(Context* context_)
: context(context_) { }
virtual ~RuntimeContext() { }

virtual void Print(std::ostream& out) const { out << Description(); }
virtual void PrintInfo(std::ostream& out) {}
virtual bool Init() = 0;
virtual RuntimeState* NewState(Context* context) = 0;
virtual std::string Description() const = 0;
Expand Down
Loading

0 comments on commit c16dbfb

Please sign in to comment.