From ba5cd5ee450df11e217a1d9232af25a39aaeaa7f Mon Sep 17 00:00:00 2001 From: Oneplus Date: Thu, 21 Mar 2013 19:49:17 +0800 Subject: [PATCH] make auto-test script generate during the compiling stage --- CMakeLists.txt | 5 +++++ script/auto-test.sh => tools/auto-test.sh.in | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) rename script/auto-test.sh => tools/auto-test.sh.in (77%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7a02a345..6563b2fb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set (INCLUDE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/include) # -- config source directories set (SOURCE_DIR ${PROJECT_SOURCE_DIR}/src) set (THIRDPARTY_DIR ${PROJECT_SOURCE_DIR}/thirdparty) +set (SCRIPT_DIR ${PROJECT_SOURCE_DIR}/script) # -- config resource directories set (CONFIGURE_DIR ${PROJECT_SOURCE_DIR}/conf) @@ -31,6 +32,10 @@ configure_file ( ${CONFIGURE_DIR}/ltp_all_modules.conf.in ${EXECUTABLE_OUTPUT_PATH}/ltp_all_modules.conf) +configure_file ( + ${SCRIPT_DIR}/auto-test.sh.in + ${EXECUTABLE_OUTPUT_PATH}/auto-test.sh) + # enable test enable_testing() diff --git a/script/auto-test.sh b/tools/auto-test.sh.in similarity index 77% rename from script/auto-test.sh rename to tools/auto-test.sh.in index 476e6998c..3c9926957 100755 --- a/script/auto-test.sh +++ b/tools/auto-test.sh.in @@ -1,9 +1,8 @@ #!/bin/sh -SCRIPT_DIR=`pwd` -ROOT_DIR=$SCRIPT_DIR/.. -BIN_DIR=$ROOT_DIR/bin -DATA_DIR=$ROOT_DIR/test_data +ROOT_DIR=${PROJECT_SOURCE_DIR} +BIN_DIR=${EXECUTABLE_OUTPUT_PATH} +DATA_DIR=${DATA_DIR} EXE=./ltp_test OPT=all