CMakeLists.txt 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. cmake_minimum_required(VERSION 2.8)
  2. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test)
  3. # Setup testing
  4. enable_testing()
  5. find_package(GTest REQUIRED)
  6. find_package(GMock REQUIRED)
  7. find_program(SHELL bash)
  8. include_directories(${Boost_INCLUDE_DIR} ${JSONCPP_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
  9. # Add test cpp file
  10. add_executable(cmdman_test test/cmdman_test.cpp src/cmdman.cpp src/fileman.cpp src/base64.cpp)
  11. target_link_libraries(cmdman_test ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${JSONCPP_LIBRARIES} ${GMOCK_LIBRARIES} ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
  12. add_executable(cryptotest_gcm test/cryptotest_gcm.c)
  13. target_link_libraries(cryptotest_gcm ${OPENSSL_LIBRARIES})
  14. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/samplekey1.bin ${CMAKE_BINARY_DIR}/test/samplekey1.bin COPYONLY)
  15. add_test(logintest_pos ${SHELL} ${CMAKE_BINARY_DIR}/test/logintest_pos.sh)
  16. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/logintest_pos.sh ${CMAKE_BINARY_DIR}/test/logintest_pos.sh COPYONLY)
  17. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/logintest_pos.txt ${CMAKE_BINARY_DIR}/test/logintest_pos.txt COPYONLY)
  18. add_test(logintest_neg ${SHELL} ${CMAKE_BINARY_DIR}/test/logintest_neg.sh)
  19. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/logintest_neg.sh ${CMAKE_BINARY_DIR}/test/logintest_neg.sh COPYONLY)
  20. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/logintest_neg.txt ${CMAKE_BINARY_DIR}/test/logintest_neg.txt COPYONLY)
  21. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/samplefile.txt ${CMAKE_BINARY_DIR}/test/samplefile.txt COPYONLY)
  22. add_test(cryptoput ${SHELL} ${CMAKE_BINARY_DIR}/test/cryptoput.sh)
  23. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/cryptoput.sh ${CMAKE_BINARY_DIR}/test/cryptoput.sh COPYONLY)
  24. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/cryptoput.txt ${CMAKE_BINARY_DIR}/test/cryptoput.txt COPYONLY)
  25. add_test(cryptoget ${SHELL} ${CMAKE_BINARY_DIR}/test/cryptoget.sh)
  26. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/cryptoget.sh ${CMAKE_BINARY_DIR}/test/cryptoget.sh COPYONLY)
  27. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/cryptoget.txt ${CMAKE_BINARY_DIR}/test/cryptoget.txt COPYONLY)
  28. add_test(
  29. NAME cmdman_test
  30. COMMAND cmdman_test
  31. )