Allow autotest to collect tests that don't include gtest files

Autotest checks for gtest files to better determine if a give file is
actually a test file or not. However, because many files don't actually
include what they use, many test files don't directly include gtest.h,
gmock.h, or a test_utils.h file. Instead, they may include those via
something like sim_test.h, resulting in the script ignoring those files
right now.

This change improves that by still looking for files that include a
gtest file, but until it has found at least one file that does, it
will also collect files that match the test file name regex and do not
match the gtest include regex. Then, if no files are found with the
gtest includes, it will move forward under the assumption that the
file it found without the gtest include was the correct test file.

It will still prefer files with gtest includes, but has a fallback in
case none exist, providing a best effort chance at building and
running the tests.

Also includes a small improvement to outputting the file names that
it finds after a recursive file search.

Change-Id: Ia56792426b55cb17a43ffe2545b4deefb5dba0dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2568710
Commit-Queue: Mario Bianucci <[email protected]>
Reviewed-by: Michael Thiessen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#832607}
GitOrigin-RevId: 6b5450075b60b8e0f0362334f394d6711391fc6b
1 file changed
tree: b40435bba25aec2581a7cac24a6df7480416db1e
  1. accessibility/
  2. android/
  3. binary_size/
  4. bisect_repackage/
  5. cfi/
  6. check_ecs_deps/
  7. checkbins/
  8. checklicenses/
  9. checkperms/
  10. checkteamtags/
  11. chrome_extensions/
  12. clang/
  13. code_coverage/
  14. compile_test/
  15. coverity/
  16. cr/
  17. cros/
  18. cygprofile/
  19. determinism/
  20. diagnosis/
  21. dromaeo_benchmark_runner/
  22. dump_process_memory/
  23. emacs/
  24. find_runtime_symbols/
  25. flags/
  26. flakiness/
  27. fuchsia/
  28. gdb/
  29. generate_library_loader/
  30. generate_shim_headers/
  31. generate_stubs/
  32. get_swarming_logs/
  33. git/
  34. gn/
  35. grit/
  36. gritsettings/
  37. idl_parser/
  38. imagediff/
  39. infra/
  40. ipc_fuzzer/
  41. json_comment_eater/
  42. json_schema_compiler/
  43. json_to_struct/
  44. linux/
  45. lldb/
  46. luci-go/
  47. mac/
  48. mb/
  49. md_browser/
  50. media_engagement_preload/
  51. memory/
  52. memory_inspector/
  53. metrics/
  54. msan/
  55. oopif/
  56. origin_trials/
  57. page_cycler/
  58. perf/
  59. polymer/
  60. privacy_budget/
  61. protoc_wrapper/
  62. python/
  63. real_world_impact/
  64. resources/
  65. security/
  66. site_compare/
  67. stats_viewer/
  68. strict_enum_value_checker/
  69. style_variable_generator/
  70. sublime/
  71. symsrc/
  72. tcmalloc/
  73. tests/
  74. traceline/
  75. traffic_annotation/
  76. translation/
  77. ubsan/
  78. usb_gadget/
  79. v8_context_snapshot/
  80. valgrind/
  81. variations/
  82. vim/
  83. vscode/
  84. web_bluetooth/
  85. web_dev_style/
  86. win/
  87. .style.yapf
  88. auto-nav.py
  89. autotest.py
  90. bash-completion
  91. bisect-builds.py
  92. bisect_test.py
  93. boilerplate.py
  94. check_git_config.py
  95. check_grd_for_unused_strings.py
  96. clang-format-js
  97. DEPS
  98. diagnose-me.py
  99. DIR_METADATA
  100. download_optimization_profile.py
  101. gypv8sh.py
  102. include_tracer.py
  103. ipc_messages_log.py
  104. licenses.py
  105. make-gtest-filter.py
  106. multi_process_rss.py
  107. nocompile_driver.py
  108. omahaproxy.py
  109. OWNERS
  110. perry.py
  111. remove_duplicate_includes.py
  112. remove_stale_pyc_files.py
  113. roll_webgl_conformance.py
  114. run-swarmed.py
  115. sort-headers.py
  116. sort_sources.py
  117. uberblame.py
  118. unused-symbols-report.py
  119. update_pgo_profiles.py
  120. yes_no.py