View Issue Details

IDProjectCategoryView StatusLast Update
0023152Open CASCADEOCCT:DRAWpublic2012-11-16 13:16
ReporterabvAssigned Toabv 
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Product Version6.5.3 
Target Version6.5.4Fixed in Version6.5.4 
Summary0023152: Possibility to have echo of DRAW commands in log file
DescriptionWhen some script is executed with "source" command in DRAW, only messages explicitly printed by 'puts' and similar commands, and final result of the script, are output.

For testing and debug (as well as learning / demonstration) it could be useful to see also actual commands being executed, and their intermediate results.

Currently this possibility is implemented in QADraw package as follows:

- If environment variable QA_DRAW is defined to "1", QADraw commands get loaded automatically, and other defined commands are substituted by wrapper

- If environment variable QA_print_command is defined to "1", this wrapper replicates the command being executed to standard error stream

- If environment variable QA_DUP is set to "1", this wrapper tries to capture all output of the command (by redirecting standard streams to temporary files) and dump it to Tcl interpretor

This approach has problems:

1. It is unnecessarily overcomplicated and tricky
2. Use of environment variables does not allow to change behavior dynamically (switch on/off during one DRAW session)
3. Capturing of cout seems to be not really useful, as most of commands can be handled well without this (to be checked)
4. Intermediate results of commands is lost anyway

I propose to implement this differently, on the level of Draw package:

a) Provide switch to enable / disable echo of the command to cerr (managed dynamically by dedicated DRAW command, e.g. 'decho')

b) Provide specific command (e.g. 'dsource') to run script from the file with this option and echo of each intermediate command enabled automatically
TagsNo tags attached.
Test case numberchl 935 Y0

Attached Files

  • Y0 (1,001 bytes)

Activities

abv

2012-05-16 16:41

manager   ~0020545

The changes are pushed to Git branch CR23152; please review (see commit log for description of changes)

vtn

2012-06-26 17:52

developer   ~0020798

I added ios::sync_with_stdio() call to Draw::BasicCommands.

mkv

2012-06-27 10:59

tester   ~0020802

Dear BugMaster,
The workbenches
KAS:dev:mkv-23152-occt (GIT branch CR)
KAS:dev:mkv-23152-products (GIT master)
were compiled on Linux platform.
There is compilation error in follwing file:

Info : -------> Draw_Interpretor.cxx
Error : Errors occured in Shell
/dn47/KAS/dev/mkv-23152-occt/src/Draw/Draw_Interpretor.cxx:34:16: error: io.h: No such file or directory

Error : Failed : Draw_Interpretor.cxx
Info : ----------------------- Compilation Report -----------------------
Info : Failed : :LOC:dev:mkv-23152-occt:Draw:source:Draw_Interpretor.cxx
Info : -----------------------------------------------------------------

abv

2012-06-27 11:57

manager   ~0020803

Compilation error on Linux corrected; please test

mkv

2012-06-28 17:13

tester   ~0020815

Dear BugMaster,
The workbenches
KAS:dev:mkv-23152-occt (GIT branch CR23152)
KAS:dev:mkv-23152-products (GIT master)
were compiled on Linux platform and tested.

Regression:
Not detected

Improvements:
Not detected

Testing case:
Test case for this bug is chl 935 Y0.
It is OK in this branch.

See results in /QADisk/occttests/results/KAS/dev/mkv-23152-products_27062012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120622-opt_22062012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification

mkv

2012-06-28 17:13

tester  

Y0 (1,001 bytes)

Related Changesets

occt: master aa02980d

2012-06-28 13:46:43

abv


Committer: abv Details Diff
0023152: Possibility to have echo of DRAW commands in log file

Two commands are added in DRAW:

decho: allows switch on/off echo of commands and their results. When echo is on, all commands implemented as OCCT DRAW C procedures will be echoed to standard output, along with their result. This can be useful to trace process of execution of script evaluated by 'source' command.

dlog: implements off-screen log for recording DRAW commands and their output for further processing in Tcl script (mainly for use in automatic tests). Run this command without arguments to get help.
Added ios::sync_with_stdio() call to Draw::BasicCommands.
Correction for compilation on Linux
Affected Issues
0023152
mod - src/Draw/Draw_BasicCommands.cxx Diff File
mod - src/Draw/Draw_Interpretor.cdl Diff File
mod - src/Draw/Draw_Interpretor.cxx Diff File

Issue History

Date Modified Username Field Change
2012-05-12 19:34 abv New Issue
2012-05-12 19:34 abv Assigned To => mkv
2012-05-16 12:37 abv Assigned To mkv => abv
2012-05-16 12:37 abv Status new => assigned
2012-05-16 16:41 abv Note Added: 0020545
2012-05-16 16:41 abv Assigned To abv => vtn
2012-05-16 16:41 abv Status assigned => resolved
2012-06-26 17:52 vtn Note Added: 0020798
2012-06-26 17:52 vtn Assigned To vtn => mkv
2012-06-26 17:52 vtn Status resolved => reviewed
2012-06-27 10:59 mkv Note Added: 0020802
2012-06-27 11:01 mkv Assigned To mkv => abv
2012-06-27 11:01 mkv Status reviewed => assigned
2012-06-27 11:57 abv Note Added: 0020803
2012-06-27 11:57 abv Status assigned => resolved
2012-06-27 12:05 abv Status resolved => reviewed
2012-06-27 12:17 mkv Assigned To abv => mkv
2012-06-28 17:13 mkv Note Added: 0020815
2012-06-28 17:13 mkv File Added: Y0
2012-06-28 17:14 mkv Test case number => chl 935 Y0
2012-06-28 17:14 mkv Assigned To mkv => bugmaster
2012-06-28 17:14 mkv Status reviewed => tested
2012-07-02 11:43 abv Changeset attached => occt master aa02980d
2012-07-02 11:44 abv Assigned To bugmaster => abv
2012-07-02 11:44 abv Status tested => verified
2012-07-02 11:44 abv Resolution open => fixed
2012-11-16 13:15 bugmaster Fixed in Version => 6.5.4
2012-11-16 13:16 bugmaster Status verified => closed