diff options
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | debian/control | 1 | ||||
-rwxr-xr-x | debian/rules | 2 | ||||
-rw-r--r-- | tests/client/CMakeLists.txt | 1 |
4 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 261335a..d22194c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,16 @@ endif() add_subdirectory(libqmenumodel) # Tests Tools +set(XVFB_EXEC "") +option(USE_XVFB "Uses xvfb-run with the unit tests to avoid QtWidgets tests fails without X." FALSE) +if(USE_XVFB) + find_program(XVFB_RUN NAMES xvfb-run) + if (NOT ${XVFB_RUN} MATCHES "XVFB_RUN-NOTFOUND") + set(XVFB_EXEC ${XVFB_RUN} -a) + message(STATUS "Using xvfb-run to perform QtWidget tests.") + endif() +endif() + if(NOT DBUS_RUNNER) message(STATUS "dbus-test-runner not found tests disabled.") else() diff --git a/debian/control b/debian/control index 2a2e8d9..e4e9d1c 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,7 @@ Build-Depends: debhelper (>= 9.0.0), dbus-test-runner, libgles2-mesa-dev, libgl-dev, + xvfb, Standards-Version: 3.9.3 Package: libqmenumodel0 diff --git a/debian/rules b/debian/rules index 2364c9f..366a447 100755 --- a/debian/rules +++ b/debian/rules @@ -5,7 +5,7 @@ #export DH_VERBOSE=1 override_dh_auto_configure: - PATH=/opt/qt5/bin:${PATH} dh_auto_configure + PATH=/opt/qt5/bin:${PATH} dh_auto_configure -- -DUSE_XVFB=On override_dh_makeshlibs: dh_makeshlibs -Xlibqmenumodel-qml.so diff --git a/tests/client/CMakeLists.txt b/tests/client/CMakeLists.txt index 9bce370..9209cc8 100644 --- a/tests/client/CMakeLists.txt +++ b/tests/client/CMakeLists.txt @@ -9,6 +9,7 @@ macro(declare_test testname) )
add_test(${testname}
+ ${XVFB_EXEC}
${DBUS_RUNNER}
--task ${CMAKE_CURRENT_BINARY_DIR}/${testname} --task-name Client
--task ${CMAKE_CURRENT_SOURCE_DIR}/script_${testname}.py --task-name Server
|