Warning, /plasma/powerdevil/autotests/migrateconfig/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 add_executable(migrateconfig migrateconfig.cpp) 0002 target_link_libraries(migrateconfig powerdevilcore) 0003 ecm_mark_as_test(migrateconfig) 0004 0005 function(add_migrateconfig_test) 0006 set(options MOBILE VM CANNOT_SUSPEND ASSERT_NO_POWERDEVILRC_AFTER_MIGRATION) 0007 set(oneValueArgs NAME INPUT_POWERDEVILRC INPUT_PROFILESRC EXPECTED_POWERDEVILRC EXPECTED_PROFILESRC) 0008 cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "" ${ARGN}) 0009 0010 set(migrateconfig_args "") 0011 set(diff_cmds "") 0012 0013 if (ARG_INPUT_POWERDEVILRC) 0014 set(migrateconfig_args "${migrateconfig_args} --src-powerdevilrc \"${CMAKE_CURRENT_SOURCE_DIR}/${ARG_INPUT_POWERDEVILRC}\"") 0015 endif() 0016 if (ARG_INPUT_PROFILESRC) 0017 set(migrateconfig_args "${migrateconfig_args} --src-profilesrc \"${CMAKE_CURRENT_SOURCE_DIR}/${ARG_INPUT_PROFILESRC}\"") 0018 endif() 0019 0020 if (ARG_ASSERT_NO_POWERDEVILRC_AFTER_MIGRATION) 0021 set(migrateconfig_args "${migrateconfig_args} --assert-no-powerdevilrc-after-migration") 0022 endif() 0023 if (ARG_EXPECTED_POWERDEVILRC) 0024 set(out_powerdevilrc "${CMAKE_CURRENT_BINARY_DIR}/${ARG_EXPECTED_POWERDEVILRC}") 0025 set(migrateconfig_args "${migrateconfig_args} --dest-powerdevilrc \"${out_powerdevilrc}\"") 0026 set(expected_powerdevilrc "${CMAKE_CURRENT_SOURCE_DIR}/${ARG_EXPECTED_POWERDEVILRC}") 0027 set(diff_cmds "${diff_cmds} && echo \"powerdevilrc diff (should be empty):\"") 0028 set(diff_cmds "${diff_cmds} && diff -u \"${expected_powerdevilrc}\" \"${out_powerdevilrc}\"") 0029 endif() 0030 if (ARG_EXPECTED_PROFILESRC) 0031 set(out_profilesrc "${CMAKE_CURRENT_BINARY_DIR}/${ARG_EXPECTED_PROFILESRC}") 0032 set(migrateconfig_args "${migrateconfig_args} --dest-profilesrc \"${out_profilesrc}\"") 0033 set(expected_profilesrc "${CMAKE_CURRENT_SOURCE_DIR}/${ARG_EXPECTED_PROFILESRC}") 0034 set(diff_cmds "${diff_cmds} && echo \"powermanagementprofilesrc diff (should be empty):\"") 0035 set(diff_cmds "${diff_cmds} && diff -u \"${expected_profilesrc}\" \"${out_profilesrc}\"") 0036 endif() 0037 0038 if (ARG_MOBILE) 0039 set(migrateconfig_args "${helper_args} --mobile") 0040 endif() 0041 if (ARG_VM) 0042 set(migrateconfig_args "${helper_args} --vm") 0043 endif() 0044 if (ARG_CANNOT_SUSPEND) 0045 set(migrateconfig_args "${helper_args} --cannot-suspend") 0046 endif() 0047 0048 add_test( 0049 NAME ${ARG_NAME} 0050 COMMAND bash -c "$<TARGET_FILE:migrateconfig> ${migrateconfig_args} ${diff_cmds}" 0051 ) 0052 endfunction() 0053 0054 add_migrateconfig_test( 0055 NAME migrateconfig_test1_default_configs_can_suspend_to_ram 0056 INPUT_PROFILESRC test1_initial_powermanagementprofilesrc # as generated by Plasma 5 profile generator 0057 EXPECTED_PROFILESRC test1_migrated_powermanagementprofilesrc # same, except with profiles-migrated flag 0058 ASSERT_NO_POWERDEVILRC_AFTER_MIGRATION 0059 ) 0060 0061 add_migrateconfig_test( 0062 NAME migrateconfig_test2_activities 0063 INPUT_POWERDEVILRC test2_initial_powerdevilrc 0064 INPUT_PROFILESRC test2_initial_powermanagementprofilesrc # with some extra activity settings 0065 EXPECTED_POWERDEVILRC test2_migrated_powerdevilrc 0066 EXPECTED_PROFILESRC test2_migrated_powermanagementprofilesrc 0067 ) 0068 0069 add_migrateconfig_test( 0070 NAME migrateconfig_test2a_activities_no_double_migration 0071 INPUT_POWERDEVILRC test2_migrated_powerdevilrc 0072 INPUT_PROFILESRC test2_migrated_powermanagementprofilesrc 0073 EXPECTED_POWERDEVILRC test2_migrated_powerdevilrc 0074 EXPECTED_PROFILESRC test2_migrated_powermanagementprofilesrc 0075 ) 0076 0077 add_migrateconfig_test( 0078 NAME migrateconfig_test3_profiles 0079 INPUT_PROFILESRC test3_initial_powermanagementprofilesrc # with varied non-default profile settings 0080 EXPECTED_POWERDEVILRC test3_migrated_powerdevilrc 0081 EXPECTED_PROFILESRC test3_migrated_powermanagementprofilesrc 0082 ) 0083 0084 add_migrateconfig_test( 0085 NAME migrateconfig_test4_profiles_more 0086 INPUT_PROFILESRC test4_initial_powermanagementprofilesrc # with selected non-default profile settings 0087 EXPECTED_POWERDEVILRC test4_migrated_powerdevilrc 0088 )