Class: XCPretty::Parser

Inherits:
Object
  • Object
show all
Includes:
Matchers, Matchers::Errors
Defined in:
lib/xcpretty/parser.rb

Constant Summary

Constants included from Matchers::Errors

Matchers::Errors::CLANG_ERROR_MATCHER, Matchers::Errors::CODESIGN_ERROR_MATCHER, Matchers::Errors::COMPILE_ERROR_MATCHER, Matchers::Errors::CURSOR_MATCHER, Matchers::Errors::FATAL_ERROR_MATCHER, Matchers::Errors::LD_ERROR_MATCHER, Matchers::Errors::LINKER_DUPLICATE_SYMBOLS_LOCATION_MATCHER, Matchers::Errors::LINKER_DUPLICATE_SYMBOLS_MATCHER, Matchers::Errors::LINKER_UNDEFINED_SYMBOLS_MATCHER, Matchers::Errors::LINKER_UNDEFINED_SYMBOL_LOCATION_MATCHER, Matchers::Errors::PODS_ERROR_MATCHER, Matchers::Errors::SYMBOL_REFERENCED_FROM_MATCHER

Constants included from Matchers

Matchers::ANALYZE_MATCHER, Matchers::BUILD_TARGET_MATCHER, Matchers::CHECK_DEPENDENCIES_MATCHER, Matchers::CLEAN_REMOVE_MATCHER, Matchers::CLEAN_TARGET_MATCHER, Matchers::CODESIGN_FRAMEWORK_MATCHER, Matchers::CODESIGN_MATCHER, Matchers::COMPILE_COMMAND_MATCHER, Matchers::COMPILE_MATCHER, Matchers::COMPILE_XIB_MATCHER, Matchers::COPY_STRINGS_MATCHER, Matchers::CPRESOURCE_MATCHER, Matchers::EXECUTED_MATCHER, Matchers::FAILING_TEST_MATCHER, Matchers::GENERATE_DSYM_MATCHER, Matchers::LIBTOOL_MATCHER, Matchers::LINKING_MATCHER, Matchers::PASSING_TEST_MATCHER, Matchers::PBXCP_MATCHER, Matchers::PENDING_TEST_MATCHER, Matchers::PHASE_SCRIPT_EXECUTION_MATCHER, Matchers::PREPROCESS_MATCHER, Matchers::PROCESS_INFO_PLIST_MATCHER, Matchers::PROCESS_PCH_MATCHER, Matchers::TESTS_RUN_COMPLETION_MATCHER, Matchers::TESTS_RUN_START_MATCHER, Matchers::TEST_SUITE_START_MATCHER, Matchers::TIFFUTIL_MATCHER, Matchers::TOUCH_MATCHER

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(formatter) ⇒ Parser

Returns a new instance of Parser.



197
198
199
# File 'lib/xcpretty/parser.rb', line 197

def initialize(formatter)
  @formatter = formatter
end

Instance Attribute Details

#formatterObject (readonly)

Returns the value of attribute formatter.



195
196
197
# File 'lib/xcpretty/parser.rb', line 195

def formatter
  @formatter
end

Instance Method Details

#parse(text) ⇒ Object



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
# File 'lib/xcpretty/parser.rb', line 201

def parse(text)
  update_test_state(text)
  update_error_state(text)
  update_linker_failure_state(text)

  return format_compile_error if should_format_error?
  return format_undefined_symbols if should_format_undefined_symbols?
  return format_duplicate_symbols if should_format_duplicate_symbols?

  case text
  when ANALYZE_MATCHER
    formatter.format_analyze($2, $1)
  when BUILD_TARGET_MATCHER
    formatter.format_build_target($1, $2, $3)
  when CLEAN_REMOVE_MATCHER
    formatter.format_clean_remove
  when CLEAN_TARGET_MATCHER
    formatter.format_clean_target($1, $2, $3)
  when COPY_STRINGS_MATCHER
    formatter.format_copy_strings_file($1)
  when CHECK_DEPENDENCIES_MATCHER
    formatter.format_check_dependencies
  when CLANG_ERROR_MATCHER
    formatter.format_error($1)
  when CODESIGN_FRAMEWORK_MATCHER
    formatter.format_codesign($1)
  when CODESIGN_MATCHER
    formatter.format_codesign($1)
  when CODESIGN_ERROR_MATCHER
    formatter.format_error($1)
  when COMPILE_MATCHER
    formatter.format_compile($2, $1)
  when COMPILE_COMMAND_MATCHER
    formatter.format_compile_command($1)
  when COMPILE_XIB_MATCHER
    formatter.format_compile_xib($2, $1)
  when CPRESOURCE_MATCHER
    formatter.format_cpresource($1)
  when EXECUTED_MATCHER
    format_summary_if_needed(text)
  when FAILING_TEST_MATCHER
    formatter.format_failing_test($2, $3, $4, $1)
  when FATAL_ERROR_MATCHER
    formatter.format_error($1)
  when GENERATE_DSYM_MATCHER
    formatter.format_generate_dsym($1)
  when LD_ERROR_MATCHER
    formatter.format_error($1)
  when LIBTOOL_MATCHER
    formatter.format_libtool($1)
  when LINKING_MATCHER
    formatter.format_linking($1, $2, $3)
  when PENDING_TEST_MATCHER
    formatter.format_pending_test($1, $2)
  when PASSING_TEST_MATCHER
    formatter.format_passing_test($1, $2, $3)
  when PODS_ERROR_MATCHER
    formatter.format_error($1)
  when PROCESS_INFO_PLIST_MATCHER
    formatter.format_process_info_plist(*unescaped($2, $1))
  when PHASE_SCRIPT_EXECUTION_MATCHER
    formatter.format_phase_script_execution(*unescaped($1))
  when PROCESS_PCH_MATCHER
    formatter.format_process_pch($1)
  when PREPROCESS_MATCHER
    formatter.format_preprocess($1)
  when PBXCP_MATCHER
    formatter.format_pbxcp($1)
  when TESTS_RUN_COMPLETION_MATCHER
    formatter.format_test_run_finished($1, $2)
  when TESTS_RUN_START_MATCHER
    formatter.format_test_run_started($1)
  when TEST_SUITE_START_MATCHER
    formatter.format_test_suite_started($1)
  when TIFFUTIL_MATCHER
    formatter.format_tiffutil($1)
  when TOUCH_MATCHER
    formatter.format_touch($1, $2)
  else
    ""
  end
end