1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0027691: Remove dchrono from all test cases and move its to perf group

Remove performance comparing with hardcoded value.
Test cases for performance of some commands were moved to perf group.

Updated documentation.
This commit is contained in:
ski
2017-01-19 16:31:17 +03:00
committed by apn
parent 810b672ff3
commit 44fae8b193
165 changed files with 1267 additions and 2770 deletions

View File

@@ -100,20 +100,49 @@ static Standard_Integer chronom(Draw_Interpretor& di,
C->Timer().Reset();
}
else {
if (!strcasecmp(a[2],"reset"))
C->Timer().Reset();
if (!strcasecmp(a[2],"start"))
C->Timer().Start();
if (!strcasecmp(a[2],"stop"))
C->Timer().Stop();
if (!strcasecmp(a[2],"show"))
C->Timer().Show();
for (Standard_Integer anIter = 2; anIter < n; ++anIter)
{
TCollection_AsciiString anArg (a[anIter]);
anArg.LowerCase();
if (anArg == "reset")
{
C->Timer().Reset();
}
else if (anArg == "restart")
{
C->Timer().Restart();
}
else if (anArg == "start")
{
C->Timer().Start();
}
else if (anArg == "stop")
{
C->Timer().Stop();
}
else if (anArg == "show")
{
C->Timer().Show();
}
else if (anArg == "counter")
{
Standard_Real aSeconds,aCPUtime;
Standard_Integer aMinutes, aHours;
C->Timer().Show(aSeconds,aMinutes,aHours,aCPUtime);
std::cout << "COUNTER " << a[++anIter] << ": " << aCPUtime << "\n";
}
else
{
std::cerr << "Unknown argument '" << a[anIter] << "'!\n";
}
}
}
}
return 0;
}
static Standard_Integer dchronom(Draw_Interpretor& I,
static Standard_Integer dchronom(Draw_Interpretor& theDI,
Standard_Integer n,const char** a)
{
if ((n == 1) || (*a[1] == '0') || (*a[1] == '1')) {
@@ -122,8 +151,8 @@ static Standard_Integer dchronom(Draw_Interpretor& I,
else
Draw_Chrono = (*a[1] == '1');
if (Draw_Chrono) I << "Chronometers activated.\n";
else I << "Chronometers desactivated.\n";
if (Draw_Chrono) theDI << "Chronometers activated.\n";
else theDI << "Chronometers desactivated.\n";
}
else {
Handle(Draw_Drawable3D) D = Draw::Get(a[1]);
@@ -133,22 +162,50 @@ static Standard_Integer dchronom(Draw_Interpretor& I,
}
if (C.IsNull()) {
C = new Draw_Chronometer();
Draw::Set(a[1],C,Standard_False);
Draw::Set(a[1],C,Standard_False);
}
if (n <= 2) {
C->Timer().Reset();
}
else {
if (!strcasecmp(a[2],"reset"))
C->Timer().Reset();
if (!strcasecmp(a[2],"start"))
C->Timer().Start();
if (!strcasecmp(a[2],"stop"))
C->Timer().Stop();
if (!strcasecmp(a[2],"show")) {
Standard_SStream ss;
C->Timer().Show(ss);
I << ss;
for (Standard_Integer anIter = 2; anIter < n; ++anIter)
{
TCollection_AsciiString anArg (a[anIter]);
anArg.LowerCase();
if (anArg == "reset")
{
C->Timer().Reset();
}
else if (anArg == "restart")
{
C->Timer().Restart();
}
else if (anArg == "start")
{
C->Timer().Start();
}
else if (anArg == "stop")
{
C->Timer().Stop();
}
else if (anArg == "show")
{
Standard_SStream ss;
C->Timer().Show(ss);
theDI << ss;
}
else if (anArg == "counter")
{
Standard_Real aSeconds,aCPUtime;
Standard_Integer aMinutes, aHours;
C->Timer().Show(aSeconds,aMinutes,aHours,aCPUtime);
theDI << "COUNTER " << a[++anIter] << ": " << aCPUtime << "\n";
}
else
{
theDI << "Unknown argument '" << a[anIter] << "'!\n";
}
}
}
}