Merge "This is a hotfix for side effect on Scrolling, LineWrap and Invalid position...
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-shader-generator / CMakeLists.txt
1 SET(PKG_NAME "dali-shader-generator")
2
3 SET(EXEC_NAME "tct-${PKG_NAME}-core")
4
5 PKG_CHECK_MODULES(${EXEC_NAME} REQUIRED
6   dali2-toolkit
7 )
8
9 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp)
10
11 INSTALL(PROGRAMS ${EXEC_NAME}
12     DESTINATION ${BIN_DIR}/${EXEC_NAME}
13 )
14
15 SET(SHADER_GENERATOR dali-shader-generator)
16 SET(GENERATED_FOLDER ${CMAKE_CURRENT_BINARY_DIR}/shader/generated)
17 SET(SHADER_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/shader)
18
19 ADD_CUSTOM_TARGET(test_help ALL COMMAND ${SHADER_GENERATOR} -h | grep "DALi Shader Generator" > /dev/null 2>&1 && echo "test_help Succeeded" VERBATIM)
20 ADD_CUSTOM_TARGET(test_no_params ALL COMMAND ${SHADER_GENERATOR} > /dev/null 2>&1 || echo "test_no_params Succeeded" VERBATIM)
21 ADD_CUSTOM_TARGET(test_version ALL COMMAND ${SHADER_GENERATOR} -v | wc -l | grep 1 > /dev/null 2>&1 && echo "test_version Succeeded" VERBATIM)
22 ADD_CUSTOM_TARGET(test_invalid_option ALL COMMAND ${SHADER_GENERATOR} --undeclared > /dev/null 2>&1 || echo "test_invalid_option Succeeded" VERBATIM)
23 ADD_CUSTOM_TARGET(test_too_many_params ALL COMMAND ${SHADER_GENERATOR} ONE TWO THREE > /dev/null 2>&1 || echo "test_too_many_params Succeeded" VERBATIM)
24 ADD_CUSTOM_TARGET(test_invalid_indir ALL COMMAND ${SHADER_GENERATOR} ONE TWO > /dev/null 2>&1 || echo "test_invalid_indir Succeeded" VERBATIM)
25 ADD_CUSTOM_TARGET(
26   test_check_built_in_created
27   ALL
28   COMMAND ${SHADER_GENERATOR} . ${GENERATED_FOLDER} | grep builtin-shader | wc -l | grep 2 > /dev/null 2>&1 && echo "test_check_built_in_created Succeeded"
29   VERBATIM)
30 ADD_CUSTOM_TARGET(
31   test_check_built_in_not_created
32   ALL
33   COMMAND ${SHADER_GENERATOR} --skip . ${GENERATED_FOLDER} | grep builtin-shader > /dev/null 2>&1 || echo "test_check_built_in_not_created Succeeded"
34   VERBATIM)
35 ADD_CUSTOM_TARGET(
36   test_frag_correct
37   ALL
38   COMMAND ${SHADER_GENERATOR} ${SHADER_FOLDER} ${GENERATED_FOLDER} | grep "SHADER_FRAGMENT_SHADER_FRAG" | grep "fragment-shader-frag.h" > /dev/null 2>&1 && echo "test_frag_correct Succeeded"
39   VERBATIM)
40 ADD_CUSTOM_TARGET(
41   test_vert_correct
42   ALL
43   COMMAND ${SHADER_GENERATOR} ${SHADER_FOLDER} ${GENERATED_FOLDER} | grep "SHADER_VERTEX_SHADER_VERT" | grep "vertex-shader-vert.h" > /dev/null 2>&1 && echo "test_vert_correct Succeeded"
44   VERBATIM)
45 ADD_CUSTOM_TARGET(
46   test_def_correct
47   ALL
48   COMMAND ${SHADER_GENERATOR} ${SHADER_FOLDER} ${GENERATED_FOLDER} | grep "SHADER_SHADER_DEFINE_DEF" | grep "shader-define-def.h" > /dev/null 2>&1 && echo "test_def_correct Succeeded"
49   VERBATIM)