Class: XCPretty::Parser

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

Constant Summary

Constants included from Matchers::Warnings

Matchers::Warnings::COMPILE_WARNING_MATCHER, Matchers::Warnings::GENERIC_WARNING_MATCHER, Matchers::Warnings::LD_WARNING_MATCHER, Matchers::Warnings::WILL_NOT_BE_CODE_SIGNED_MATCHER

Constants included from Matchers::Errors

Matchers::Errors::CHECK_DEPENDENCIES_ERRORS_MATCHER, Matchers::Errors::CLANG_ERROR_MATCHER, Matchers::Errors::COMPILE_ERROR_MATCHER, Matchers::Errors::CURSOR_MATCHER, Matchers::Errors::FATAL_ERROR_MATCHER, Matchers::Errors::FILE_MISSING_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::MODULE_INCLUDES_ERROR_MATCHER, Matchers::Errors::NO_CERTIFICATE_MATCHER, Matchers::Errors::PODS_ERROR_MATCHER, Matchers::Errors::PROVISIONING_PROFILE_REQUIRED_MATCHER, Matchers::Errors::SYMBOL_REFERENCED_FROM_MATCHER

Constants included from Matchers

Matchers::AGGREGATE_TARGET_MATCHER, Matchers::ANALYZE_MATCHER, Matchers::ANALYZE_TARGET_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_STORYBOARD_MATCHER, Matchers::COMPILE_XIB_MATCHER, Matchers::COPY_HEADER_MATCHER, Matchers::COPY_PLIST_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::PBXCP_MATCHER, Matchers::PHASE_SCRIPT_EXECUTION_MATCHER, Matchers::PHASE_SUCCESS_MATCHER, Matchers::PREPROCESS_MATCHER, Matchers::PROCESS_INFO_PLIST_MATCHER, Matchers::PROCESS_PCH_COMMAND_MATCHER, Matchers::PROCESS_PCH_MATCHER, Matchers::RESTARTING_TESTS_MATCHER, Matchers::SHELL_COMMAND_MATCHER, Matchers::TESTS_RUN_COMPLETION_MATCHER, Matchers::TEST_CASE_MEASURED_MATCHER, Matchers::TEST_CASE_PASSED_MATCHER, Matchers::TEST_CASE_PENDING_MATCHER, Matchers::TEST_CASE_STARTED_MATCHER, Matchers::TEST_SUITE_STARTED_MATCHER, Matchers::TEST_SUITE_START_MATCHER, Matchers::TIFFUTIL_MATCHER, Matchers::TOUCH_MATCHER, Matchers::UI_FAILING_TEST_MATCHER, Matchers::WRITE_AUXILIARY_FILES, Matchers::WRITE_FILE_MATCHER

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(formatter) ⇒ Parser

Returns a new instance of Parser.



302
303
304
# File 'lib/xcpretty/parser.rb', line 302

def initialize(formatter)
  @formatter = formatter
end

Instance Attribute Details

#formatterObject (readonly)

Returns the value of attribute formatter.



300
301
302
# File 'lib/xcpretty/parser.rb', line 300

def formatter
  @formatter
end

Instance Method Details

#parse(text) ⇒ Object



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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/xcpretty/parser.rb', line 306

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_compile_warning if should_format_warning?
  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 AGGREGATE_TARGET_MATCHER
    formatter.format_aggregate_target($1, $2, $3)
  when ANALYZE_TARGET_MATCHER
    formatter.format_analyze_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 CHECK_DEPENDENCIES_ERRORS_MATCHER
    formatter.format_error($1)
  when PROVISIONING_PROFILE_REQUIRED_MATCHER
    formatter.format_error($1)
  when NO_CERTIFICATE_MATCHER
    formatter.format_error($1)
  when COMPILE_MATCHER
    formatter.format_compile($2, $1)
  when COMPILE_COMMAND_MATCHER
    formatter.format_compile_command($1, $2)
  when COMPILE_XIB_MATCHER
    formatter.format_compile_xib($2, $1)
  when COMPILE_STORYBOARD_MATCHER
    formatter.format_compile_storyboard($2, $1)
  when COPY_HEADER_MATCHER
    formatter.format_copy_header_file($1, $2)
  when COPY_PLIST_MATCHER
    formatter.format_copy_plist_file($1, $2)
  when CPRESOURCE_MATCHER
    formatter.format_cpresource($1)
  when EXECUTED_MATCHER
    format_summary_if_needed(text)
  when RESTARTING_TESTS_MATCHER
    formatter.format_failing_test(@test_suite, @test_case, "Test crashed", "n/a")
  when UI_FAILING_TEST_MATCHER
    formatter.format_failing_test(@test_suite, @test_case, $2, $1)
  when FAILING_TEST_MATCHER
    formatter.format_failing_test($2, $3, ERB::Util.html_escape($4), $1)
  when FATAL_ERROR_MATCHER
    formatter.format_error($1)
  when FILE_MISSING_ERROR_MATCHER
    formatter.format_file_missing_error($1, $2)
  when GENERATE_DSYM_MATCHER
    formatter.format_generate_dsym($1)
  when LD_WARNING_MATCHER
    formatter.format_ld_warning($1 + $2)
  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 MODULE_INCLUDES_ERROR_MATCHER
    formatter.format_error($1)
  when TEST_CASE_MEASURED_MATCHER
    formatter.format_measuring_test($1, $2, $3)
  when TEST_CASE_PENDING_MATCHER
    formatter.format_pending_test($1, $2)
  when TEST_CASE_PASSED_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 PHASE_SUCCESS_MATCHER
    formatter.format_phase_success($1)
  when PROCESS_PCH_MATCHER
    formatter.format_process_pch($1)
  when PROCESS_PCH_COMMAND_MATCHER
    formatter.format_process_pch_command($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, $3)
  when TEST_SUITE_STARTED_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)
  when WRITE_FILE_MATCHER
    formatter.format_write_file($1)
  when WRITE_AUXILIARY_FILES
    formatter.format_write_auxiliary_files
  when SHELL_COMMAND_MATCHER
    formatter.format_shell_command($1, $2)
  when GENERIC_WARNING_MATCHER
    formatter.format_warning($1)
  when WILL_NOT_BE_CODE_SIGNED_MATCHER
    formatter.format_will_not_be_code_signed($1)
  else
    formatter.format_other(text)
  end
end