diff --git a/CMakeLists.txt b/CMakeLists.txt index 8760398..2b14c66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,6 +205,8 @@ endif() add_subdirectory(module/webdav) add_subdirectory(test/test_child) add_dependencies(kangle khttpd) +include(CTest) +add_test(NAME "test_kangle" COMMAND test/test.sh) set(CPACK_SOURCE_IGNORE_FILES "${PROJECT_BINARY_DIR};/.git/;.gitignore;/.vscode;/var;/test/bin;/test/cache;/test/var;/test/tmp;/test/ext;/test/webadmin") install(TARGETS kangle RUNTIME DESTINATION bin diff --git a/test/test.sh b/test/test.sh index 65230cf..2ef944b 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1,10 +1,9 @@ #!/bin/sh -if [ ! -d ext ] ; then - mkdir ext -fi -cp -a ../webadmin . -if [ ! -f ./bin/main.exe ] ; then - echo "please call ./build.sh first" +BIN_FILE=$(readlink -f $0) +PROJECT_PATH=$(dirname $BIN_FILE) +cp -a $PROJECT_PATH/../webadmin $PROJECT_PATH +if [ ! -f $PROJECT_PATH/bin/main.exe ] ; then + echo "please call $PROJECT_PATH/build.sh first" exit 1 fi -./bin/main.exe -e ../build -m=true +$PROJECT_PATH/bin/main.exe -e $PROJECT_PATH/../build -m=true