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
This commit is contained in:
Samuel Degrande 2011-03-25 12:49:44 +01:00 committed by Emmanuele Bassi
parent 564765c45c
commit 4594d1bafe
3 changed files with 24 additions and 11 deletions

View File

@ -91,6 +91,7 @@ AS_CASE([$host],
[platform_win32=no] [platform_win32=no]
) )
AC_MSG_RESULT([$platform_win32]) AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
AC_SUBST(CLUTTER_LT_VERSION) AC_SUBST(CLUTTER_LT_VERSION)
AC_SUBST(CLUTTER_LT_LDFLAGS) AC_SUBST(CLUTTER_LT_LDFLAGS)

View File

@ -86,6 +86,12 @@ units_sources += \
test_conformance_SOURCES = $(common_sources) $(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: # For convenience, this provides a way to easily run individual unit tests:
.PHONY: wrappers clean-wrappers .PHONY: wrappers clean-wrappers
@ -113,11 +119,11 @@ stamp-test-conformance: Makefile $(srcdir)/test-conform-main.c
do \ do \
unit=`basename $$i | sed -e s/_/-/g`; \ unit=`basename $$i | sed -e s/_/-/g`; \
echo " GEN $$unit"; \ echo " GEN $$unit"; \
( echo "#!/bin/sh" ; echo "$(abs_builddir)/test-launcher.sh '$$i' \"\$$@\"" ) > $$unit$(EXEEXT) ; \ ( 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$(EXEEXT) ; \ ( echo "#!/bin/sh" ; echo "exec $(abs_builddir)/test-conformance$(EXEEXT) -p $$i \"\$$@\"" ) > wrappers/$$unit$(SHEXT) ; \
chmod +x $$unit$(EXEEXT); \ chmod +x $$unit$(SHEXT); \
chmod +x wrappers/$$unit$(EXEEXT); \ chmod +x wrappers/$$unit$(SHEXT); \
echo "/$$unit$(EXEEXT)" >> .gitignore; \ echo "/$$unit$(SHEXT)" >> .gitignore; \
done \ done \
&& echo timestamp > $(@F) && echo timestamp > $(@F)
@ -126,8 +132,8 @@ clean-wrappers:
do \ do \
unit=`basename $$i | sed -e s/_/-/g`; \ unit=`basename $$i | sed -e s/_/-/g`; \
echo " RM $$unit"; \ echo " RM $$unit"; \
rm -f $$unit$(EXEEXT) ; \ rm -f $$unit$(SHEXT) ; \
rm -f wrappers/$$unit$(EXEEXT) ; \ rm -f wrappers/$$unit$(SHEXT) ; \
done \ done \
&& rm -f unit-tests \ && rm -f unit-tests \
&& rm -f stamp-test-conformance && rm -f stamp-test-conformance

View File

@ -61,6 +61,12 @@ if X11_TESTS
UNIT_TESTS += test-pixmap.c test-devices.c UNIT_TESTS += test-pixmap.c test-devices.c
endif endif
if OS_WIN32
SHEXT =
else
SHEXT = $(EXEEXT)
endif
# For convenience, this provides a way to easily run individual unit tests: # For convenience, this provides a way to easily run individual unit tests:
wrappers: stamp-test-interactive wrappers: stamp-test-interactive
@true @true
@ -77,9 +83,9 @@ stamp-test-interactive: Makefile test-interactive$(EXEEXT)
echo " GEN $$test_bin" ; \ echo " GEN $$test_bin" ; \
( echo "#!/bin/sh" ; \ ( echo "#!/bin/sh" ; \
echo "$$wrapper $$test_bin \$$@" \ echo "$$wrapper $$test_bin \$$@" \
) > $$test_bin$(EXEEXT) ; \ ) > $$test_bin$(SHEXT) ; \
chmod +x $$test_bin$(EXEEXT) ; \ chmod +x $$test_bin$(SHEXT) ; \
echo "/$$test_bin$(EXEEXT)" >> .gitignore ; \ echo "/$$test_bin$(SHEXT)" >> .gitignore ; \
done \ done \
&& echo timestamp > $(@F) && echo timestamp > $(@F)
@ -88,7 +94,7 @@ clean-wrappers:
do \ do \
test_bin=$${i%*.c} ; \ test_bin=$${i%*.c} ; \
echo " RM $$test_bin"; \ echo " RM $$test_bin"; \
rm -f $$test_bin$(EXEEXT); \ rm -f $$test_bin$(SHEXT); \
done \ done \
&& rm -f stamp-test-interactive && rm -f stamp-test-interactive