From 4594d1bafe835d1fa68e04564528a497d259d7dc Mon Sep 17 00:00:00 2001 From: Samuel Degrande Date: Fri, 25 Mar 2011 12:49:44 +0100 Subject: [PATCH] Removes the addition of the .exe extension to unit-test scripts, on win32. 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 | 1 + tests/conform/Makefile.am | 20 +++++++++++++------- tests/interactive/Makefile.am | 14 ++++++++++---- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 7dfdc63f8..3891670af 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am index b86c9fa41..fa00dc8b9 100644 --- a/tests/conform/Makefile.am +++ b/tests/conform/Makefile.am @@ -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 diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am index 85c1e15bb..5c04bf61e 100644 --- a/tests/interactive/Makefile.am +++ b/tests/interactive/Makefile.am @@ -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