0029077: Tests - improve command testfile
[occt.git] / tests / demo / testsystem / testfile
1 puts "# This test is for command testfile, used to check new data files "
2 puts "# before adding to the data base:"
3 puts "# - bottle.brep should be reported as already in data base"
4 puts "# - hammer_copy.igs should be reported as duplicate"
5 puts "# - square.brep should be reported as new, with warnings on DOS encoding"
6 puts "#   and presence of triangulation"
7 puts ""
8
9 puts "# Preparing test data files..."
10
11 # find reference data files (they should be present, otherwise test is meaningless)
12 set bottle [locate_data_file bottle.brep]
13 set hammer [locate_data_file hammer.iges]
14
15 # bottle is simply copied
16 file copy -force $bottle ${imagedir}/bottle.brep
17
18 # hammer is copied with different name and DOS encoding
19 set fd [open $hammer r]
20 set hammer_content [read $fd]
21 close $fd
22 set fd [open ${imagedir}/_hammer_copy.igs w]
23 fconfigure $fd -translation crlf
24 puts -nonewline $fd $hammer_content
25 close $fd
26
27 # square is created anew
28 pload MODELING
29 box b 11.1 11.1 11.1
30 explode b f
31 tcopy b_1 f
32 incmesh f 0.01
33 save f ${imagedir}/_square.brep
34
35 set fd [open ${imagedir}/_square.brep r]
36 set square_content [read $fd]
37 close $fd
38 set fd [open ${imagedir}/_square.brep w]
39 fconfigure $fd -translation crlf
40 puts -nonewline $fd $square_content
41 close $fd
42
43 puts ""
44 puts "REQUIRED ALL: bottle.brep: already present"
45 puts "REQUIRED ALL: hammer_copy.igs: duplicate"
46 puts "REQUIRED ALL: square.brep: new file"
47 puts "REQUIRED ALL: Warning: DOS encoding detected"
48 puts "REQUIRED ALL: Warning: shape contains triangulation"
49
50 testfile [list ${imagedir}/bottle.brep ${imagedir}/_hammer_copy.igs ${imagedir}/_square.brep]
51
52 puts "TEST COMPLETED"