find_package(Qt5Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED)
add_definitions(-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")

ecm_add_test(stringutiltest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(datatypestest.cpp LINK_LIBRARIES Qt5::Test Qt5::Qml KPim::Itinerary)
ecm_add_test(jsonlddocumenttest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(mergeutiltest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(locationutiltest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(knowledgedbtest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(airportdbtest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(extractorinputtest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(extractorrepositorytest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(berdecodertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(berencodertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(bcbpparsertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(uic9183parsertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(vdvtickettest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(rct2parsertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(jsapitest.cpp ../src/jsapi/jsonld.cpp TEST_NAME jsapitest LINK_LIBRARIES Qt5::Test KPim::Itinerary Qt5::Qml)
ecm_add_test(bitarraytest.cpp ../src/jsapi/bitarray.cpp TEST_NAME bitarraytest LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(structureddataextractortest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(pdfdocumenttest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary Qt5::Gui)
ecm_add_test(htmldocumenttest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(barcodedecodertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary Qt5::Gui)
ecm_add_test(pkpassextractortest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary KPim::PkPass)
ecm_add_test(extractorutiltest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(postprocessortest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(extractorvalidatortest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
if (TARGET KF5::CalendarCore)
    ecm_add_test(calendarhandlertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
    ecm_add_test(extractortest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary KPim::PkPass)
endif()
ecm_add_test(documentutiltest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(filetest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary KPim::PkPass)
