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

0030697: Draw Harness - Draw_Printer should not be set to Message::DefaultMessenger() by default

Fixed bugs that occurred when using the default std::cout from Message::DefaultMessenger() instead of Draw_Printer

A dedicated option was added to Draw_ProgressIndicator, for outputting data to the tcl when performing tests

Added -tclOutput parameter to XProgress command
This commit is contained in:
mzernova
2019-05-06 23:05:13 +03:00
committed by bugmaster
parent 01b2f506d6
commit caee80f39f
13 changed files with 112 additions and 42 deletions

View File

@@ -14,12 +14,15 @@
#include <DBRep.hxx>
#include <Draw_Appli.hxx>
#include <Draw_Printer.hxx>
#include <IFSelect_Functions.hxx>
#include <IFSelect_SessionPilot.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Protocol.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Message_PrinterOStream.hxx>
#include <Standard_Transient.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
@@ -48,14 +51,23 @@ static Handle(TColStd_HSequenceOfAsciiString) thenews;
static Handle(IFSelect_SessionPilot) thepilot; // detient Session, Model
static Standard_Integer XSTEPDRAWRUN (Draw_Interpretor& , Standard_Integer argc, const char** argv)
static Standard_Integer XSTEPDRAWRUN (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{
TCollection_AsciiString mess;
for (Standard_Integer i = 0; i < argc; i ++) {
mess.AssignCat(argv[i]); mess.AssignCat(" ");
}
const Handle(Message_Messenger)& aMsgMgr = Message::DefaultMessenger();
Message_SequenceOfPrinters aPrinters;
aPrinters.Append (aMsgMgr->ChangePrinters());
aMsgMgr->AddPrinter (new Draw_Printer (di));
IFSelect_ReturnStatus stat = thepilot->Execute (mess.ToCString());
aMsgMgr->RemovePrinters (STANDARD_TYPE(Draw_Printer));
aMsgMgr->ChangePrinters().Append (aPrinters);
if (stat == IFSelect_RetError || stat == IFSelect_RetFail) return 1;
else return 0;
}