move test utils to libkmstest library
authorTomi Valkeinen <tomi.valkeinen@iki.fi>
Thu, 1 Oct 2015 18:44:49 +0000 (21:44 +0300)
committerTomi Valkeinen <tomi.valkeinen@iki.fi>
Thu, 1 Oct 2015 18:44:49 +0000 (21:44 +0300)
16 files changed:
CMakeLists.txt
libkms++/CMakeLists.txt
libkmstest/CMakeLists.txt [new file with mode: 0644]
libkmstest/color.cpp [moved from libkms++/utils/color.cpp with 100% similarity]
libkmstest/color.h [moved from libkms++/utils/color.h with 100% similarity]
libkmstest/conv.cpp [moved from libkms++/utils/conv.cpp with 100% similarity]
libkmstest/conv.h [moved from libkms++/utils/conv.h with 100% similarity]
libkmstest/testpat.cpp [moved from libkms++/utils/testpat.cpp with 100% similarity]
libkmstest/testpat.h [moved from libkms++/utils/testpat.h with 100% similarity]
lua/CMakeLists.txt
lua/luakms.i
py/CMakeLists.txt
py/pykms.i
tests/CMakeLists.txt
tests/db.cpp
tests/testpat.cpp

index 8a20996a77a9e2c5603ab11893715a5b5bd6b01c..559ba13b27f863b7203fbbfc7d58dc0393ede8d6 100644 (file)
@@ -23,6 +23,7 @@ pkg_check_modules(LIBDRM libdrm REQUIRED)
 enable_testing()
 
 add_subdirectory(libkms++)
+add_subdirectory(libkmstest)
 add_subdirectory(tests)
 
 if(LIBKMS_ENABLE_PYTHON)
index e8d14f7d978d11960edd79c94317b4a1116984a1..c8747784c2065f687a5d92ca855c0f18d7bca7c5 100644 (file)
@@ -1,7 +1,7 @@
 include_directories(${LIBDRM_INCLUDE_DIRS})
 link_directories(${LIBDRM_LIBRARY_DIRS})
 
