1 from libMEDMEM_Swig import *
5 filesPath=os.environ["MED_ROOT_DIR"]
6 filesPath=filesPath+"/share/salome/resources/"
14 # executables list to test functionalities
16 testExecfiles.append("testUArray")
17 argListTest.append("")
18 rootFileTest.append("")
22 testExecfiles.append("testUCellModel")
23 argListTest.append("")
24 rootFileTest.append("")
28 testExecfiles.append("testUCoordinate")
29 argListTest.append("")
30 rootFileTest.append("")
34 testExecfiles.append("testUGeoNameMeshEntities")
35 argListTest.append("")
36 rootFileTest.append("")
40 testExecfiles.append("testUMedException")
41 argListTest.append("")
42 rootFileTest.append("")
46 testExecfiles.append("testUModulusArray")
47 argListTest.append("")
48 rootFileTest.append("")
52 testExecfiles.append("testUPointerOf")
53 argListTest.append("")
54 rootFileTest.append("")
58 testExecfiles.append("testUSkyLineArray")
59 argListTest.append("")
60 rootFileTest.append("")
64 testExecfiles.append("testUUnit")
65 argListTest.append("")
66 rootFileTest.append("")
70 testExecfiles.append("test_MEDMEM_PolyConnectivity")
71 argListTest.append("")
72 rootFileTest.append("")
76 testExecfiles.append("test_affect_medarray")
77 argListTest.append("")
78 rootFileTest.append("")
82 testExecfiles.append("test_copie_coordinate")
83 argListTest.append("")
84 rootFileTest.append("")
88 testExecfiles.append("test_copie_medarray")
89 argListTest.append("")
90 rootFileTest.append("")
94 testExecfiles.append("test_MEDMEM_Array")
95 argListTest.append("")
96 rootFileTest.append("")
100 testExecfiles.append("test_MEDMEM_CellModel")
101 argListTest.append("")
102 rootFileTest.append("")
106 testExecfiles.append("test_MEDMEM_ModulusArray")
107 argListTest.append("")
108 rootFileTest.append("")
112 testExecfiles.append("test_MEDMEM_PolyhedronArray")
113 argListTest.append("")
114 rootFileTest.append("")
118 testExecfiles.append("test_MEDMEM_SkyLineArray")
119 argListTest.append("")
120 rootFileTest.append("")
124 testExecfiles.append("test_MEDMEM_Meshing")
125 argListTest.append("toto")
126 rootFileTest.append("")
130 testExecfiles.append("test_gibi_driver")
131 rootFileTest.append("Darcy3_3D_H_10x10x10")
132 argListTest.append(filesPath+"Darcy3_3D_H_10x10x10.sauve")
136 testExecfiles.append("test_gibi_driver")
137 rootFileTest.append("dx200_dy1_avec_2couches")
138 argListTest.append(filesPath+"dx200_dy1_avec_2couches.sauve")
142 testExecfiles.append("test_gibi_driver")
143 rootFileTest.append("elle_2D_QT_10x10")
144 argListTest.append(filesPath+"elle_2D_QT_10x10.sauve")
148 testExecfiles.append("test_gibi_driver")
149 rootFileTest.append("elle_2D_QT_2x2")
150 argListTest.append(filesPath+"elle_2D_QT_2x2.sauve")
154 testExecfiles.append("test_gibi_driver")
155 rootFileTest.append("elle_2D_QT_40x40")
156 argListTest.append(filesPath+"elle_2D_QT_40x40.sauve")
160 testExecfiles.append("test_gibi_driver")
161 rootFileTest.append("elle_2D_QT_4x4")
162 argListTest.append(filesPath+"elle_2D_QT_4x4.sauve")
166 testExecfiles.append("test_gibi_driver")
167 rootFileTest.append("elle_3D_HPr_10x10x10")
168 argListTest.append(filesPath+"elle_3D_HPr_10x10x10.sauve")
172 testExecfiles.append("test_gibi_driver")
173 rootFileTest.append("elle_3D_HPr_2x2x2")
174 argListTest.append(filesPath+"elle_3D_HPr_2x2x2.sauve")
178 testExecfiles.append("test_gibi_driver")
179 rootFileTest.append("elle_3D_HPr_4x4x4")
180 argListTest.append(filesPath+"elle_3D_HPr_4x4x4.sauve")
184 testExecfiles.append("test_gibi_driver")
185 rootFileTest.append("inclusion_2d_raf")
186 argListTest.append(filesPath+"inclusion_2d_raf.sauve")
190 testExecfiles.append("test_gibi_driver")
191 rootFileTest.append("inclusion_2d")
192 argListTest.append(filesPath+"inclusion_2d.sauve")
196 testExecfiles.append("test_gibi_driver")
197 rootFileTest.append("mail_ktest1-3-hexa")
198 argListTest.append(filesPath+"mail_ktest1-3-hexa.sauve")
202 testExecfiles.append("test_gibi_driver")
203 rootFileTest.append("mail_ktest1-3-tetra")
204 argListTest.append(filesPath+"mail_ktest1-3-tetra.sauve")
208 testExecfiles.append("test_gibi_driver")
209 rootFileTest.append("mail_ktest3-1")
210 argListTest.append(filesPath+"mail_ktest3-1.sauve")
214 testExecfiles.append("test_gibi_driver")
215 rootFileTest.append("mail_ktest3-2")
216 argListTest.append(filesPath+"mail_ktest3-2.sauve")
220 testExecfiles.append("test_gibi_driver")
221 rootFileTest.append("maillage_andra2_100elts")
222 argListTest.append(filesPath+"maillage_andra2_100elts.sauve")
226 testExecfiles.append("test_gibi_driver")
227 rootFileTest.append("maillage_cas2_2d")
228 argListTest.append(filesPath+"maillage_cas2_2d.sauve")
232 testExecfiles.append("test_gibi_driver")
233 rootFileTest.append("maillage_cas4_234elts")
234 argListTest.append(filesPath+"maillage_cas4_234elts.sauve")
238 testExecfiles.append("test_gibi_driver")
239 rootFileTest.append("maillage_CHEMVAL_100elts")
240 argListTest.append(filesPath+"maillage_CHEMVAL_100elts.sauve")
244 testExecfiles.append("test_gibi_driver")
245 rootFileTest.append("maillage_CHEMVAL_40elts")
246 argListTest.append(filesPath+"maillage_CHEMVAL_40elts.sauve")
250 testExecfiles.append("test_gibi_driver")
251 rootFileTest.append("maillage_chemvalIV_cas1_100elts")
252 argListTest.append(filesPath+"maillage_chemvalIV_cas1_100elts.sauve")
256 testExecfiles.append("test_gibi_driver")
257 rootFileTest.append("maillage_chemvalIV_cas1_40elts")
258 argListTest.append(filesPath+"maillage_chemvalIV_cas1_40elts.sauve")
262 testExecfiles.append("test_gibi_driver")
263 rootFileTest.append("maill_mistra_elim")
264 argListTest.append(filesPath+"maill_mistra_elim.sauve")
268 testExecfiles.append("test_gibi_driver")
269 rootFileTest.append("mail_test1-1-qua")
270 argListTest.append(filesPath+"mail_test1-1-qua.sauve")
274 testExecfiles.append("test_gibi_driver")
275 rootFileTest.append("mail_test1-1-tri")
276 argListTest.append(filesPath+"mail_test1-1-tri.sauve")
280 testExecfiles.append("test_gibi_driver")
281 rootFileTest.append("mail_test1-2-qua")
282 argListTest.append(filesPath+"mail_test1-2-qua.sauve")
286 testExecfiles.append("test_gibi_driver")
287 rootFileTest.append("mail_test1-2-tri")
288 argListTest.append(filesPath+"mail_test1-2-tri.sauve")
292 testExecfiles.append("test_gibi_driver")
293 rootFileTest.append("mail-test1-4-1")
294 argListTest.append(filesPath+"mail-test1-4-1.sauve")
298 testExecfiles.append("test_gibi_driver")
299 rootFileTest.append("mail-test1-4-2")
300 argListTest.append(filesPath+"mail-test1-4-2.sauve")
304 testExecfiles.append("test_porflow_driver")
305 rootFileTest.append("boitenew")
306 argListTest.append(filesPath+"boitenew.inp")
310 testExecfiles.append("test_porflow_driver")
311 rootFileTest.append("Case1")
312 argListTest.append(filesPath+"Case1.inp")
316 testExecfiles.append("test_porflow_driver")
317 rootFileTest.append("cube")
318 argListTest.append(filesPath+"cube.inp")
322 testExecfiles.append("test_porflow_driver")
323 rootFileTest.append("test3")
324 argListTest.append(filesPath+"test3.inp")
328 testExecfiles.append("test_porflow_driver")
329 rootFileTest.append("titi")
330 argListTest.append(filesPath+"titi.inp")
334 testExecfiles.append("test_copie_connectivity")
335 rootFileTest.append("mesh")
336 meshTest.append("Mesh 1")
338 argListTest.append(filesPath+"mesh.med" + " " + "'Mesh 1'")
340 testExecfiles.append("test_copie_connectivity")
341 rootFileTest.append("maillage_UniSegFam")
342 meshTest.append("maillage_CHEMVAL_100elts")
344 argListTest.append(filesPath+"maillage_UniSegFam.med" + " " + "maillage_CHEMVAL_100elts")
346 testExecfiles.append("test_copie_connectivity")
347 rootFileTest.append("carre_en_quad4")
348 meshTest.append("carre_en_quad4")
350 argListTest.append(filesPath+"carre_en_quad4.med" + " " + "carre_en_quad4")
352 testExecfiles.append("test_copie_connectivity")
353 rootFileTest.append("cube_hexa8")
354 meshTest.append("CUBE_EN_HEXA8")
356 argListTest.append(filesPath+"cube_hexa8.med" + " " + "CUBE_EN_HEXA8")
358 testExecfiles.append("test_copie_connectivity")
359 rootFileTest.append("test19")
360 meshTest.append("maa1")
362 argListTest.append(filesPath+"test19.med" + " " + "maa1")
364 testExecfiles.append("test_copie_connectivity")
365 rootFileTest.append("carre_en_quad4_seg2")
366 meshTest.append("carre_en_quad4_seg2")
368 argListTest.append(filesPath+"carre_en_quad4_seg2.med" + " " + "carre_en_quad4_seg2")
370 testExecfiles.append("test_copie_connectivity")
371 rootFileTest.append("cube_hexa8_quad4")
372 meshTest.append("CUBE_EN_HEXA8_QUAD4")
374 argListTest.append(filesPath+"cube_hexa8_quad4.med" + " " + "CUBE_EN_HEXA8_QUAD4")
376 testExecfiles.append("test_copie_connectivity")
377 rootFileTest.append("pointe")
378 meshTest.append("maa1")
380 argListTest.append(filesPath+"pointe.med" + " " + "maa1")
382 testExecfiles.append("test_copie_family")
383 rootFileTest.append("mesh")
384 meshTest.append("Mesh 1")
386 argListTest.append(filesPath+"mesh.med" + " " + "'Mesh 1'")
388 testExecfiles.append("test_copie_family")
389 rootFileTest.append("maillage_UniSegFam")
390 meshTest.append("maillage_CHEMVAL_100elts")
392 argListTest.append(filesPath+"maillage_UniSegFam.med" + " " + "maillage_CHEMVAL_100elts")
394 testExecfiles.append("test_copie_family")
395 rootFileTest.append("carre_en_quad4")
396 meshTest.append("carre_en_quad4")
398 argListTest.append(filesPath+"carre_en_quad4.med" + " " + "carre_en_quad4")
400 testExecfiles.append("test_copie_family")
401 rootFileTest.append("cube_hexa8")
402 meshTest.append("CUBE_EN_HEXA8")
404 argListTest.append(filesPath+"cube_hexa8.med" + " " + "CUBE_EN_HEXA8")
406 testExecfiles.append("test_copie_family")
407 rootFileTest.append("test19")
408 meshTest.append("maa1")
410 argListTest.append(filesPath+"test19.med" + " " + "maa1")
412 testExecfiles.append("test_copie_family")
413 rootFileTest.append("carre_en_quad4_seg2")
414 meshTest.append("carre_en_quad4_seg2")
416 argListTest.append(filesPath+"carre_en_quad4_seg2.med" + " " + "carre_en_quad4_seg2")
418 testExecfiles.append("test_copie_family")
419 rootFileTest.append("cube_hexa8_quad4")
420 meshTest.append("CUBE_EN_HEXA8_QUAD4")
422 argListTest.append(filesPath+"cube_hexa8_quad4.med" + " " + "CUBE_EN_HEXA8_QUAD4")
424 testExecfiles.append("test_copie_family")
425 rootFileTest.append("pointe")
426 meshTest.append("maa1")
428 argListTest.append(filesPath+"pointe.med" + " " + "maa1")
430 testExecfiles.append("test_copie_group")
431 rootFileTest.append("mesh")
432 meshTest.append("Mesh 1")
434 argListTest.append(filesPath+"mesh.med" + " " + "'Mesh 1'")
436 testExecfiles.append("test_copie_group")
437 rootFileTest.append("maillage_UniSegFam")
438 meshTest.append("maillage_CHEMVAL_100elts")
440 argListTest.append(filesPath+"maillage_UniSegFam.med" + " " + "maillage_CHEMVAL_100elts")
442 testExecfiles.append("test_copie_group")
443 rootFileTest.append("carre_en_quad4")
444 meshTest.append("carre_en_quad4")
446 argListTest.append(filesPath+"carre_en_quad4.med" + " " + "carre_en_quad4")
448 testExecfiles.append("test_copie_group")
449 rootFileTest.append("cube_hexa8")
450 meshTest.append("CUBE_EN_HEXA8")
452 argListTest.append(filesPath+"cube_hexa8.med" + " " + "CUBE_EN_HEXA8")
454 testExecfiles.append("test_copie_group")
455 rootFileTest.append("test19")
456 meshTest.append("maa1")
458 argListTest.append(filesPath+"test19.med" + " " + "maa1")
460 testExecfiles.append("test_copie_group")
461 rootFileTest.append("carre_en_quad4_seg2")
462 meshTest.append("carre_en_quad4_seg2")
464 argListTest.append(filesPath+"carre_en_quad4_seg2.med" + " " + "carre_en_quad4_seg2")
466 testExecfiles.append("test_copie_group")
467 rootFileTest.append("cube_hexa8_quad4")
468 meshTest.append("CUBE_EN_HEXA8_QUAD4")
470 argListTest.append(filesPath+"cube_hexa8_quad4.med" + " " + "CUBE_EN_HEXA8_QUAD4")
472 testExecfiles.append("test_copie_group")
473 rootFileTest.append("pointe")
474 meshTest.append("maa1")
476 argListTest.append(filesPath+"pointe.med" + " " + "maa1")
478 testExecfiles.append("test_copie_mesh")
479 rootFileTest.append("mesh")
480 meshTest.append("Mesh 1")
482 argListTest.append(filesPath+"mesh.med" + " " + "'Mesh 1'")
484 testExecfiles.append("test_copie_mesh")
485 rootFileTest.append("maillage_UniSegFam")
486 meshTest.append("maillage_CHEMVAL_100elts")
488 argListTest.append(filesPath+"maillage_UniSegFam.med" + " " + "maillage_CHEMVAL_100elts")
490 testExecfiles.append("test_copie_mesh")
491 rootFileTest.append("carre_en_quad4")
492 meshTest.append("carre_en_quad4")
494 argListTest.append(filesPath+"carre_en_quad4.med" + " " + "carre_en_quad4")
496 testExecfiles.append("test_copie_mesh")
497 rootFileTest.append("cube_hexa8")
498 meshTest.append("CUBE_EN_HEXA8")
500 argListTest.append(filesPath+"cube_hexa8.med" + " " + "CUBE_EN_HEXA8")
502 testExecfiles.append("test_copie_mesh")
503 rootFileTest.append("test19")
504 meshTest.append("maa1")
506 argListTest.append(filesPath+"test19.med" + " " + "maa1")
508 testExecfiles.append("test_copie_mesh")
509 rootFileTest.append("carre_en_quad4_seg2")
510 meshTest.append("carre_en_quad4_seg2")
512 argListTest.append(filesPath+"carre_en_quad4_seg2.med" + " " + "carre_en_quad4_seg2")
514 testExecfiles.append("test_copie_mesh")
515 rootFileTest.append("cube_hexa8_quad4")
516 meshTest.append("CUBE_EN_HEXA8_QUAD4")
518 argListTest.append(filesPath+"cube_hexa8_quad4.med" + " " + "CUBE_EN_HEXA8_QUAD4")
520 testExecfiles.append("test_copie_mesh")
521 rootFileTest.append("pointe")
522 meshTest.append("maa1")
524 argListTest.append(filesPath+"pointe.med" + " " + "maa1")
526 testExecfiles.append("test_copie_support")
527 rootFileTest.append("mesh")
528 meshTest.append("Mesh 1")
530 argListTest.append(filesPath+"mesh.med" + " " + "'Mesh 1'")
532 testExecfiles.append("test_copie_support")
533 rootFileTest.append("maillage_UniSegFam")
534 meshTest.append("maillage_CHEMVAL_100elts")
536 argListTest.append(filesPath+"maillage_UniSegFam.med" + " " + "maillage_CHEMVAL_100elts")
538 testExecfiles.append("test_copie_support")
539 rootFileTest.append("carre_en_quad4")
540 meshTest.append("carre_en_quad4")
542 argListTest.append(filesPath+"carre_en_quad4.med" + " " + "carre_en_quad4")
544 testExecfiles.append("test_copie_support")
545 rootFileTest.append("cube_hexa8")
546 meshTest.append("CUBE_EN_HEXA8")
548 argListTest.append(filesPath+"cube_hexa8.med" + " " + "CUBE_EN_HEXA8")
550 testExecfiles.append("test_copie_support")
551 rootFileTest.append("test19")
552 meshTest.append("maa1")
554 argListTest.append(filesPath+"test19.med" + " " + "maa1")
556 testExecfiles.append("test_copie_support")
557 rootFileTest.append("carre_en_quad4_seg2")
558 meshTest.append("carre_en_quad4_seg2")
560 argListTest.append(filesPath+"carre_en_quad4_seg2.med" + " " + "carre_en_quad4_seg2")
562 testExecfiles.append("test_copie_support")
563 rootFileTest.append("cube_hexa8_quad4")
564 meshTest.append("CUBE_EN_HEXA8_QUAD4")
566 argListTest.append(filesPath+"cube_hexa8_quad4.med" + " " + "CUBE_EN_HEXA8_QUAD4")
568 testExecfiles.append("test_copie_support")
569 rootFileTest.append("pointe")
570 meshTest.append("maa1")
572 argListTest.append(filesPath+"pointe.med" + " " + "maa1")
574 ###############################################################################
576 nbOfTests = len(testExecfiles)
578 print "Running all test programs with several arguments ... total = ",nbOfTests
583 for i in range(nbOfTests):
584 if (rootFileTest[i] == ""):
585 testOutfiles.append(testExecfiles[i] + ".out")
587 if (meshTest[i] == ""):
588 testOutfiles.append(testExecfiles[i]+ "_" + rootFileTest[i] + ".out")
590 if (fieldTest[i] == ""):
591 meshName = string.replace(meshTest[i]," ","_")
592 testOutfiles.append(testExecfiles[i]+ "_" + rootFileTest[i] + "_" + meshName + ".out")
594 meshName = string.replace(meshTest[i]," ","_")
595 fieldName = string.replace(fieldTest[i]," ","_")
596 testOutfiles.append(testExecfiles[i]+ "_" + rootFileTest[i] + "_" + meshName + "_" + fieldName + ".out")
597 testErrfiles.append(testExecfiles[i] + ".err")
599 for i in range(nbOfTests):
600 aCommand = testExecfiles[i] + " " + argListTest[i] + " > " + testOutfiles[i] + " 2> " + testErrfiles[i]
601 status = os.system(aCommand)
603 print "problem with the command ", aCommand
605 print "END of the Pyhton script ..... Ctrl D to exit"