Skip to content

Commit

Permalink
[fix] in test/CMakeLists.txt exmaples => examples, adjust autotest sc…
Browse files Browse the repository at this point in the history
…ripts
  • Loading branch information
Oneplus committed Nov 12, 2014
1 parent bb6d225 commit e97b07d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 46 deletions.
56 changes: 11 additions & 45 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ include_directories (./
${THIRDPARTY_DIR}/tinyxml)

set (ltp_test_SRC ltp_test.cpp)
set (multi_ltp_test_SRC multi_ltp_test.cpp
set (multi_ltp_test_SRC multi_ltp_test.cpp
${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp)
#set (ltp_test_xml_SRC ltp_test_xml.cpp)
#set (ltp_test2_SRC ltp_test2.cpp)

link_directories ( ${LIBRARY_OUTPUT_PATH} )

set (ltp_test_LIBS
set (ltp_test_LIBS
maxent_static_lib
util_static_lib
ltp
Expand All @@ -38,27 +38,25 @@ add_executable (ltp_test ${ltp_test_SRC})
target_link_libraries (ltp_test ${ltp_test_LIBS})

add_executable (cws_cmdline cws_cmdline.cpp)
target_link_libraries (cws_cmdline segmentor_static_lib
target_link_libraries (cws_cmdline segmentor_static_lib
boost_regex_static_lib)
set_target_properties(cws_cmdline PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/exmaples/)
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/examples/)

add_executable (pos_cmdline pos_cmdline.cpp)
target_link_libraries (pos_cmdline postagger_static_lib)
set_target_properties(pos_cmdline PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/exmaples/)
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/examples/)

add_executable (par_cmdline par_cmdline.cpp)
target_link_libraries (par_cmdline parser_static_lib)
set_target_properties(par_cmdline PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/exmaples/)
#add_executable (ltp_test_xml ${ltp_test_xml_SRC})
#add_executable (ltp_test2 ${ltp_test2_SRC})
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/examples/)

#
# --------------------------------------------------
# multithreaded ltp test is not supported in Windows
#
if (UNIX)
# --------------------------------------------------
if (UNIX)
add_executable (multi_ltp_test ${multi_ltp_test_SRC})
target_link_libraries (multi_ltp_test ${ltp_test_LIBS} pthread)

Expand All @@ -68,47 +66,15 @@ target_link_libraries (multi_cws_cmdline segmentor_static_lib
boost_regex_static_lib
pthread)
set_target_properties(multi_cws_cmdline PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/exmaples/)
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/examples/)

add_executable (multi_pos_cmdline multi_pos_cmdline.cpp
${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp)
target_link_libraries (multi_pos_cmdline postagger_static_lib pthread)
set_target_properties(multi_pos_cmdline PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/exmaples/)
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/examples/)
endif()

#target_link_libraries (ltp_test2
# maxent
# crfpp
# util
# ltp
# splitsnt
# crfwordseg
# postagger
# gparser
# ner
# srl
# xml4nlp
# dl
# pthread
# boost_regex)

#target_link_libraries (ltp_test_xml
# maxent
# crfpp
# util
# ltp
# splitsnt
# crfwordseg
# postagger
# gparser
# ner
# srl
# xml4nlp
# dl
# pthread
# boost_regex)

#add_test (NAME ltp_test
# COMMAND "${CMAKE_COMMAND}"
# -DTEST_PROG=${EXECUTABLE_TEST_OUTPUT}
Expand Down
2 changes: 1 addition & 1 deletion tools/autotest/autotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def callgrind_check(rootdir, outputdir, input_path, verbose=False):

def speed_check(rootdir, outputdir, input_path, verbose=False):
def build(exe_prefix, model_prefix):
exe = os.path.join(rootdir, "examples", ("%s_cmdline" % exe_prefix))
exe = os.path.join(rootdir, "bin", "examples", ("%s_cmdline" % exe_prefix))
model = os.path.join(rootdir, "ltp_data", ("%s.model" % model_prefix))
out = "/tmp/ltp.autotest.%s.out" % exe_prefix
return (exe, model, out)
Expand Down

0 comments on commit e97b07d

Please sign in to comment.