Fix some Python tests not being run in out of source tree builds
When there is just a _runme3.py file and no _runme.py file, out of source builds were not running the script. Currently only applies to python_abstractbase_runme3.py.
This commit is contained in:
parent
3de67de8f0
commit
4930fab5a0
1 changed files with 40 additions and 9 deletions
|
|
@ -156,19 +156,50 @@ run_testcase = \
|
|||
$(run_python);\
|
||||
fi
|
||||
|
||||
# No copying/conversion needed for in-source-tree Python 2 scripts
|
||||
ifeq ($(SCRIPTDIR)|$(SCRIPTSUFFIX),$(srcdir)|$(PY2SCRIPTSUFFIX))
|
||||
convert_testcase =
|
||||
else
|
||||
|
||||
convert_testcase = \
|
||||
# Grab runme file ready for running: copied for out of source tree builds, and/or run 2to3
|
||||
ifeq ($(SCRIPTDIR),$(srcdir))
|
||||
# in source tree build
|
||||
ifeq (,$(PY3))
|
||||
convert_testcase =
|
||||
else
|
||||
convert_testcase = \
|
||||
if [ -f $(srcdir)/$(py2_runme) ]; then \
|
||||
$(MAKE) $(SCRIPTDIR)/$(py_runme); \
|
||||
fi
|
||||
|
||||
$(SCRIPTDIR)/$(SCRIPTPREFIX)%$(SCRIPTSUFFIX): $(srcdir)/$(SCRIPTPREFIX)%$(PY2SCRIPTSUFFIX)
|
||||
test x$< = x$@ || cp $< $@ || exit 1
|
||||
test x$(PY3) = x || $(PY2TO3) -w $@ >/dev/null 2>&1 || exit 1
|
||||
cp $< $@
|
||||
$(PY2TO3) -w $@ >/dev/null 2>&1
|
||||
|
||||
endif
|
||||
else
|
||||
# out of source tree build
|
||||
ifeq (,$(PY3))
|
||||
convert_testcase = \
|
||||
if [ -f $(srcdir)/$(py2_runme) ]; then \
|
||||
$(MAKE) $(SCRIPTDIR)/$(py_runme); \
|
||||
fi
|
||||
|
||||
$(SCRIPTDIR)/$(SCRIPTPREFIX)%$(SCRIPTSUFFIX): $(srcdir)/$(SCRIPTPREFIX)%$(PY2SCRIPTSUFFIX)
|
||||
cp $< $@
|
||||
|
||||
else
|
||||
convert_testcase = \
|
||||
if [ -f $(srcdir)/$(py2_runme) ]; then \
|
||||
$(MAKE) $(SCRIPTDIR)/$(py_runme); \
|
||||
elif [ -f $(srcdir)/$(py3_runme) ]; then \
|
||||
$(MAKE) $(SCRIPTDIR)/$(py3_runme); \
|
||||
fi
|
||||
|
||||
# For when there is a _runme3.py instead of a _runme.py, ie a Python 3 only run test
|
||||
$(SCRIPTDIR)/$(SCRIPTPREFIX)%$(SCRIPTSUFFIX): $(srcdir)/$(SCRIPTPREFIX)%$(PY3SCRIPTSUFFIX)
|
||||
cp $< $@
|
||||
|
||||
$(SCRIPTDIR)/$(SCRIPTPREFIX)%$(SCRIPTSUFFIX): $(srcdir)/$(SCRIPTPREFIX)%$(PY2SCRIPTSUFFIX)
|
||||
cp $< $@
|
||||
$(PY2TO3) -w $@ >/dev/null 2>&1
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
|
|
@ -177,7 +208,7 @@ endif
|
|||
%.clean:
|
||||
@rm -f $*.py
|
||||
@if test -f $(srcdir)/$(py2_runme); then rm -f $(SCRIPTDIR)/$(py3_runme) $(SCRIPTDIR)/$(py3_runme).bak; fi
|
||||
@if test "x$(SCRIPTDIR)" != "x$(srcdir)"; then rm -f $(SCRIPTDIR)/$(py2_runme); fi
|
||||
@if test "x$(SCRIPTDIR)" != "x$(srcdir)"; then rm -f $(SCRIPTDIR)/$(py_runme); fi
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' python_clean
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue