mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0025803: Defective tests contaminating current directory
Test cases save results in directory pointed by ${imagedir} Tcl variable. File names are initialized in scripts and passed to DRAW command as argument. Tests User Guide was updated. Remarks were corrected
This commit is contained in:
parent
19589673b3
commit
7a7e8cf174
@ -452,7 +452,7 @@ If the test cannot be implemented using available DRAW commands, consider the fo
|
|||||||
* Otherwise the new command implementing the actions needed for this particular test should be added in *QABugs* package. The command name should be formed by the Mantis issue ID prefixed by *bug*, e.g. *bug12345*.
|
* Otherwise the new command implementing the actions needed for this particular test should be added in *QABugs* package. The command name should be formed by the Mantis issue ID prefixed by *bug*, e.g. *bug12345*.
|
||||||
|
|
||||||
Note that a DRAW command is expected to return 0 in case of a normal completion, and 1 (Tcl exception) if it is incorrectly used (e.g. a wrong number of input arguments). Thus if the new command needs to report a test error, this should be done by outputting an appropriate error message rather than by returning a non-zero value.
|
Note that a DRAW command is expected to return 0 in case of a normal completion, and 1 (Tcl exception) if it is incorrectly used (e.g. a wrong number of input arguments). Thus if the new command needs to report a test error, this should be done by outputting an appropriate error message rather than by returning a non-zero value.
|
||||||
|
Also file names must not be encoded in DRAW command but in script, and passed to DRAW command as argument.
|
||||||
|
|
||||||
@subsection testmanual_3_4 Script Implementation
|
@subsection testmanual_3_4 Script Implementation
|
||||||
|
|
||||||
|
@ -1802,7 +1802,7 @@ struct QABugs_NHandleClass
|
|||||||
#include <STEPCAFControl_Writer.hxx>
|
#include <STEPCAFControl_Writer.hxx>
|
||||||
static Standard_Integer OCC23951 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
|
static Standard_Integer OCC23951 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
|
||||||
{
|
{
|
||||||
if (argc != 1) {
|
if (argc != 2) {
|
||||||
di << "Usage: " << argv[0] << " invalid number of arguments" << "\n";
|
di << "Usage: " << argv[0] << " invalid number of arguments" << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1824,7 +1824,7 @@ static Standard_Integer OCC23951 (Draw_Interpretor& di, Standard_Integer argc, c
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.Write("test_box.step");
|
writer.Write(argv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2247,11 +2247,11 @@ static TopoDS_Shape CreateTestShape (int& theShapeNb)
|
|||||||
#include <TNaming_Builder.hxx>
|
#include <TNaming_Builder.hxx>
|
||||||
static Standard_Integer OCC24931 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
static Standard_Integer OCC24931 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||||
{
|
{
|
||||||
if (argc != 1) {
|
if (argc != 2) {
|
||||||
di << "Usage: " << argv[0] << " invalid number of arguments"<<"\n";
|
di << "Usage: " << argv[0] << " invalid number of arguments"<<"\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
TCollection_ExtendedString aFileName ("testdocument.xml");
|
TCollection_ExtendedString aFileName (argv[1]);
|
||||||
PCDM_StoreStatus aSStatus = PCDM_SS_Failure;
|
PCDM_StoreStatus aSStatus = PCDM_SS_Failure;
|
||||||
|
|
||||||
Handle(TDocStd_Application) anApp = new AppStd_Application;
|
Handle(TDocStd_Application) anApp = new AppStd_Application;
|
||||||
@ -3593,8 +3593,8 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
|||||||
theCommands.Add ("OCC24755", "OCC24755", __FILE__, OCC24755, group);
|
theCommands.Add ("OCC24755", "OCC24755", __FILE__, OCC24755, group);
|
||||||
theCommands.Add ("OCC24834", "OCC24834", __FILE__, OCC24834, group);
|
theCommands.Add ("OCC24834", "OCC24834", __FILE__, OCC24834, group);
|
||||||
theCommands.Add ("OCC24889", "OCC24889", __FILE__, OCC24889, group);
|
theCommands.Add ("OCC24889", "OCC24889", __FILE__, OCC24889, group);
|
||||||
theCommands.Add ("OCC23951", "OCC23951", __FILE__, OCC23951, group);
|
theCommands.Add ("OCC23951", "OCC23951 path to saved step file", __FILE__, OCC23951, group);
|
||||||
theCommands.Add ("OCC24931", "OCC24931", __FILE__, OCC24931, group);
|
theCommands.Add ("OCC24931", "OCC24931 path to saved xml file", __FILE__, OCC24931, group);
|
||||||
theCommands.Add ("OCC24945", "OCC24945", __FILE__, OCC24945, group);
|
theCommands.Add ("OCC24945", "OCC24945", __FILE__, OCC24945, group);
|
||||||
theCommands.Add ("OCC23950", "OCC23950 step_file", __FILE__, OCC23950, group);
|
theCommands.Add ("OCC23950", "OCC23950 step_file", __FILE__, OCC23950, group);
|
||||||
theCommands.Add ("OCC25004", "OCC25004", __FILE__, OCC25004, group);
|
theCommands.Add ("OCC25004", "OCC25004", __FILE__, OCC25004, group);
|
||||||
|
@ -8,7 +8,10 @@ puts ""
|
|||||||
|
|
||||||
pload QAcommands
|
pload QAcommands
|
||||||
|
|
||||||
set info [OCC24931]
|
set FilePath ${imagedir}/bug24931_testdocument.xml
|
||||||
|
|
||||||
|
file delete -force ${FilePath}
|
||||||
|
set info [OCC24931 ${FilePath}]
|
||||||
|
|
||||||
if { [regexp "OK" $info] != 1 } {
|
if { [regexp "OK" $info] != 1 } {
|
||||||
puts "Error: Stack is overflow"
|
puts "Error: Stack is overflow"
|
||||||
|
@ -6,6 +6,12 @@ puts ""
|
|||||||
# It is impossible to set material, color and transparency to compound
|
# It is impossible to set material, color and transparency to compound
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
|
set FilePath_v1 ${imagedir}/bug2883_2_v1.png
|
||||||
|
set FilePath_v2 ${imagedir}/bug2883_2_v2.png
|
||||||
|
|
||||||
|
file delete -force ${FilePath_v1}
|
||||||
|
file delete -force ${FilePath_v2}
|
||||||
|
|
||||||
box b1 0 0 0 1 2 3
|
box b1 0 0 0 1 2 3
|
||||||
box b2 4 0 0 3 1 2
|
box b2 4 0 0 3 1 2
|
||||||
vinit drv1/v1/v1
|
vinit drv1/v1/v1
|
||||||
@ -18,10 +24,10 @@ vdisplay b1 b2
|
|||||||
vfit
|
vfit
|
||||||
vsetcolor b1 RED
|
vsetcolor b1 RED
|
||||||
vactivate drv1/v1/v1
|
vactivate drv1/v1/v1
|
||||||
vdump v1.png
|
vdump ${FilePath_v1}
|
||||||
vactivate drv1/v2/v1
|
vactivate drv1/v2/v1
|
||||||
vdump v2.png
|
vdump ${FilePath_v2}
|
||||||
set info [diffimage v1.png v2.png 0 0 0]
|
set info [diffimage ${FilePath_v1} ${FilePath_v2} 0 0 0]
|
||||||
if { $info != 0 } {
|
if { $info != 0 } {
|
||||||
puts "Error: images v1 and v2 are different"
|
puts "Error: images v1 and v2 are different"
|
||||||
} else {
|
} else {
|
||||||
|
@ -8,7 +8,10 @@ puts ""
|
|||||||
|
|
||||||
pload QAcommands
|
pload QAcommands
|
||||||
|
|
||||||
set info [OCC23951]
|
set FilePath ${imagedir}/bug23951_test_box.step
|
||||||
|
|
||||||
|
file delete -force ${FilePath}
|
||||||
|
set info [OCC23951 ${FilePath}]
|
||||||
|
|
||||||
if { [regexp "Write Done" $info] != 1 } {
|
if { [regexp "Write Done" $info] != 1 } {
|
||||||
puts "Error: file was not written"
|
puts "Error: file was not written"
|
||||||
@ -16,7 +19,7 @@ if { [regexp "Write Done" $info] != 1 } {
|
|||||||
puts "OK: file was written"
|
puts "OK: file was written"
|
||||||
}
|
}
|
||||||
|
|
||||||
stepread test_box.step a *
|
stepread ${FilePath} a *
|
||||||
axo
|
axo
|
||||||
fit
|
fit
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user