GObject-Plugin/test/loader_test/CMakeLists.txt

53 lines
1.9 KiB
CMake
Raw Normal View History

2014-09-19 11:04:31 +04:00
SET (BinName loader_test)
FILE (GLOB_RECURSE BinSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} LoaderTest.vala)
SET (BinPackages gee-0.8 gio-2.0)
SET (BinCustomVapis ${CMAKE_BINARY_DIR}/src/loader/${PROJECT_LOWERCASE_NAME}-loader-${MAJOR}.vapi
${CMAKE_BINARY_DIR}/src/iface/${PROJECT_LOWERCASE_NAME}-iface-${MAJOR}.vapi
2014-09-19 11:04:31 +04:00
${CMAKE_BINARY_DIR}/test/loader_test-iface/loader_test-iface-${MAJOR}.vapi
)
2014-10-16 16:11:28 +04:00
SET (BinLinkLibs ${PROJECT_LOWERCASE_NAME}-loader
${PROJECT_LOWERCASE_NAME}-iface
loader_test-iface
)
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/src/loader"
"${CMAKE_BINARY_DIR}/src/iface"
2014-10-16 16:11:28 +04:00
"${CMAKE_BINARY_DIR}/test/loader_test-iface"
2014-09-19 11:04:31 +04:00
)
INCLUDE (ValaBinCommonRules)
# Plugin Loading Test
MACRO (plugin_loading_test testname regexp)
ADD_TEST (loader_test-${testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/loader_test)
SET_TESTS_PROPERTIES (loader_test-${testname}
PROPERTIES PASS_REGULAR_EXPRESSION ${regexp}
FAIL_REGULAR_EXPRESSION "CRITICAL;WARNING")
ENDMACRO (plugin_loading_test)
# Testing Plugin:[de]init() and Library unload()
plugin_loading_test (SimpleLoaderTest
2014-10-16 16:11:28 +04:00
"List Plugins:
Name = TypeA1
Name = TypeA2
Name = TypeB1
Name = TypeB2
Creating PluginTypeA Object:
TypeA1 init \\\\(\\\\) called
Call a.method_a \\\\(\\\\) from main app:
TypeA1.method_a \\\\(\\\\) called
Call IHostLoaderTest.method_host \\\\(\\\\) from TypeA1:
LoaderTestHost.method_host \\\\(\\\\) called
Destroing PluginTypeA Object:
TypeA1 deinit \\\\(\\\\) called
Creating PluginTypeB Object:
TypeB1 init \\\\(\\\\) called
Call b.method_b \\\\(\\\\) from main app:
TypeB1.method_b \\\\(\\\\) called
Returned String: TypeB1 returned string
Destroing PluginTypeB Object:
TypeB1 deinit \\\\(\\\\) called"
2014-09-19 11:04:31 +04:00
)
SET_TESTS_PROPERTIES(loader_test-SimpleLoaderTest PROPERTIES ENVIRONMENT "LANG=en")
# enable testing
ENABLE_TESTING ()