set (SRCS pmltest.cpp)
add_executable(pmltest ${SRCS})
if (PACKAGING_NSIS)
    set(PML_LIBRARIES library_pml ${LIBXML2_LIBRARIES})
else()
    set(PML_LIBRARIES library-pml ${LIBXML2_LIBRARIES})
endif()

target_link_libraries(pmltest ${PML_LIBRARIES})
if (PACKAGING_NSIS)
    add_dependencies(pmltest library_pml)
else()
    add_dependencies(pmltest library-pml)
endif()


#----------
# Testing
#----------
# TODO build one pml file with every tests in it, use it and check that inputFilename-output-pmltest.pml is identical to inputFilename.pml
camitk_init_test(pmltest)
# should pass because lmltest run with no arguments shows usage and exit success
camitk_add_test()
# should pass because reading cube4.pml should not modify it (input == output)
camitk_add_test(EXECUTABLE_ARGS "-i ${CMAKE_CURRENT_SOURCE_DIR}/cube4.pml"
                PASS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cube4.pml )
# should pass because invoking lmltest with a faulty arguments results in printing
# an "Argument error" message (and exit failure)
camitk_add_test(EXECUTABLE_ARGS "-error" PASS_REGULAR_EXPRESSION "Argument errors: ")
