This file is indexed.

/usr/lib/KWWidgets/CMake/KWWidgetsTestingMacros.cmake is in libkwwidgets1-dev 1.0.0~cvs20100930-8.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# ---------------------------------------------------------------------------
# KWWidgets_GET_CMAKE_BUILD_TYPE
# Get CMAKE_BUILD_TYPE

macro(KWWidgets_GET_CMAKE_BUILD_TYPE varname)

  set(cmake_build_type_found "${CMAKE_BUILD_TYPE}")
  if(CMAKE_CONFIGURATION_TYPES)
    if(NOT cmake_build_type_found)
      foreach(var ${CMAKE_CONFIGURATION_TYPES})
        if(NOT cmake_build_type_found)
          set(cmake_build_type_found "${var}")
        endif(NOT cmake_build_type_found)
      endforeach(var)
    endif(NOT cmake_build_type_found)
  endif(CMAKE_CONFIGURATION_TYPES)
  
  set(${varname} ${cmake_build_type_found})

endmacro(KWWidgets_GET_CMAKE_BUILD_TYPE)

# ---------------------------------------------------------------------------
# KWWidgets_GET_FULL_PATH_TO_EXECUTABLE
# Get full path to exec

macro(KWWidgets_GET_FULL_PATH_TO_EXECUTABLE exe_name varname)

  get_filename_component(exe_name_name "${exe_name}" NAME)
  if("${exe_name_name}" STREQUAL "${exe_name}")
    if(EXECUTABLE_OUTPUT_PATH)
      set(exe_dir "${EXECUTABLE_OUTPUT_PATH}/")
    else(EXECUTABLE_OUTPUT_PATH)
      set(exe_dir "${CMAKE_CURRENT_BINARY_DIR}/")
    endif(EXECUTABLE_OUTPUT_PATH)
  else("${exe_name_name}" STREQUAL "${exe_name}")
    set(exe_dir)
  endif("${exe_name_name}" STREQUAL "${exe_name}")

  kwwidgets_get_cmake_build_type(DEFAULT_CMAKE_BUILD_TYPE)
  if(CMAKE_CONFIGURATION_TYPES)
    set(CONFIGURATION_TYPE "${DEFAULT_CMAKE_BUILD_TYPE}/")
  else(CMAKE_CONFIGURATION_TYPES)
    set(CONFIGURATION_TYPE)
  endif(CMAKE_CONFIGURATION_TYPES)

  set(${varname} "${exe_dir}${CONFIGURATION_TYPE}${exe_name}")

endmacro(KWWidgets_GET_FULL_PATH_TO_EXECUTABLE)

# ---------------------------------------------------------------------------
# KWWidgets_ADD_TEST_WITH_LAUNCHER
# Add specific distribution-related C test

macro(KWWidgets_ADD_TEST_WITH_LAUNCHER
    test_name
    exe_name)

  # If we are building the test from the library itself, use the
  # unique launcher created by the library, instead of creating
  # a specific launcher when building out-of-source.
  
  if(KWWidgets_SOURCE_DIR)
    set(LAUNCHER_EXE_NAME "KWWidgetsSetupPathsLauncher")
    kwwidgets_get_full_path_to_executable(${exe_name} exe_path)
    add_test(${test_name} 
      ${EXECUTABLE_OUTPUT_PATH}/${LAUNCHER_EXE_NAME} ${exe_path} ${ARGN})
  else(KWWidgets_SOURCE_DIR)
    include("${KWWidgets_CMAKE_DIR}/KWWidgetsPathsMacros.cmake")
    set(LAUNCHER_EXE_NAME "${exe_name}Launcher")
    kwwidgets_generate_setup_paths_launcher(
      "${CMAKE_CURRENT_BINARY_DIR}" "${LAUNCHER_EXE_NAME}" 
      "${EXECUTABLE_OUTPUT_PATH}" "${exe_name}")
    add_test(${test_name} 
      ${EXECUTABLE_OUTPUT_PATH}/${LAUNCHER_EXE_NAME} ${ARGN})
  endif(KWWidgets_SOURCE_DIR)

endmacro(KWWidgets_ADD_TEST_WITH_LAUNCHER)

# ---------------------------------------------------------------------------
# KWWidgets_ADD_TEST_FROM_EXAMPLE
# Add specific distribution-related test

macro(KWWidgets_ADD_TEST_FROM_EXAMPLE 
    test_name
    exe_name exe_options
    out_of_source_exe_name out_of_source_exe_options)

  add_test(${test_name} 
    ${EXECUTABLE_OUTPUT_PATH}/${exe_name} ${exe_options} ${ARGN})

  if(KWWidgets_SOURCE_DIR AND KWWidgets_TEST_OUT_OF_SOURCE)
    kwwidgets_add_out_of_source_test(
      ${test_name}OoS
      ${PROJECT_NAME}
      "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}OoS"
      ${out_of_source_exe_name} ${out_of_source_exe_options} ${ARGN})
  endif(KWWidgets_SOURCE_DIR AND KWWidgets_TEST_OUT_OF_SOURCE)

