1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 from libMEDMEM_Swig import *
26 filesPath=os.environ["MED_ROOT_DIR"]
27 filesPath=os.path.join(filesPath, "share", "salome", "resources", "med")
35 # executables list to test functionalities
37 testExecfiles.append("testUArray")
38 argListTest.append("")
39 rootFileTest.append("")
43 testExecfiles.append("testUCellModel")
44 argListTest.append("")
45 rootFileTest.append("")
49 testExecfiles.append("testUCoordinate")
50 argListTest.append("")
51 rootFileTest.append("")
55 testExecfiles.append("testUGeoNameMeshEntities")
56 argListTest.append("")
57 rootFileTest.append("")
61 testExecfiles.append("testUMedException")
62 argListTest.append("")
63 rootFileTest.append("")
67 testExecfiles.append("testUModulusArray")
68 argListTest.append("")
69 rootFileTest.append("")
73 testExecfiles.append("testUPointerOf")
74 argListTest.append("")
75 rootFileTest.append("")
79 testExecfiles.append("testUSkyLineArray")
80 argListTest.append("")
81 rootFileTest.append("")
85 testExecfiles.append("testUUnit")
86 argListTest.append("")
87 rootFileTest.append("")
91 testExecfiles.append("test_MEDMEM_PolyConnectivity")
92 argListTest.append("")
93 rootFileTest.append("")
97 testExecfiles.append("test_affect_medarray")
98 argListTest.append("")
99 rootFileTest.append("")
103 testExecfiles.append("test_copie_coordinate")
104 argListTest.append("")
105 rootFileTest.append("")
109 testExecfiles.append("test_copie_medarray")
110 argListTest.append("")
111 rootFileTest.append("")
115 testExecfiles.append("test_MEDMEM_Array")
116 argListTest.append("")
117 rootFileTest.append("")
121 testExecfiles.append("test_MEDMEM_CellModel")
122 argListTest.append("")
123 rootFileTest.append("")
127 testExecfiles.append("test_MEDMEM_ModulusArray")
128 argListTest.append("")
129 rootFileTest.append("")
133 testExecfiles.append("test_MEDMEM_PolyhedronArray")
134 argListTest.append("")
135 rootFileTest.append("")
139 testExecfiles.append("test_MEDMEM_SkyLineArray")
140 argListTest.append("")
141 rootFileTest.append("")
145 testExecfiles.append("test_MEDMEM_Meshing")
146 argListTest.append("toto")
147 rootFileTest.append("")
151 testExecfiles.append("test_gibi_driver")
152 rootFileTest.append("Darcy3_3D_H_10x10x10")
153 argListTest.append(os.path.join(filesPath,"Darcy3_3D_H_10x10x10.sauve"))
157 testExecfiles.append("test_gibi_driver")
158 rootFileTest.append("dx200_dy1_avec_2couches")
159 argListTest.append(os.path.join(filesPath,"dx200_dy1_avec_2couches.sauve"))
163 testExecfiles.append("test_gibi_driver")
164 rootFileTest.append("elle_2D_QT_10x10")
165 argListTest.append(os.path.join(filesPath,"elle_2D_QT_10x10.sauve"))
169 testExecfiles.append("test_gibi_driver")
170 rootFileTest.append("elle_2D_QT_2x2")
171 argListTest.append(os.path.join(filesPath,"elle_2D_QT_2x2.sauve"))
175 testExecfiles.append("test_gibi_driver")
176 rootFileTest.append("elle_2D_QT_40x40")
177 argListTest.append(os.path.join(filesPath,"elle_2D_QT_40x40.sauve"))
181 testExecfiles.append("test_gibi_driver")
182 rootFileTest.append("elle_2D_QT_4x4")
183 argListTest.append(os.path.join(filesPath,"elle_2D_QT_4x4.sauve"))
187 testExecfiles.append("test_gibi_driver")
188 rootFileTest.append("elle_3D_HPr_10x10x10")
189 argListTest.append(os.path.join(filesPath,"elle_3D_HPr_10x10x10.sauve"))
193 testExecfiles.append("test_gibi_driver")
194 rootFileTest.append("elle_3D_HPr_2x2x2")
195 argListTest.append(os.path.join(filesPath,"elle_3D_HPr_2x2x2.sauve"))
199 testExecfiles.append("test_gibi_driver")
200 rootFileTest.append("elle_3D_HPr_4x4x4")
201 argListTest.append(os.path.join(filesPath,"elle_3D_HPr_4x4x4.sauve"))
205 testExecfiles.append("test_gibi_driver")
206 rootFileTest.append("inclusion_2d_raf")
207 argListTest.append(os.path.join(filesPath,"inclusion_2d_raf.sauve"))
211 testExecfiles.append("test_gibi_driver")
212 rootFileTest.append("inclusion_2d")
213 argListTest.append(os.path.join(filesPath,"inclusion_2d.sauve"))
217 testExecfiles.append("test_gibi_driver")
218 rootFileTest.append("mail_ktest1-3-hexa")
219 argListTest.append(os.path.join(filesPath,"mail_ktest1-3-hexa.sauve"))
223 testExecfiles.append("test_gibi_driver")
224 rootFileTest.append("mail_ktest1-3-tetra")
225 argListTest.append(os.path.join(filesPath,"mail_ktest1-3-tetra.sauve"))
229 testExecfiles.append("test_gibi_driver")
230 rootFileTest.append("mail_ktest3-1")
231 argListTest.append(os.path.join(filesPath,"mail_ktest3-1.sauve"))
235 testExecfiles.append("test_gibi_driver")
236 rootFileTest.append("mail_ktest3-2")
237 argListTest.append(os.path.join(filesPath,"mail_ktest3-2.sauve"))
241 testExecfiles.append("test_gibi_driver")
242 rootFileTest.append("maillage_andra2_100elts")
243 argListTest.append(os.path.join(filesPath,"maillage_andra2_100elts.sauve"))
247 testExecfiles.append("test_gibi_driver")
248 rootFileTest.append("maillage_cas2_2d")
249 argListTest.append(os.path.join(filesPath,"maillage_cas2_2d.sauve"))
253 testExecfiles.append("test_gibi_driver")
254 rootFileTest.append("maillage_cas4_234elts")
255 argListTest.append(os.path.join(filesPath,"maillage_cas4_234elts.sauve"))
259 testExecfiles.append("test_gibi_driver")
260 rootFileTest.append("maillage_CHEMVAL_100elts")
261 argListTest.append(os.path.join(filesPath,"maillage_CHEMVAL_100elts.sauve"))
265 testExecfiles.append("test_gibi_driver")
266 rootFileTest.append("maillage_CHEMVAL_40elts")
267 argListTest.append(os.path.join(filesPath,"maillage_CHEMVAL_40elts.sauve"))
271 testExecfiles.append("test_gibi_driver")
272 rootFileTest.append("maillage_chemvalIV_cas1_100elts")
273 argListTest.append(os.path.join(filesPath,"maillage_chemvalIV_cas1_100elts.sauve"))
277 testExecfiles.append("test_gibi_driver")
278 rootFileTest.append("maillage_chemvalIV_cas1_40elts")
279 argListTest.append(os.path.join(filesPath,"maillage_chemvalIV_cas1_40elts.sauve"))
283 testExecfiles.append("test_gibi_driver")
284 rootFileTest.append("maill_mistra_elim")
285 argListTest.append(os.path.join(filesPath,"maill_mistra_elim.sauve"))
289 testExecfiles.append("test_gibi_driver")
290 rootFileTest.append("mail_test1-1-qua")
291 argListTest.append(os.path.join(filesPath,"mail_test1-1-qua.sauve"))
295 testExecfiles.append("test_gibi_driver")
296 rootFileTest.append("mail_test1-1-tri")
297 argListTest.append(os.path.join(filesPath,"mail_test1-1-tri.sauve"))
301 testExecfiles.append("test_gibi_driver")
302 rootFileTest.append("mail_test1-2-qua")
303 argListTest.append(os.path.join(filesPath,"mail_test1-2-qua.sauve"))
307 testExecfiles.append("test_gibi_driver")
308 rootFileTest.append("mail_test1-2-tri")
309 argListTest.append(os.path.join(filesPath,"mail_test1-2-tri.sauve"))
313 testExecfiles.append("test_gibi_driver")
314 rootFileTest.append("mail-test1-4-1")
315 argListTest.append(os.path.join(filesPath,"mail-test1-4-1.sauve"))
319 testExecfiles.append("test_gibi_driver")
320 rootFileTest.append("mail-test1-4-2")
321 argListTest.append(os.path.join(filesPath,"mail-test1-4-2.sauve"))
325 testExecfiles.append("test_porflow_driver")
326 rootFileTest.append("boitenew")
327 argListTest.append(os.path.join(filesPath,"boitenew.inp"))
331 testExecfiles.append("test_porflow_driver")
332 rootFileTest.append("Case1")
333 argListTest.append(os.path.join(filesPath,"Case1.inp"))
337 testExecfiles.append("test_porflow_driver")
338 rootFileTest.append("cube")
339 argListTest.append(os.path.join(filesPath,"cube.inp"))
343 testExecfiles.append("test_porflow_driver")
344 rootFileTest.append("test3")
345 argListTest.append(os.path.join(filesPath,"test3.inp"))
349 testExecfiles.append("test_porflow_driver")
350 rootFileTest.append("titi")
351 argListTest.append(os.path.join(filesPath,"titi.inp"))
355 testExecfiles.append("test_copie_connectivity")
356 rootFileTest.append("mesh")
357 meshTest.append("Mesh 1")
359 argListTest.append(os.path.join(filesPath,"mesh.med") + " " + "'Mesh 1'")
361 testExecfiles.append("test_copie_connectivity")
362 rootFileTest.append("maillage_UniSegFam")
363 meshTest.append("maillage_CHEMVAL_100elts")
365 argListTest.append(os.path.join(filesPath,"maillage_UniSegFam.med") + " " + "maillage_CHEMVAL_100elts")
367 testExecfiles.append("test_copie_connectivity")
368 rootFileTest.append("carre_en_quad4")
369 meshTest.append("carre_en_quad4")
371 argListTest.append(os.path.join(filesPath,"carre_en_quad4.med") + " " + "carre_en_quad4")
373 testExecfiles.append("test_copie_connectivity")
374 rootFileTest.append("cube_hexa8")
375 meshTest.append("CUBE_EN_HEXA8")
377 argListTest.append(os.path.join(filesPath,"cube_hexa8.med") + " " + "CUBE_EN_HEXA8")
379 testExecfiles.append("test_copie_connectivity")
380 rootFileTest.append("test19")
381 meshTest.append("maa1")
383 argListTest.append(os.path.join(filesPath,"test19.med") + " " + "maa1")
385 testExecfiles.append("test_copie_connectivity")
386 rootFileTest.append("carre_en_quad4_seg2")
387 meshTest.append("carre_en_quad4_seg2")
389 argListTest.append(os.path.join(filesPath,"carre_en_quad4_seg2.med") + " " + "carre_en_quad4_seg2")
391 testExecfiles.append("test_copie_connectivity")
392 rootFileTest.append("cube_hexa8_quad4")
393 meshTest.append("CUBE_EN_HEXA8_QUAD4")
395 argListTest.append(os.path.join(filesPath,"cube_hexa8_quad4.med") + " " + "CUBE_EN_HEXA8_QUAD4")
397 testExecfiles.append("test_copie_connectivity")
398 rootFileTest.append("pointe")
399 meshTest.append("maa1")
401 argListTest.append(os.path.join(filesPath,"pointe.med") + " " + "maa1")
403 testExecfiles.append("test_copie_family")
404 rootFileTest.append("mesh")
405 meshTest.append("Mesh 1")
407 argListTest.append(os.path.join(filesPath,"mesh.med") + " " + "'Mesh 1'")
409 testExecfiles.append("test_copie_family")
410 rootFileTest.append("maillage_UniSegFam")
411 meshTest.append("maillage_CHEMVAL_100elts")
413 argListTest.append(os.path.join(filesPath,"maillage_UniSegFam.med") + " " + "maillage_CHEMVAL_100elts")
415 testExecfiles.append("test_copie_family")
416 rootFileTest.append("carre_en_quad4")
417 meshTest.append("carre_en_quad4")
419 argListTest.append(os.path.join(filesPath,"carre_en_quad4.med") + " " + "carre_en_quad4")
421 testExecfiles.append("test_copie_family")
422 rootFileTest.append("cube_hexa8")
423 meshTest.append("CUBE_EN_HEXA8")
425 argListTest.append(os.path.join(filesPath,"cube_hexa8.med") + " " + "CUBE_EN_HEXA8")
427 testExecfiles.append("test_copie_family")
428 rootFileTest.append("test19")
429 meshTest.append("maa1")
431 argListTest.append(os.path.join(filesPath,"test19.med") + " " + "maa1")
433 testExecfiles.append("test_copie_family")
434 rootFileTest.append("carre_en_quad4_seg2")
435 meshTest.append("carre_en_quad4_seg2")
437 argListTest.append(os.path.join(filesPath,"carre_en_quad4_seg2.med") + " " + "carre_en_quad4_seg2")
439 testExecfiles.append("test_copie_family")
440 rootFileTest.append("cube_hexa8_quad4")
441 meshTest.append("CUBE_EN_HEXA8_QUAD4")
443 argListTest.append(os.path.join(filesPath,"cube_hexa8_quad4.med") + " " + "CUBE_EN_HEXA8_QUAD4")
445 testExecfiles.append("test_copie_family")
446 rootFileTest.append("pointe")
447 meshTest.append("maa1")
449 argListTest.append(os.path.join(filesPath,"pointe.med") + " " + "maa1")
451 testExecfiles.append("test_copie_group")
452 rootFileTest.append("mesh")
453 meshTest.append("Mesh 1")
455 argListTest.append(os.path.join(filesPath,"mesh.med") + " " + "'Mesh 1'")
457 testExecfiles.append("test_copie_group")
458 rootFileTest.append("maillage_UniSegFam")
459 meshTest.append("maillage_CHEMVAL_100elts")
461 argListTest.append(os.path.join(filesPath,"maillage_UniSegFam.med") + " " + "maillage_CHEMVAL_100elts")
463 testExecfiles.append("test_copie_group")
464 rootFileTest.append("carre_en_quad4")
465 meshTest.append("carre_en_quad4")
467 argListTest.append(os.path.join(filesPath,"carre_en_quad4.med") + " " + "carre_en_quad4")
469 testExecfiles.append("test_copie_group")
470 rootFileTest.append("cube_hexa8")
471 meshTest.append("CUBE_EN_HEXA8")
473 argListTest.append(os.path.join(filesPath,"cube_hexa8.med") + " " + "CUBE_EN_HEXA8")
475 testExecfiles.append("test_copie_group")
476 rootFileTest.append("test19")
477 meshTest.append("maa1")
479 argListTest.append(os.path.join(filesPath,"test19.med") + " " + "maa1")
481 testExecfiles.append("test_copie_group")
482 rootFileTest.append("carre_en_quad4_seg2")
483 meshTest.append("carre_en_quad4_seg2")
485 argListTest.append(os.path.join(filesPath,"carre_en_quad4_seg2.med") + " " + "carre_en_quad4_seg2")
487 testExecfiles.append("test_copie_group")
488 rootFileTest.append("cube_hexa8_quad4")
489 meshTest.append("CUBE_EN_HEXA8_QUAD4")
491 argListTest.append(os.path.join(filesPath,"cube_hexa8_quad4.med") + " " + "CUBE_EN_HEXA8_QUAD4")
493 testExecfiles.append("test_copie_group")
494 rootFileTest.append("pointe")
495 meshTest.append("maa1")
497 argListTest.append(os.path.join(filesPath,"pointe.med") + " " + "maa1")
499 testExecfiles.append("test_copie_mesh")
500 rootFileTest.append("mesh")
501 meshTest.append("Mesh 1")
503 argListTest.append(os.path.join(filesPath,"mesh.med") + " " + "'Mesh 1'")
505 testExecfiles.append("test_copie_mesh")
506 rootFileTest.append("maillage_UniSegFam")
507 meshTest.append("maillage_CHEMVAL_100elts")
509 argListTest.append(os.path.join(filesPath,"maillage_UniSegFam.med") + " " + "maillage_CHEMVAL_100elts")
511 testExecfiles.append("test_copie_mesh")
512 rootFileTest.append("carre_en_quad4")
513 meshTest.append("carre_en_quad4")
515 argListTest.append(os.path.join(filesPath,"carre_en_quad4.med") + " " + "carre_en_quad4")
517 testExecfiles.append("test_copie_mesh")
518 rootFileTest.append("cube_hexa8")
519 meshTest.append("CUBE_EN_HEXA8")
521 argListTest.append(os.path.join(filesPath,"cube_hexa8.med") + " " + "CUBE_EN_HEXA8")
523 testExecfiles.append("test_copie_mesh")
524 rootFileTest.append("test19")
525 meshTest.append("maa1")
527 argListTest.append(os.path.join(filesPath,"test19.med") + " " + "maa1")
529 testExecfiles.append("test_copie_mesh")
530 rootFileTest.append("carre_en_quad4_seg2")
531 meshTest.append("carre_en_quad4_seg2")
533 argListTest.append(os.path.join(filesPath,"carre_en_quad4_seg2.med") + " " + "carre_en_quad4_seg2")
535 testExecfiles.append("test_copie_mesh")
536 rootFileTest.append("cube_hexa8_quad4")
537 meshTest.append("CUBE_EN_HEXA8_QUAD4")
539 argListTest.append(os.path.join(filesPath,"cube_hexa8_quad4.med") + " " + "CUBE_EN_HEXA8_QUAD4")
541 testExecfiles.append("test_copie_mesh")
542 rootFileTest.append("pointe")
543 meshTest.append("maa1")
545 argListTest.append(os.path.join(filesPath,"pointe.med") + " " + "maa1")
547 testExecfiles.append("test_copie_support")
548 rootFileTest.append("mesh")
549 meshTest.append("Mesh 1")
551 argListTest.append(os.path.join(filesPath,"mesh.med") + " " + "'Mesh 1'")
553 testExecfiles.append("test_copie_support")
554 rootFileTest.append("maillage_UniSegFam")
555 meshTest.append("maillage_CHEMVAL_100elts")
557 argListTest.append(os.path.join(filesPath,"maillage_UniSegFam.med") + " " + "maillage_CHEMVAL_100elts")
559 testExecfiles.append("test_copie_support")
560 rootFileTest.append("carre_en_quad4")
561 meshTest.append("carre_en_quad4")
563 argListTest.append(os.path.join(filesPath,"carre_en_quad4.med") + " " + "carre_en_quad4")
565 testExecfiles.append("test_copie_support")
566 rootFileTest.append("cube_hexa8")
567 meshTest.append("CUBE_EN_HEXA8")
569 argListTest.append(os.path.join(filesPath,"cube_hexa8.med") + " " + "CUBE_EN_HEXA8")
571 testExecfiles.append("test_copie_support")
572 rootFileTest.append("test19")
573 meshTest.append("maa1")
575 argListTest.append(os.path.join(filesPath,"test19.med") + " " + "maa1")
577 testExecfiles.append("test_copie_support")
578 rootFileTest.append("carre_en_quad4_seg2")
579 meshTest.append("carre_en_quad4_seg2")
581 argListTest.append(os.path.join(filesPath,"carre_en_quad4_seg2.med") + " " + "carre_en_quad4_seg2")
583 testExecfiles.append("test_copie_support")
584 rootFileTest.append("cube_hexa8_quad4")
585 meshTest.append("CUBE_EN_HEXA8_QUAD4")
587 argListTest.append(os.path.join(filesPath,"cube_hexa8_quad4.med") + " " + "CUBE_EN_HEXA8_QUAD4")
589 testExecfiles.append("test_copie_support")
590 rootFileTest.append("pointe")
591 meshTest.append("maa1")
593 argListTest.append(os.path.join(filesPath,"pointe.med") + " " + "maa1")
595 ###############################################################################
597 nbOfTests = len(testExecfiles)
599 print "Running all test programs with several arguments ... total = ",nbOfTests
604 for i in range(nbOfTests):
605 if (rootFileTest[i] == ""):
606 testOutfiles.append(testExecfiles[i] + ".out")
608 if (meshTest[i] == ""):
609 testOutfiles.append(testExecfiles[i]+ "_" + rootFileTest[i] + ".out")
611 if (fieldTest[i] == ""):
612 meshName = string.replace(meshTest[i]," ","_")
613 testOutfiles.append(testExecfiles[i]+ "_" + rootFileTest[i] + "_" + meshName + ".out")
615 meshName = string.replace(meshTest[i]," ","_")
616 fieldName = string.replace(fieldTest[i]," ","_")
617 testOutfiles.append(testExecfiles[i]+ "_" + rootFileTest[i] + "_" + meshName + "_" + fieldName + ".out")
618 testErrfiles.append(testExecfiles[i] + ".err")
620 for i in range(nbOfTests):
621 aCommand = testExecfiles[i] + " " + argListTest[i] + " > " + testOutfiles[i] + " 2> " + testErrfiles[i]
622 status = os.system(aCommand)
624 print "problem with the command ", aCommand
626 print "END of the Pyhton script ..... Ctrl D to exit"