From: Eric Fayolle Date: Thu, 31 Mar 2022 21:37:40 +0000 (+0200) Subject: Gestion de la génération de .comm à partir de .xml dans le GNUmakefile X-Git-Tag: merge_uncertainty_odysee_1210~103 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=11b5912d1283d89b440b5eee62d8bb7655015fa1;p=tools%2Feficas.git Gestion de la génération de .comm à partir de .xml dans le GNUmakefile --- diff --git a/ReacteurNumerique/GNUmakefile b/ReacteurNumerique/GNUmakefile index d687de5e..ae5190fc 100644 --- a/ReacteurNumerique/GNUmakefile +++ b/ReacteurNumerique/GNUmakefile @@ -79,9 +79,9 @@ driverAll: exec.sh environ.sh qtEficas.sh $(driver_files) define test_xml_rule = %_test_driver_$1.xml : %_test_driver_$1.comm $$(realpath $$(*).py) - echo -e "\n\n------ $$(*)_driver.py ----------\n" @echo -e "\n\n------ Generate xml test file $$(@) ------\n" @[[ -f $$(*).py ]] || (echo "Le fichier catalogue $$(*).py est introuvable" && false) + @[[ -f $$(*)_driver.py ]] || (echo "Le fichier driver $$(*)_driver.py est introuvable" && false) $(tooldir)/generateXML.py -c $$(abspath $$(*).py) $$< endef @@ -96,17 +96,27 @@ define test_driver_rule = chmod +x $$(<:%.comm=%.py); endef +define test_comm_rule = +%_test_driver_$1_modified.comm : %_test_driver_$1.xml + @echo -e "\n\n------ Generate modified.comm file $$(@) ------\n" + @[[ -f $$(*).py ]] || (echo "Le fichier catalogue $$(*).py est introuvable" && false) + @[[ -f $$(*)_driver.py ]] || (echo "Le fichier driver $$(*)_driver.py est introuvable" && false) + $(tooldir)/generateComm.py -x -c $$(abspath $$(*).py) -o $$(@) $$< +endef + #Définition des règles de construction pour les tests #$(eval $(call test_driver_rule,0)) #$(eval $(call test_driver_rule,1)) $(foreach it,0 1 2 3 4 5 6 7 8 9, $(eval $(call test_xml_rule,$(it))) ) $(foreach it,0 1 2 3 4 5 6 7 8 9, $(eval $(call test_driver_rule,$(it))) ) +$(foreach it,0 1 2 3 4 5 6 7 8 9, $(eval $(call test_comm_rule,$(it))) ) #test_driver_xml:= $(patsubst %.comm,%.xml,$(wildcard *_test_driver_?.comm)) #test_driver_py:= $(patsubst %.comm,%.py,$(wildcard *_test_driver_?.comm)) new_test_driver_xml:= $(foreach it,$(cata_basename), $(patsubst %.comm,%.xml,$(wildcard $(it)_test_driver_?.comm)) ) new_test_driver_py:= $(foreach it,$(cata_basename), $(patsubst %.comm,%.py,$(wildcard $(it)_test_driver_?.comm)) ) +new_test_driver_comm:= $(foreach it,$(cata_basename), $(patsubst %.comm,%_modified.comm,$(wildcard $(it)_test_driver_?.comm)) ) #$(info $(new_test_driver_xml) "----" $(cata_basename) ) #$(info $(new_test_driver_py) "----" $(cata_basename) ) @@ -119,7 +129,7 @@ check test: testAll ################# REGLES DE TESTS ######################## -testAll: exec.sh driverAll $(new_test_driver_py) $(new_test_driver_xml) +testAll: exec.sh driverAll $(new_test_driver_py) $(new_test_driver_xml) $(new_test_driver_comm) for i in $(new_test_driver_py) ; do echo -e "\n\n------ Launching $$i ------" && ./exec.sh python3 $$i ; done # for i in `ls *_test_driver*.py` ; do echo -e "\n\n------ Launching $$i ------" && ./exec.sh python $$i || break ; done @@ -128,8 +138,8 @@ testAll: exec.sh driverAll $(new_test_driver_py) $(new_test_driver_xml) clean: rm -f *.pyc *~ qtEficas.sh exec.sh environ.sh rm -rf raw binding.py __pycache__ - rm -f $(xsd_files) $(driver_files) *test_driver_?.py *test_driver_?.xml + rm -f $(xsd_files) $(driver_files) *test_driver_?.py *test_driver_?.xml *test_driver_?_modified.comm cleantest: - rm -f *test_driver_?.py *test_driver_?.xml + rm -f *test_driver_?.py *test_driver_?.xml *test_driver_?_modified.comm