endmacro(KWWidgets_ADD_TEST_FROM_EXAMPLE)

# ---------------------------------------------------------------------------
# KWWidgets_ADD_Squish_TEST

macro(KWWidgets_ADD_Squish_TEST 
    test_name
    squish_AUT_full_path
    squish_test_case_path
    aut_env
    aut_init_script
    aut_args
    )

  # for execute_process() to work on SquishRunTestCase.sh, it has to be on the
  # same filesystem, i.e. not in a VMWare-shared disk for example.
  set(kwwSquishShellScript "${CMAKE_BINARY_DIR}/CMake/SquishRunTestCase.sh")
  if(NOT EXISTS ${kwwSquishShellScript})
    configure_file(
      ${KWWidgets_CMAKE_DIR}/SquishRunTestCase.sh
      ${kwwSquishShellScript}
      IMMEDIATE)
  endif(NOT EXISTS ${kwwSquishShellScript})

  # Can only handle "Tk"
  set(squish_script_wrapper "Tk")

  ADD_TEST(${test_name}
    ${CMAKE_COMMAND} -V -VV --test
    "-Dsquish_aut:STRING=${squish_AUT_full_path}"
    "-Dsquish_server_executable:STRING=${SQUISH_SERVER_EXECUTABLE}"
    "-Dsquish_client_executable:STRING=${SQUISH_CLIENT_EXECUTABLE}"
    "-Dsquish_libqtdir:STRING=${QT_LIBRARY_DIR}"
    "-Dsquish_test_case:STRING=${squish_test_case_path}"
    "-Dsquish_env_vars:STRING=${aut_env}"
    "-Dsquish_wrapper:STRING=${squish_script_wrapper}"
    "-Dsquish_aut_script:STRING=${aut_init_script}"
    "-Dsquish_shell_script:STRING=${kwwSquishShellScript}"
    "-Dsquish_aut_args:STRING=${aut_args}"
    -P "${KWWidgets_CMAKE_DIR}/KWWidgetsSquishTestScript.cmake"
    ${ARGN})

endmacro(KWWidgets_ADD_Squish_TEST)

# ---------------------------------------------------------------------------
# KWWidgets_ADD_Squish_TEST_FROM_C_EXAMPLE
# Add specific distribution-related C test

