[gegl] tests: Use shell and sed instead of foreach



commit c83875b2f6f4db72e07065231ac63bab8a10e79e
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Thu Oct 17 12:39:38 2013 -0700

    tests: Use shell and sed instead of foreach

 tests/compositions/Makefile.am |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/tests/compositions/Makefile.am b/tests/compositions/Makefile.am
index 67659b2..b83e8a0 100644
--- a/tests/compositions/Makefile.am
+++ b/tests/compositions/Makefile.am
@@ -67,7 +67,9 @@ NO_OPENCL_TESTS = \
   #run-matting-global.xml.sh           
   #run-matting-global-big.xml.sh     
 
-TESTS  = $(foreach basetest,$(BASE_TESTS),$(basetest) $(subst 
$(testprefix),$(opencl_testprefix),$(basetest)))
+OPENCL_TESTS=$(shell for a in $(BASE_TESTS); do echo $$a | sed 's/run-\(.*\)/run-\1 run-opencl-\1/'; done)
+
+TESTS := $(OPENCL_TESTS)
 TESTS += $(NO_OPENCL_TESTS)
 
 # Conditional tests
@@ -93,7 +95,7 @@ $(opencl_testprefix)%.xml.sh: Makefile.am $(call opencl_test_to_xml,$@) $(call o
        echo "mkdir -p $(abs_builddir)/output" >> $@                       ;\
        echo "if [ -a $$out_img ]; then rm $$out_img ; fi" >> $@           ;\
        echo "$(builddir_gegl) $$xml_file -o $$out_img" >> $@              ;\
-       echo GEGL_USE_OPENCL=no "$(builddir_img_cmp) $$ref_img $$out_img" >> $@ ;\
+       echo "GEGL_USE_OPENCL=no $(builddir_img_cmp) $$ref_img $$out_img" >> $@ ;\
        chmod +x $@
 
 test_to_xml = $(abs_srcdir)/$(subst $(testsuffix),,$(subst $(testprefix),,$(1)))
@@ -106,8 +108,8 @@ $(testprefix)%.xml.sh: Makefile.am $(call test_to_xml,$@) $(call test_to_ref,$@)
        echo "#!/bin/bash" > $@                                            ;\
        echo "mkdir -p $(abs_builddir)/output" >> $@                       ;\
        echo "if [ -a $$out_img ]; then rm $$out_img ; fi" >> $@           ;\
-       echo GEGL_USE_OPENCL=no "$(builddir_gegl) $$xml_file -o $$out_img" >> $@  ;\
-       echo GEGL_USE_OPENCL=no "$(builddir_img_cmp) $$ref_img $$out_img" >> $@   ;\
+       echo "GEGL_USE_OPENCL=no $(builddir_gegl) $$xml_file -o $$out_img" >> $@  ;\
+       echo "GEGL_USE_OPENCL=no $(builddir_img_cmp) $$ref_img $$out_img" >> $@   ;\
        chmod +x $@
 
 clean-local:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]