-file(GLOB SRCS "*.cpp" "*.h" "utils/*.cpp" "utils/*.h")
+file(GLOB SRCS "*.cpp" "*.h")
 add_library(kms++ ${SRCS})
 
 target_include_directories(kms++ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/libkmstest/CMakeLists.txt b/libkmstest/CMakeLists.txt
new file mode 100644 (file)
index 0000000..55d31ae
--- /dev/null
@@ -0,0 +1,8 @@
+include_directories(${LIBDRM_INCLUDE_DIRS})
+link_directories(${LIBDRM_LIBRARY_DIRS})
+
+file(GLOB SRCS "*.cpp" "*.h")
+add_library(kmstest ${SRCS})
+
+target_link_libraries(kmstest kms++ ${LIBDRM_LIBRARIES})
+target_include_directories(kmstest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
similarity index 100%
rename from libkms++/utils/color.h
rename to libkmstest/color.h
similarity index 100%
rename from libkms++/utils/conv.cpp
rename to libkmstest/conv.cpp
similarity index 100%
rename from libkms++/utils/conv.h
rename to libkmstest/conv.h
index ba70561abc54c5e28e5066c0a1bbdd52e29abbbe..584648da0f16d07f88158b78d03634d4009bb409 100644 (file)
@@ -9,12 +9,11 @@ pkg_search_module(LUA REQUIRED lua5.2 lua)
 include_directories(${LUA_INCLUDE_DIRS})
 link_directories(${LUA_LIBRARY_DIRS})
 
-#include_directories(libkms)
-#XXX
-include_directories(../libkms++)
+# XXX how to add these inc dirs in a proper way?
+include_directories(../libkms++ ../libkmstest)
 
 set_source_files_properties(luakms.i PROPERTIES CPLUSPLUS ON)
 swig_add_module(luakms lua luakms.i)
-swig_link_libraries(luakms kms++ ${LIBDRM_LIBRARIES} ${LUA_LIBRARIES})
+swig_link_libraries(luakms kms++ kmstest ${LIBDRM_LIBRARIES} ${LUA_LIBRARIES})
 
 add_custom_target(luaextras SOURCES test.lua)
index 2920c46de6ea9a54278602b3ecb324096ffe4b5e..0b878572e1b5e15dc682da1fa498dec569f36fe2 100644 (file)
@@ -1,7 +1,9 @@
 %module libluakms
 %{
 #include "kms++.h"
-#include "utils/testpat.h"
+
+#include "testpat.h"
+
 using namespace kms;
 %}
 
@@ -18,4 +20,5 @@ using namespace kms;
 %include "plane.h"
 %include "connector.h"
 %include "encoder.h"
-%include "utils/testpat.h"
+
+%include "testpat.h"
index 39e6ec68d57e7f85f8ff1d0a30463d1b2f0c847f..8ad476b2ce9be54dcc1629a00543e2043a418326 100644 (file)
@@ -8,15 +8,14 @@ link_directories(${LIBDRM_LIBRARY_DIRS})
 pkg_check_modules(PYTHON python-3.4 REQUIRED)
 include_directories(${PYTHON_INCLUDE_DIRS})
 
-#include_directories(libkms)
-#XXX
-include_directories(../libkms++)
+# XXX how to add these inc dirs in a proper way?
+include_directories(../libkms++ ../libkmstest)
 
 #set(CMAKE_SWIG_FLAGS "-I../../libkms")
 
 set_source_files_properties(pykms.i PROPERTIES CPLUSPLUS ON)
 swig_add_module(pykms python pykms.i)
-swig_link_libraries(pykms kms++ ${LIBDRM_LIBRARIES} ${PYTHON_LIBRARIES})
+swig_link_libraries(pykms kms++ kmstest ${LIBDRM_LIBRARIES} ${PYTHON_LIBRARIES})
 
 add_custom_target(pyextras SOURCES test.py functest.py)
 
index b9d61df7b9cdd41c4ca67c4e53d0141d35339f9c..d14067e6f19b3684e9a403bf99672900d01fcbe3 100644 (file)
@@ -1,7 +1,9 @@
 %module pykms
 %{
 #include "kms++.h"
-#include "utils/testpat.h"
+
+#include "testpat.h"
+
 using namespace kms;
 %}
 
@@ -18,4 +20,5 @@ using namespace kms;
 %include "plane.h"
 %include "connector.h"
 %include "encoder.h"
-%include "utils/testpat.h"
+
+%include "testpat.h"
index 7856034d83d46a635f74ba8b68a38a649b286a42..a309bda4b27928b8575968e991019c0786442753 100644 (file)
@@ -2,8 +2,8 @@ include_directories(${LIBDRM_INCLUDE_DIRS})
 link_directories(${LIBDRM_LIBRARY_DIRS})
 
 add_executable (db db.cpp)
-target_link_libraries(db kms++ ${LIBDRM_LIBRARIES})
+target_link_libraries(db kms++ kmstest ${LIBDRM_LIBRARIES})
 
 add_executable (testpat testpat.cpp)
-target_link_libraries(testpat kms++ ${LIBDRM_LIBRARIES})
+target_link_libraries(testpat kms++ kmstest ${LIBDRM_LIBRARIES})
 
index bfefcb8468797fcc5416a606ad3a73685149822e..9b7c973f58aedfceea8feace8dcf04bc9a51752d 100644 (file)
@@ -6,7 +6,7 @@
 #include <drm_fourcc.h>
 
 #include "kms++.h"
-#include "utils/color.h"
+#include "color.h"
 
 #include "test.h"
 
index 99804076dfc00bdf1ed89e7ddda9477dd58a7236..419df5df37a3fd1782187fe9b1ff2b69ba088b72 100644 (file)
@@ -2,7 +2,7 @@
 #include <algorithm>
 
 #include "kms++.h"
-#include "utils/testpat.h"
+#include "testpat.h"
 
 #include "test.h"