macro(KWWidgets_ADD_Squish_TEST_FROM_C_EXAMPLE 
    test_name
    squish_AUT_name
    squish_test_case_path
    )

  # Try to find the full path to the test executable

  kwwidgets_get_full_path_to_executable(${squish_AUT_name} exe_path)
  
  KWWidgets_ADD_Squish_TEST("${test_name}"
    "${exe_path}"
    "${squish_test_case_path}"
    "${kwwENV}"
    "${EXECUTABLE_OUTPUT_PATH}/KWWidgetsSetupPaths.sh"
    ""
    )

  SET_TESTS_PROPERTIES(${test_name}
    PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED;ERROR;FATAL")

endmacro(KWWidgets_ADD_Squish_TEST_FROM_C_EXAMPLE)

# ---------------------------------------------------------------------------
# KWWidgets_ADD_TEST_FROM_C_EXAMPLE
# Add specific distribution-related C test

macro(KWWidgets_ADD_TEST_FROM_C_EXAMPLE 
    test_name
    exe_name)

  # Try to find the full path to the test executable

  kwwidgets_get_full_path_to_executable(${exe_name} exe_path)

  # If we are building the test from the library itself, use the
  # unique launcher created by the library, instead of creating
  # a specific launcher when building out-of-source.
  
  set(LAUNCHER_EXE_NAME "${exe_name}Launcher")

  if(KWWidgets_SOURCE_DIR)
    kwwidgets_add_test_from_example(${test_name} 
      "KWWidgetsSetupPathsLauncher" "${exe_path}"
      ${LAUNCHER_EXE_NAME} ""
      "--test")
  else(KWWidgets_SOURCE_DIR)
    # No need to create a launcher (supposed to be done by the example already)
    kwwidgets_add_test_from_example(${test_name} 
      ${LAUNCHER_EXE_NAME} ""
      ${LAUNCHER_EXE_NAME} ""
      "--test")
  endif(KWWidgets_SOURCE_DIR)

endmacro(KWWidgets_ADD_TEST_FROM_C_EXAMPLE)


# ---------------------------------------------------------------------------
# KWWidgets_ADD_TEST_FROM_TCL_EXAMPLE
# Add specific distribution-related Tcl test

macro(KWWidgets_ADD_TEST_FROM_TCL_EXAMPLE 
    test_name
    script_name)

  if(KWWidgets_BUILD_SHARED_LIBS AND VTK_WRAP_TCL AND TCL_TCLSH)

    get_filename_component(name_we "${script_name}" NAME_WE)
    set(LAUNCHER_EXE_NAME "${name_we}TclLauncher")

    # If we are building the test from the library itself, use the
    # unique launcher created by the library, instead of creating
    # a specific launcher when building out-of-source.

    if(KWWidgets_SOURCE_DIR)
      kwwidgets_add_test_from_example(${test_name} 
        "KWWidgetsSetupPathsLauncher" "${TCL_TCLSH}"
        ${LAUNCHER_EXE_NAME} ""
        "${script_name}" "--test")
    else(KWWidgets_SOURCE_DIR)
      include("${KWWidgets_CMAKE_DIR}/KWWidgetsPathsMacros.cmake")
      kwwidgets_generate_setup_paths_launcher(
        "${CMAKE_CURRENT_BINARY_DIR}" "${LAUNCHER_EXE_NAME}" "" "${TCL_TCLSH}")
      kwwidgets_add_test_from_example(${test_name} 
        ${LAUNCHER_EXE_NAME} "" 
        ${LAUNCHER_EXE_NAME} "" 
        "${script_name}" "--test")
    endif(KWWidgets_SOURCE_DIR)

  endif(KWWidgets_BUILD_SHARED_LIBS AND VTK_WRAP_TCL AND TCL_TCLSH)

endmacro(KWWidgets_ADD_TEST_FROM_TCL_EXAMPLE)

# ---------------------------------------------------------------------------
# KWWidgets_ADD_TEST_FROM_PYTHON_EXAMPLE
# Add specific distribution-related Python test

macro(KWWidgets_ADD_TEST_FROM_PYTHON_EXAMPLE 
    test_name
    script_name)

  if(KWWidgets_BUILD_SHARED_LIBS AND VTK_WRAP_PYTHON AND PYTHON_EXECUTABLE)

    get_filename_component(name_we "${script_name}" NAME_WE)
    set(LAUNCHER_EXE_NAME "${name_we}PythonLauncher")

    # If we are building the test from the library itself, use the
    # unique launcher created by the library, instead of creating
    # a specific launcher when building out-of-source.

    if(KWWidgets_SOURCE_DIR)
      kwwidgets_add_test_from_example(${test_name} 
        "KWWidgetsSetupPathsLauncher" "${PYTHON_EXECUTABLE}"
        ${LAUNCHER_EXE_NAME} ""
        "${script_name}" "--test")
    else(KWWidgets_SOURCE_DIR)
      include("${KWWidgets_CMAKE_DIR}/KWWidgetsPathsMacros.cmake")
      kwwidgets_generate_setup_paths_launcher(
        "${CMAKE_CURRENT_BINARY_DIR}" "${LAUNCHER_EXE_NAME}" "" "${PYTHON_EXECUTABLE}")
      kwwidgets_add_test_from_example(${test_name} 
        ${LAUNCHER_EXE_NAME} "" 
        ${LAUNCHER_EXE_NAME} "" 
        "${script_name}" "--test")
    endif(KWWidgets_SOURCE_DIR)

  endif(KWWidgets_BUILD_SHARED_LIBS AND VTK_WRAP_PYTHON AND PYTHON_EXECUTABLE)

endmacro(KWWidgets_ADD_TEST_FROM_PYTHON_EXAMPLE)

# ---------------------------------------------------------------------------
# KWWidgets_ADD_OUT_OF_SOURCE_TEST
# Add an out-of-source test 

macro(KWWidgets_ADD_OUT_OF_SOURCE_TEST 
    test_name 
    project_name 
    src_dir bin_dir 
    exe_name)

  if(VTK_WRAP_TCL)

    kwwidgets_get_cmake_build_type(DEFAULT_CMAKE_BUILD_TYPE)
    if(CMAKE_CONFIGURATION_TYPES)
      set(CONFIGURATION_TYPE "${DEFAULT_CMAKE_BUILD_TYPE}/")
    else(CMAKE_CONFIGURATION_TYPES)
      set(CONFIGURATION_TYPE)
    endif(CMAKE_CONFIGURATION_TYPES)

    add_test("${test_name}" ${CMAKE_CTEST_COMMAND}
      --build-and-test "${src_dir}" "${bin_dir}"
      --build-generator ${CMAKE_GENERATOR}
      --build-makeprogram ${CMAKE_MAKE_PROGRAM}
      --build-project ${project_name}
      --build-config ${DEFAULT_CMAKE_BUILD_TYPE}
      --build-options 
      "-DKWWidgets_DIR:PATH=${KWWidgets_BINARY_DIR}" 
      "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}"
      "-DSOV_DIR:PATH=${SOV_DIR}"
      "-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}"
      "-DBUILD_TESTING:BOOL=ON"
      "-DTCL_TCLSH:FILEPATH=${TCL_TCLSH}"
      "-DTCL_LIBRARY:FILEPATH=${TCL_LIBRARY}"
      "-DTK_WISH:FILEPATH=${TK_WISH}"
      "-DTK_LIBRARY:FILEPATH=${TK_LIBRARY}"
      "-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}"
      "-DGETTEXT_INTL_LIBRARY:FILEPATH=${GETTEXT_INTL_LIBRARY}"
      "-DGETTEXT_INCLUDE_DIR:PATH=${GETTEXT_INCLUDE_DIR}"
      "-DGETTEXT_MSGCAT_EXECUTABLE:FILEPATH=${GETTEXT_MSGCAT_EXECUTABLE}"
      "-DGETTEXT_MSGCONV_EXECUTABLE:FILEPATH=${GETTEXT_MSGCONV_EXECUTABLE}"
      "-DGETTEXT_MSGFMT_EXECUTABLE:FILEPATH=${GETTEXT_MSGFMT_EXECUTABLE}"
      "-DGETTEXT_MSGINIT_EXECUTABLE:FILEPATH=${GETTEXT_MSGINIT_EXECUTABLE}"
      "-DGETTEXT_MSGMERGE_EXECUTABLE:FILEPATH=${GETTEXT_MSGMERGE_EXECUTABLE}"
      "-DGETTEXT_XGETTEXT_EXECUTABLE:FILEPATH=${GETTEXT_XGETTEXT_EXECUTABLE}"
      --test-command "${CONFIGURATION_TYPE}${exe_name}" ${ARGN})

    if(KWWidgets_TEST_INSTALLATION AND CMAKE_INSTALL_PREFIX)
      add_test("${test_name}wInst" ${CMAKE_CTEST_COMMAND}
        --build-and-test "${src_dir}" "${bin_dir}wInst"
        --build-generator ${CMAKE_GENERATOR}
        --build-makeprogram ${CMAKE_MAKE_PROGRAM}
        --build-project ${project_name}
        --build-config ${DEFAULT_CMAKE_BUILD_TYPE}
        --build-options 
        "-DKWWidgets_DIR:PATH=${CMAKE_INSTALL_PREFIX}/lib/KWWidgets" 
        "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}"
        "-DSOV_DIR:PATH=${SOV_DIR}"
        "-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}"
        "-DBUILD_TESTING:BOOL=ON"
        "-DTCL_TCLSH:FILEPATH=${TCL_TCLSH}"
        "-DTCL_LIBRARY:FILEPATH=${TCL_LIBRARY}"
        "-DTK_WISH:FILEPATH=${TK_WISH}"
        "-DTK_LIBRARY:FILEPATH=${TK_LIBRARY}"
        "-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}"
        "-DGETTEXT_INTL_LIBRARY:FILEPATH=${GETTEXT_INTL_LIBRARY}"
        "-DGETTEXT_INCLUDE_DIR:PATH=${GETTEXT_INCLUDE_DIR}"
        "-DGETTEXT_MSGCAT_EXECUTABLE:FILEPATH=${GETTEXT_MSGCAT_EXECUTABLE}"
        "-DGETTEXT_MSGCONV_EXECUTABLE:FILEPATH=${GETTEXT_MSGCONV_EXECUTABLE}"
        "-DGETTEXT_MSGFMT_EXECUTABLE:FILEPATH=${GETTEXT_MSGFMT_EXECUTABLE}"
        "-DGETTEXT_MSGINIT_EXECUTABLE:FILEPATH=${GETTEXT_MSGINIT_EXECUTABLE}"
        "-DGETTEXT_MSGMERGE_EXECUTABLE:FILEPATH=${GETTEXT_MSGMERGE_EXECUTABLE}"
        "-DGETTEXT_XGETTEXT_EXECUTABLE:FILEPATH=${GETTEXT_XGETTEXT_EXECUTABLE}"
        --test-command "${CONFIGURATION_TYPE}${exe_name}" ${ARGN})
    endif(KWWidgets_TEST_INSTALLATION AND CMAKE_INSTALL_PREFIX)

  endif(VTK_WRAP_TCL)

endmacro(KWWidgets_ADD_OUT_OF_SOURCE_TEST)