Introduce basic tests for python tools 51/76251/5
authorJames Harrison <00jamesh@gmail.com>
Tue, 4 Apr 2017 12:49:11 +0000 (13:49 +0100)
committerDave Rigby <daver@couchbase.com>
Fri, 7 Apr 2017 11:17:37 +0000 (11:17 +0000)
Adds tests which run cbstats and cbepctl to confirm they are both
valid Python 2.6 code. These are /very/ minimal tests, and essentially
test only for correct syntax and resonable functioning of the "--help"
code path. They do not assert anything beyond syntactic correctness for
code outside this coverage.

Change-Id: I89a991c972fef30a881e3b278507cac4d0df62af
Reviewed-on: http://review.couchbase.org/76251
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
CMakeLists.txt

index 8c5c586..81ebaed 100644 (file)
@@ -97,6 +97,18 @@ CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvbucketctl)
 
+SET(Python_ADDITIONAL_VERSIONS 2.6)
+FIND_PACKAGE(PythonInterp)
+
+# to avoid cluttering source dir with name + "c" files
+SET(ENV{PYTHONDONTWRITEBYTECODE} 1)
+
+# runs cbstats & cbepctl - will fail on basic syntax errors
+ADD_TEST(cbstats_test ${PYTHON_EXECUTABLE}
+        ${CMAKE_CURRENT_SOURCE_DIR}/management/cbstats --help)
+ADD_TEST(cbepctl_test ${PYTHON_EXECUTABLE}
+        ${CMAKE_CURRENT_SOURCE_DIR}/management/cbepctl --help)
+
 IF (WIN32)
    INCLUDE_DIRECTORIES(AFTER ${CMAKE_SOURCE_DIR}/platform/include/win32)
 ENDIF (WIN32)