1
0
mirror of https://github.com/thp/pyotherside.git synced 2025-01-17 23:22:53 +08:00
pyotherside/pyotherside.pro

24 lines
679 B
Prolog
Raw Normal View History

2013-08-07 21:47:24 +02:00
TEMPLATE = subdirs
Test call_sync with one parameter Introduce qtquicktests/ with a single test. This allows us to write tests entirely in QML with no C++ component. The single test tests for regressions in issue #49. The qtquicktests framework (supplied by QT/QML upstream) provides only a template expansion that provides a main() function. Therefore, we must generate a new binary as the shim for running the tests, as the public API mechanism doesn't allow us to generate a single binary with the two backends. As qmake supports only one binary per directory (without getting really hacky), we must add a new directory for it. Perhaps now the tests/ directory should be renamed to cpptests/ or something for clarity. Unfortunately "make check" doesn't work, so I've provided a "./run" wrapper you can run manually from inside the qtquicktests/ directory for now. This is because qtquicktests appears to have been designed to test QML apps, not plugins. This isn't much of a problem, except that the test runner is unable to find the in-tree built plugin. The generated binary does support a "-plugins <directory>" option, but it seems to be impossible to get "make check" to use it: * The qmake extension supports an INCLUDESPATH to add a "-includes <directory> option, but no equivalent PLUGINSPATH. * Even though qtquicktests reports "." as being in the plugins path after a failure, it does not appear to actually look there, so symlinking or copying the plugin in to the current directory doesn't work. * qmltestcase.prf uses testcase.prf which allows TESTARGS to be added. However, it reads this from the environment (a Makefile variable) rather than from a qmake variable. There appears to be no way of exporting a Makefile variable from a .pro file (unless its name is to start with EXPORT_). See http://stackoverflow.com/q/35554105/478206. * Copying and modifying mysqltestcase.prf from /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/ to add a PLUGINSPATH configurable option does work, but then you have to run qmake with "QMAKEFEATURES=. qmake" since even though it is documented to look in the project root, that doesn't work (I tried both the top level and inside qtquicktests/). So I gave up trying to get "make check" to work, and resorted to a wrapper around calling qtquicktests with the correct options, which at least works for now.
2017-01-03 20:20:22 +00:00
SUBDIRS += src tests qtquicktests
tests.depends = src
include(pyotherside.pri)
!win32 {
# The make used in the Qt MSVC toolchain does not support $^, but
# as we are not going to do source builds on Windows, just make
# the source release (sdist) target depend on anything but win32.
tar.target = $${PROJECTNAME}-$${VERSION}.tar
tar.commands = git archive --format=tar --prefix=$${PROJECTNAME}-$${VERSION}/ --output=$@ $${VERSION}
targz.target = $${PROJECTNAME}-$${VERSION}.tar.gz
targz.depends = tar
targz.commands = gzip $^
sdist.target = sdist
sdist.depends = targz
QMAKE_EXTRA_TARGETS += tar targz sdist
}