tests: add initial unit test env
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required (VERSION 2.6)
|
cmake_minimum_required (VERSION 2.8)
|
||||||
project (maa)
|
project (maa)
|
||||||
|
|
||||||
set(SWIG_EXECUTABLE /usr/bin/swig)
|
set(SWIG_EXECUTABLE /usr/bin/swig)
|
||||||
@@ -7,6 +7,13 @@ INCLUDE(${SWIG_USE_FILE})
|
|||||||
|
|
||||||
SET(CMAKE_SWIG_FLAGS "")
|
SET(CMAKE_SWIG_FLAGS "")
|
||||||
|
|
||||||
|
option(test "Build all tests." OFF)
|
||||||
|
|
||||||
add_subdirectory (src)
|
add_subdirectory (src)
|
||||||
add_subdirectory (api)
|
add_subdirectory (api)
|
||||||
add_subdirectory (examples)
|
add_subdirectory (examples)
|
||||||
|
|
||||||
|
if (test)
|
||||||
|
enable_testing ()
|
||||||
|
add_subdirectory (tests)
|
||||||
|
endif()
|
||||||
|
|||||||
5
README
5
README
@@ -32,6 +32,11 @@ make
|
|||||||
Install is currently unsuported. Javascript and python modules will be in
|
Install is currently unsuported. Javascript and python modules will be in
|
||||||
build/src/{javascript, python}
|
build/src/{javascript, python}
|
||||||
|
|
||||||
|
=== DEVELOPMENT ===
|
||||||
|
|
||||||
|
Unit tests for all features must be completed prior to implementations, please
|
||||||
|
run `ctest -V` from the build dir in order to see current implementation status
|
||||||
|
|
||||||
=== USING ===
|
=== USING ===
|
||||||
|
|
||||||
see examples/
|
see examples/
|
||||||
|
|||||||
11
tests/CMakeLists.txt
Normal file
11
tests/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
find_package (GTest REQUIRED)
|
||||||
|
|
||||||
|
set(PROJECT_TEST_NAME "${PROJECT_NAME}_test")
|
||||||
|
set(COMMON_INCLUDES ${PROJECT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
|
include_directories(${GTEST_INCLUDE_DIRS} ${COMMON_INCLUDES})
|
||||||
|
|
||||||
|
add_executable(${PROJECT_TEST_NAME} "maa_test.cxx")
|
||||||
|
target_link_libraries(${PROJECT_TEST_NAME} ${PROJECT_NAME_STR} ${GTEST_BOTH_LIBRARIES} maa pthread)
|
||||||
|
|
||||||
|
add_test(Basic ${PROJECT_TEST_NAME})
|
||||||
8
tests/maa_test.cxx
Normal file
8
tests/maa_test.cxx
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include "maa.h"
|
||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
using namespace maa;
|
||||||
|
|
||||||
|
TEST (basic, GetVersion) {
|
||||||
|
ASSERT_EQ(get_version(), 1);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user