Removes the addition of the .exe extension to unit-test scripts, on win32.
authorSamuel Degrande <samuel.degrande@lifl.fr>
Fri, 25 Mar 2011 11:49:44 +0000 (12:49 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 1 Apr 2011 16:08:25 +0000 (17:08 +0100)
On win32, test scripts are created with a .exe extension.
Under mingw, a .exe script is launched in 16 bit compatibility mode (through
ntvdm), and so it just does not run.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2619

configure.ac
tests/conform/Makefile.am
tests/interactive/Makefile.am

index 7dfdc63..3891670 100644 (file)
@@ -91,6 +91,7 @@ AS_CASE([$host],
         [platform_win32=no]
 )
 AC_MSG_RESULT([$platform_win32])
+AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
 
 AC_SUBST(CLUTTER_LT_VERSION)
 AC_SUBST(CLUTTER_LT_LDFLAGS)
index b86c9fa..fa00dc8 100644 (file)
@@ -86,6 +86,12 @@ units_sources += \
 
 test_conformance_SOURCES = $(common_sources) $(units_sources)
 
+if OS_WIN32
+SHEXT =
+else
+SHEXT = $(EXEEXT)
+endif
+
 # For convenience, this provides a way to easily run individual unit tests:
 .PHONY: wrappers clean-wrappers
 
@@ -113,11 +119,11 @@ stamp-test-conformance: Makefile $(srcdir)/test-conform-main.c
        do \
                unit=`basename $$i | sed -e s/_/-/g`; \
                echo "  GEN    $$unit"; \
-               ( echo "#!/bin/sh" ; echo "$(abs_builddir)/test-launcher.sh '$$i' \"\$$@\"" ) > $$unit$(EXEEXT) ; \
-               ( echo "#!/bin/sh" ; echo "exec $(abs_builddir)/test-conformance$(EXEEXT) -p $$i \"\$$@\"" ) > wrappers/$$unit$(EXEEXT) ; \
-               chmod +x $$unit$(EXEEXT); \
-               chmod +x wrappers/$$unit$(EXEEXT); \
-               echo "/$$unit$(EXEEXT)" >> .gitignore; \
+               ( echo "#!/bin/sh" ; echo "$(abs_builddir)/test-launcher.sh '$$i' \"\$$@\"" ) > $$unit$(SHEXT) ; \
+               ( echo "#!/bin/sh" ; echo "exec $(abs_builddir)/test-conformance$(EXEEXT) -p $$i \"\$$@\"" ) > wrappers/$$unit$(SHEXT) ; \
+               chmod +x $$unit$(SHEXT); \
+               chmod +x wrappers/$$unit$(SHEXT); \
+               echo "/$$unit$(SHEXT)" >> .gitignore; \
        done \
        && echo timestamp > $(@F)
 
@@ -126,8 +132,8 @@ clean-wrappers:
        do \
                unit=`basename $$i | sed -e s/_/-/g`; \
                echo "  RM     $$unit"; \
-               rm -f $$unit$(EXEEXT) ; \
-               rm -f wrappers/$$unit$(EXEEXT) ; \
+               rm -f $$unit$(SHEXT) ; \
+               rm -f wrappers/$$unit$(SHEXT) ; \
        done \
        && rm -f unit-tests \
        && rm -f stamp-test-conformance
index 85c1e15..5c04bf6 100644 (file)
@@ -61,6 +61,12 @@ if X11_TESTS
 UNIT_TESTS += test-pixmap.c test-devices.c
 endif
 
+if OS_WIN32
+SHEXT =
+else
+SHEXT = $(EXEEXT)
+endif
+
 # For convenience, this provides a way to easily run individual unit tests:
 wrappers: stamp-test-interactive
        @true
@@ -77,9 +83,9 @@ stamp-test-interactive: Makefile test-interactive$(EXEEXT)
                echo "  GEN    $$test_bin" ; \
                ( echo "#!/bin/sh" ; \
                  echo "$$wrapper $$test_bin \$$@" \
-               ) > $$test_bin$(EXEEXT) ; \
-               chmod +x $$test_bin$(EXEEXT) ; \
-               echo "/$$test_bin$(EXEEXT)" >> .gitignore ; \
+               ) > $$test_bin$(SHEXT) ; \
+               chmod +x $$test_bin$(SHEXT) ; \
+               echo "/$$test_bin$(SHEXT)" >> .gitignore ; \
        done \
        && echo timestamp > $(@F)
 
@@ -88,7 +94,7 @@ clean-wrappers:
        do \
                test_bin=$${i%*.c} ; \
                echo "  RM    $$test_bin"; \
-               rm -f $$test_bin$(EXEEXT); \
+               rm -f $$test_bin$(SHEXT); \
        done \
        && rm -f stamp-test-interactive