set(TEST tst_QmlTests)
add_test(${TEST} ${XVFB_COMMAND} ${QMLTESTRUNNER}
         -input ${CMAKE_CURRENT_SOURCE_DIR}
         -import ${CMAKE_BINARY_DIR}/lomiri-printing-app/backend)


# Add the qml test files to build dir
set(QMLTEST_FILES
    tst_CheckBoxRow.qml
    tst_LabelRow.qml
    tst_PreviewRow.qml
    tst_PrintRow.qml
    tst_PrintPage.qml
    tst_SelectorRow.qml
    tst_TextFieldRow.qml
)

add_custom_target(qmltest_copyFiles ALL
  COMMENT "Copying files: ${QMLTEST_FILES}")

foreach(FILENAME ${QMLTEST_FILES})
  add_custom_command(
    TARGET qmltest_copyFiles
    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}" "${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}"
    )
endforeach(FILENAME)

# Show in QtC
add_custom_target(qmltest_files ALL SOURCES ${QMLTEST_FILES})
