From 11b5912d1283d89b440b5eee62d8bb7655015fa1 Mon Sep 17 00:00:00 2001 From: Eric Fayolle Date: Thu, 31 Mar 2022 23:37:40 +0200 Subject: [PATCH] =?utf8?q?Gestion=20de=20la=20g=C3=A9n=C3=A9ration=20de=20?= =?utf8?q?.comm=20=C3=A0=20partir=20de=20.xml=20dans=20le=20GNUmakefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ReacteurNumerique/GNUmakefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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 -- 2.39.2