# Due to the use of system() and some unix-style paths this test will only run
# under Linux. (Maybe this can be fixed later)
#
# Moreover, I'm not sure if there is a cvs commandline client for windows
# (need to check this out ...)

if (UNIX)

# Running the test only makes sense if the git command line client
# is present. So check for it before adding the test...
FIND_PROGRAM(HG NAMES hg
	PATHS
	/bin
	/usr/bin
	/usr/local/bin
)

if (HG)

	include_directories( ${KDE4_INCLUDES}
		${CMAKE_SOURCE_DIR}
        ${CMAKE_SOURCE_DIR}/util
        ${CMAKE_SOURCE_DIR}/interfaces
		${CMAKE_SOURCE_DIR}/vcs
		${CMAKE_SOURCE_DIR}/plugins/mercurial
        ${CMAKE_SOURCE_DIR}/vcs/dvcs/
	)
    set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
	set(hgInitTest_SRCS initTest.cpp ${CMAKE_SOURCE_DIR}/vcs/dvcs/dvcsjob.cpp ../hgexecutor.cpp)
    kde4_add_unit_test(kdevhg-test ${hgInitTest_SRCS})
	target_link_libraries(kdevhg-test
		${QT_QTTEST_LIBRARY}
		${KDE4_KDECORE_LIBS}
        kdevplatformutil
        kdevplatformvcs
	)
endif (HG)

endif (UNIX)