Commit graph

50 commits

Author SHA1 Message Date
Evan Shrubsole
db50b03553 Add perfetto build config
This adds Perfetto support to WebRTC with a GN flag rtc_use_perfetto.
The configuration of perfetto depends on whether or not webrtc is
build within Chrome or not. When in Chrome, WebRTC will depend on
//third_party/perfetto:libperfetto. When building standalone, specific includes required for Perfetto are exposed with the library webrtc_libperfetto.

The perfetto trace API is exposed with a header export in
trace_event.h which is used instead of the legacy API.

The addition of Perfetto means there are 4 compilation modes for
tracing in WebRTC,
1. No tracing implementation.
2. Legacy tracing (AddTraceEvent/GetCategoryEnabled).
3.a. Perfetto statically linked (webrtc_libperfetto).
3.b. Perfetto in Chrome (Chrome's libperfetto).

This CL removes the tracing expectations from
rtc_stats_integrationtest.cc because those directly used the old API.

Integration into Chrome is a follow up CL which depends on
https://chromium-review.googlesource.com/c/chromium/src/+/5471691.

Tested: Ran Chrome with Perfetto and traces appear. WebRTC Unit test tracing working: https://ui.perfetto.dev/#!?s=04ea2613ea36b814394639a1ec4b60be5b5097527f1a485995ecc13469885468
Bug: webrtc:15917
Change-Id: I537d79dc247c2b759689910c621087286a4d8fdc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347880
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@google.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mikhail Khokhlov <khokhlov@google.com>
Cr-Commit-Position: refs/heads/main@{#42166}
2024-04-24 20:53:23 +00:00
Danil Chapovalov
8144935b78 Replace WebRTC-QuickPerfTest field trial with similar named dedicated test flag
Bug: webrtc:7101
Change-Id: I4034f90fdd3456c1d09981142ad494ad150f7b94
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/322801
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40901}
2023-10-10 12:20:33 +00:00
Danil Chapovalov
f2443a7971 Replace WebRTC-QuickPerfTest field trial with a flag
This field trial is configured via command line flag, so may use flag system directly, reducing dependency on global field trial string.

Bug: webrtc:7101, webrtc:10335
Change-Id: I1e48e0e3fdc251b73a375c6d7f1a46fa4f8a179b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/322624
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40897}
2023-10-10 08:59:10 +00:00
Mirko Bonadei
b6e8c2e393 Make iOS tests read --webrtc_test_metrics_output_path.
Differently from the ChromePerfDashboardMetricsExporter, this new flag
doesn't default to storing the output file to NSDocumentDirectory (and
with a default name, for example perftest-output.pb) but instead
just stores the file at the location specified by --webrtc_test_metrics_output_path.

Bug: b/237982523
Change-Id: Ibb504fdbc94ca5179f4b3da5b06d8cea82140140
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/286280
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38807}
2022-12-05 09:57:03 +00:00
Mirko Bonadei
b4f87e5048 Move declaration of --export_perf_results_new_api.
By declaring and defining the flag in a separate and reusable library
it can be used by other main() implementations as well.

Bug: b/237982523
Change-Id: Ia5445ee6e85bc1d536bee2ddd842439f8832116b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285480
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#38765}
2022-11-29 16:11:33 +00:00
Jeremy Leconte
370ca9c52c Enable sharding for fuchsia bots.
* Add '--quick' argument to 'low_bandwidth_audio_test' even though it doesn't look like it makes much timing difference.
* Add sharding for 'svc_tests' and 'video_engine_tests'.

Change-Id: I6e3357954d18ad03ea9f62912dd77e0e1a74b97d
Bug: webrtc:14713
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285100
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#38748}
2022-11-28 19:39:08 +00:00
Mirko Bonadei
f71e87a71d Support --webrtc_test_metrics_output_path in test main().
Bug: b/260493525
Change-Id: Ic0ba5683abf467fe3671f2e673ce02867f3caf73
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284700
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38740}
2022-11-27 12:34:03 +00:00
Jeremy Leconte
e40bb38faa Revert "Do not log on stderr on Android tests."
This reverts commit c48a265346.

Reason for revert: logcat issue should be fixed with https://crrev.com/c/4055461.

Original change's description:
> Do not log on stderr on Android tests.
>
> On Pixel 2, this causes an increase in flakiness. This needs to be
> reenabled once the root cause is fixed.
>
> Bug: chromium:1384172, b/259113795
> Change-Id: Ie94d3e2daad3a2de5af673c763362ea1b42fde7d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283522
> Reviewed-by: Jeremy Leconte <jleconte@google.com>
> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38623}

Bug: chromium:1384172, b/259113795
Change-Id: Iadd7c484f4e73deea952df7980acc0164c96a592
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285021
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#38731}
2022-11-25 06:34:22 +00:00
Jeremy Leconte
c6ae33fb07 Replace dash by underscore in the command line argument before absl flag parsing.
The expected behavior is to have something similar than python:
https://docs.python.org/dev/library/argparse.html#dest:
"Any internal - characters will be converted to _ characters to make sure the string is a valid attribute name".

This allows to catch chromium arguments like 'isolated-script-test-output' that previously needed some preprocessing done for example in flags_compatibility.py.

This CL also fixes a fuchsia specific issue where the test runner needs a 'isolated-script-test-output' argument but then pass the argument to WebRTC that expects a 'isolated_script_test_output' argument. Thus calling flags_compatibility before the test_runner fails and there is not much room to change the argument in between the test runner and the test.

Change-Id: I48a591743fa50484a0ec584a3f9e97d9e0fd25ef
Bug: webrtc:14694
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284541
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38707}
2022-11-22 11:03:33 +00:00
Mirko Bonadei
c48a265346 Do not log on stderr on Android tests.
On Pixel 2, this causes an increase in flakiness. This needs to be
reenabled once the root cause is fixed.

Bug: chromium:1384172, b/259113795
Change-Id: Ie94d3e2daad3a2de5af673c763362ea1b42fde7d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283522
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38623}
2022-11-15 12:24:32 +00:00
Artem Titov
f863182ce5 Migrate test_main_lib on new global metrics API
Bug: b/246095034
Change-Id: I99cd631cdae49ad1e0812f1204a6be4d6f43bc34
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276604
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38184}
2022-09-23 19:22:37 +00:00
Artem Titov
f5808fc4c5 Enable support for both new and old perf metrics export APIs
Make it possible to use both APIs inside same test and have consistent
export results to the Chrome Perf Dashboard and stdout.

Bug: b/246095034
Change-Id: I924088a2ddcb04981e56bbeb4544ac317833fb98
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276540
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#38177}
2022-09-23 11:24:57 +00:00
Artem Titov
3680605caa [PCLF] Enable exporting of perf metric via new API
Bug: b/246095034
Change-Id: I05f28e5dfc6df793c035110f89d9ac40783687f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276267
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38161}
2022-09-21 15:55:09 +00:00
Mirko Bonadei
054ea47379 Move common test flags to a separate library.
This enables the possibility to use these flags from other main
functions.

Bug: b/217701950, b/238157120
Change-Id: I6e9f09c4be39b2ac690c8e6b6da380ef3c81f460
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269140
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37582}
2022-07-21 09:52:54 +00:00
Mirko Bonadei
507e3bc406 Remove redundant close().
Bug: None
Change-Id: I975f14a4308530e37cc3faba67d8545ed3feffa8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269005
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37581}
2022-07-21 09:49:14 +00:00
Niels Möller
83830f316e Delete TestListener and top-level thread wrapping.
Instead use rtc::AutoThread in tests that need that.

Bug: webrtc:9714
Change-Id: I1f33b1b2d321770d062504dd9ef86d66a345dd42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254681
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36950}
2022-05-20 15:21:21 +00:00
Ali Tofigh
2ab914c6ab Adopt absl::string_view in rtc_base/ (straightforward cases)
Bug: webrtc:13579
Change-Id: I240db6285abb22652242bc0b2ebe9844ec4a45f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258723
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36561}
2022-04-17 12:11:56 +00:00
Jeremy Leconte
d15f3e1220 Prepare the code to run ios tests with the standalone recipe.
The flags isolated-script-test-output and isolated-script-test-perf-output need to be consumed by the tests.

The generated .app folder in added in the data list of the gni file.
This will make it available in the runtime_deps file and thus will be populated to the swarming tasks.

Bug: webrtc:13556
Change-Id: I2c75774b847d9f686c3abc00ba0400bbc3fcefae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/240520
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Christoffer Jansson <jansson@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#36029}
2022-02-18 12:57:42 +00:00
Jeremy Leconte
994bf454ec Revert of flag simplification.
In order to unify WebRTC recipes with Chromium recipes this CL tries to revert the old CL https://webrtc-review.googlesource.com/c/src/+/171681.
This CL was already partially reverted (https://webrtc-review.googlesource.com/c/src/+/171809).
In upcoming CLs, the added flag dump_json_test_results will be removed in order to use isolated-script-test-output instead.

Bug: webrtc:13556
Change-Id: I3144498b9a5cbaa56c23b3b8adbac2229ad63c37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245602
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#35666}
2022-01-12 10:53:12 +00:00
Artem Titov
bcb42f1e4b Move initialization of GoogleMock and flags to main from test_main_lib
Bug: None
Change-Id: Ie3aed382d4e468c4adbfdbcc1bdb3f069d3eaae2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181364
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31909}
2020-08-11 11:46:50 +00:00
Tommi
ec3ba734e9 Don't wrap the main thread when running death tests.
Also re-enable the TestAnnotationsOnWrongQueueDebug test and rename
the test suite to SequenceCheckerDeathTest so that it gets executed
before other tests.

Bug: webrtc:11577
Change-Id: I3b8037644e4b9139755ccecb17e42b09327e4996
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175346
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31290}
2020-05-17 17:15:10 +00:00
Tommi
9b7232a68c Set up a new rtc::Thread instance per test.
Several tests leave pending tasks behind after executing, which may
affect the state of subsequent tests. This CL isolates each test in
the sense that a dedicated Thread instance is created per test and
then pending tasks are flushed and the Thread instance deleted.

Down the line we may want to improve on this and flag those tests
that leave pending tasks/timers etc.

Change-Id: Ibaf3719a9974c57ac2169edca0e2a06a9ea6c78f
Bug: webrtc:11574
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175132
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31268}
2020-05-15 09:13:02 +00:00
Patrik Höglund
a7a0173713 Remove the histogram flag and all Chart JSON code.
Since the flag is now on by default, we can remove it (after all
callers stop passing it).

We can also remove all Chart JSON code from WebRTC since it is
no longer used.

Requires one recipe CL and one downstream CL to land first.

Bug: chromium:1029452
Change-Id: Ic1d62e8ab9dfcd255cd2bf51d153db80d59c564b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171878
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30927}
2020-03-28 13:44:43 +00:00
Patrik Höglund
1b20c41dcb Greatly simplify flags for test binaries.
Since we're now calling the shots of what flags get passed in the
recipes, we can just pass the right ones right away and remove all
the flag renaming.

--isolated-script-test-output is no longer passed, so we can just
remove it. The recipe is currently passing
--isolated-script-perf-test-output but I will start passing the
underscore version shortly.

Bug: chromium:1051927
Change-Id: I571090e62f79ea17c793295df7f5abb21f45d207
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171681
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30878}
2020-03-25 09:56:07 +00:00
Patrik Höglund
3428827c40 Write pb perf output files on iOS.
Bug: chromium:1029452
Change-Id: I8cc44630109292b9ad1ab7d03b34c2c5e1b953fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170980
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30827}
2020-03-19 08:58:57 +00:00
Patrik Höglund
b8e69efcee Write protos as binary.
We need to write protos as "wb" and not "w", otherwise we get CRLF
on Windows which corrupts the proto.

Bug: chromium:1029452
Change-Id: Iabf841405134d7bc2523ac48219ca7cb9d8214c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170320
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30772}
2020-03-12 09:43:57 +00:00
Artem Titov
694b74b826 Fix export of plottable metrics on iOS
Bug: None
Change-Id: I12c3cecb92e5f163f9451d6f90de3bce9b15bca1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168942
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30580}
2020-02-21 10:48:35 +00:00
Yves Gerey
071d025929 Activate event tracing for unit tests. For good!
The --trace_event=file.json option allows to log events,
for further inspection in chromium event viewer.

Previous handling of this option was broken,
closing the logger before the tests were even run.

Bug: webrtc:10926
Change-Id: I9123d12666b5f254feeaef685def96eb8ba1c7f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167720
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#30401}
2020-01-29 10:11:34 +00:00
Patrik Höglund
2bc1ea0b36 Remove the fileutils hack for good.
Or, well, to be fair it still kind of does the same thing, but
the thing it's (void)ing in is a lot more related to what it
actually happening. I could not find another way to solve this
since fileutils is fundamentally optional to unit tests, but the
flag isn't.

Bug: webrtc:9792
Change-Id: I6ebf012246bc259883bc0aaf73ac7fea5525dd1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157101
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29501}
2019-10-16 13:40:39 +00:00
Patrik Höglund
844600e8a4 Put the resources_dir flag into its own target.
I had to change approach. Unfortunately we can't expect
that test_main_lib users link with fileutils, which causes it to
not link when the override symbol is missing.

New approach: resources_dir_flag is now a separate target, it
will be depended upon by the downstream override, which just
reads the flag and returns it as the resource dir. This gets
rid of the mutable state downstream as well.

So:
1) Land this
2) Make downstream read the flag instead of keeping its own state
3) Remove OverrideResourcesDir upstream and clean up the hacks
4) Remove the now orphaned OverrideResourcesDir downstream

Bug: webrtc:9792
Change-Id: Ic2ef3910bb5d39d9fb71e06fbbbb6aec4de52e78
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157041
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29487}
2019-10-15 11:45:20 +00:00
Patrik Höglund
2f28370e65 Move --resources_dir to its right place.
We needed a hack in test_main_lib.cc to ensure fileutils were always
linked with test binaries downstream. When I removed the hack, it
broke the binaries that were _not_ using fileutils because a certain
bazel rule expects to be able to pass the flag to all test binaries.

The solution is to move the flag to test_main_lib.cc. This is the
right place for it since it's apparently in the contract of a WebRTC
test binary to support this flag. We then have to pass the value
down to the override, which is why I add a new function for that.
I leave the flag unimplemented in OSS because no one is using it
here anyway. It will be implemented downstream.

Bug: webrtc:9792
Change-Id: I21b3deb43bf0cd56d6aa2622dc5519370a0307a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156568
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29474}
2019-10-15 07:20:56 +00:00
Patrik Höglund
f83d0ef085 Revert "Remove an old hack from test_main_lib.cc."
This reverts commit 5114a927aa.

Reason for revert: Breaks downstream.

Original change's description:
> Remove an old hack from test_main_lib.cc.
> 
> Bug: webrtc:9792
> Change-Id: I0464f08bcc023dcbcaec595fc9ebb5bfe0736f68
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155441
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29376}

TBR=phoglund@webrtc.org,nisse@webrtc.org

Change-Id: I40f563fa3fc6ab289d72a1e7d9e4fb3fdc2669ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9792
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155584
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29380}
2019-10-04 10:08:46 +00:00
Patrik Höglund
5114a927aa Remove an old hack from test_main_lib.cc.
Bug: webrtc:9792
Change-Id: I0464f08bcc023dcbcaec595fc9ebb5bfe0736f68
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155441
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29376}
2019-10-04 07:19:05 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Artem Titov
087be5cfd4 Add ability to export internal state of SamplesStatsCounter.
Add ability to export internal state of SamplesStatsCounter to be able
then to plot that data.

Bug: webrtc:10138
Change-Id: I5aae5b7dea2989e9f82820933a9ab6f21db17556
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152542
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29173}
2019-09-12 19:04:58 +00:00
Yves Gerey
050e38f7c4 Add --trace_event option to capture events in unit tests.
Usage example:
  % out/head/modules_unittests --gtest_filter="MyTest" --trace_event=trace_event.json

The resulting file can be uploaded into chrome for nice visualization
(chrome://tracing).

Bug: webrtc:10926
Change-Id: I420b9dff0626126f25e993fd31c3f2622329f858
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150647
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#28982}
2019-08-28 12:26:51 +00:00
Mirko Bonadei
2ab97f6f8e Migrate WebRTC test infra to ABSL_FLAG.
This is the last CL required to migrate WebRTC to ABSL_FLAG, rtc::Flag
will be removed soon after this one lands.

Bug: webrtc:10616
Change-Id: I2807cec39e28a2737d2c49e2dc23f2a6f98d08f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145727
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28606}
2019-07-19 06:54:04 +00:00
Jonas Olsson
5b2eda4895 Sanity-check field trial string at initialization.
It's easy to make small errors when building field trial strings, and
those errors can cause all sorts of weird problems. This CL checks if
the FT string has an odd number of delimiters, duplicate
names or any trailing chars.

If so we'll log a error message. On debug builds we'll also crash.

Bug: webrtc:10729
Change-Id: Iebf7155d9b117a02d1e9cfe7f64408e11df2aec5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140866
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28234}
2019-06-11 14:11:06 +00:00
Anton Sukhanov
8b096a03b4 LogToSderr by default in WebRTC tests
Printing logs to stderr helps debugging and investigating CQ failures.

Bug: webrtc:5996
Change-Id: I365ee0a0b3ff3d999f1a9a293d3c05bd75e5b999
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138187
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Anton Sukhanov <sukhanov@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28065}
2019-05-24 19:39:18 +00:00
Niels Möller
04a3cc1ad9 Delete rtc_base/unittest_main.cc
Usage replaced with test/test_main.cc.

Bug: webrtc:5996
Change-Id: I65e7539f2072fb45255a3c1af0b10dd06e1701ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137805
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28010}
2019-05-21 14:44:11 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Niels Möller
d0def19069 Add --verbose flag to test_main
Bug: None
Change-Id: Iec85fc59a13bde92e866e468ac451822e4fb82e1
Reviewed-on: https://webrtc-review.googlesource.com/c/115409
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26083}
2018-12-21 11:59:40 +00:00
Yves Gerey
3e70781361 [Cleanup] Add missing #include. Remove useless ones. IWYU part 2.
This is a follow-up to
https://webrtc-review.googlesource.com/c/src/+/106280.
This time the whole code base is covered.
Some files may have not been fixed though, whenever the IWYU tool
was breaking the build.

Bug: webrtc:8311
Change-Id: I2c31f552a87e887d33931d46e87b6208b1e483ef
Reviewed-on: https://webrtc-review.googlesource.com/c/111965
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25830}
2018-11-28 18:25:07 +00:00
Mirko Bonadei
2dfa998be2 Reland "Prefix flag macros with WEBRTC_."
This is a reland of 5ccdc1331f

Original change's description:
> Prefix flag macros with WEBRTC_.
>
> Macros defined in rtc_base/flags.h are intended to be used to define
> flags in WebRTC's binaries (e.g. tests).
>
> They are currently not prefixed and this could cause problems with
> downstream clients since these names are quite common.
>
> This CL adds the 'WEBRTC_' prefix to them.
>
> Generated with:
>
> for x in DECLARE DEFINE; do
>   for y in bool int float string FLAG; do
>     git grep -l "\b$x\_$y\b" | \
>     xargs sed -i "s/\b$x\_$y\b/WEBRTC_$x\_$y/g"
>   done
> done
> git cl format
>
> Bug: webrtc:9884
> Change-Id: I7b524762b6a3e5aa5b2fc2395edd3e1a0fe72591
> Reviewed-on: https://webrtc-review.googlesource.com/c/106682
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25270}

TBR=kwiberg@webrtc.org

Bug: webrtc:9884
Change-Id: I5ba5368a231a334d135ed5e6fd7a279629ced8a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/107161
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25277}
2018-10-19 15:06:43 +00:00
Mirko Bonadei
c538fc77b0 Revert "Prefix flag macros with WEBRTC_."
This reverts commit 5ccdc1331f.

Reason for revert: Breaks downstream project.

Original change's description:
> Prefix flag macros with WEBRTC_.
> 
> Macros defined in rtc_base/flags.h are intended to be used to define
> flags in WebRTC's binaries (e.g. tests).
> 
> They are currently not prefixed and this could cause problems with
> downstream clients since these names are quite common.
> 
> This CL adds the 'WEBRTC_' prefix to them.
> 
> Generated with:
> 
> for x in DECLARE DEFINE; do
>   for y in bool int float string FLAG; do
>     git grep -l "\b$x\_$y\b" | \
>     xargs sed -i "s/\b$x\_$y\b/WEBRTC_$x\_$y/g"
>   done
> done
> git cl format
> 
> Bug: webrtc:9884
> Change-Id: I7b524762b6a3e5aa5b2fc2395edd3e1a0fe72591
> Reviewed-on: https://webrtc-review.googlesource.com/c/106682
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25270}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org

Change-Id: Ia79cd6066ecfd1511c34f1b30fd423e560ed6854
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9884
Reviewed-on: https://webrtc-review.googlesource.com/c/107160
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25276}
2018-10-19 15:04:13 +00:00
Yves Gerey
53347b7d66 Mute failed tests when no sanitizer defects.
We want sanitizer bots to show failure only for sanitizer defects.
To do so, this CL forces exit code to 0 unconditionally.
Sanitized binaries will turn it to 66 if there is any defect with diagnostic.

Bug: webrtc:9849
Change-Id: I46b683dcae12b76f1be177603af59e3f34bff3a9
Reviewed-on: https://webrtc-review.googlesource.com/c/107060
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25273}
2018-10-19 13:50:35 +00:00
Mirko Bonadei
5ccdc1331f Prefix flag macros with WEBRTC_.
Macros defined in rtc_base/flags.h are intended to be used to define
flags in WebRTC's binaries (e.g. tests).

They are currently not prefixed and this could cause problems with
downstream clients since these names are quite common.

This CL adds the 'WEBRTC_' prefix to them.

Generated with:

for x in DECLARE DEFINE; do
  for y in bool int float string FLAG; do
    git grep -l "\b$x\_$y\b" | \
    xargs sed -i "s/\b$x\_$y\b/WEBRTC_$x\_$y/g"
  done
done
git cl format

Bug: webrtc:9884
Change-Id: I7b524762b6a3e5aa5b2fc2395edd3e1a0fe72591
Reviewed-on: https://webrtc-review.googlesource.com/c/106682
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25270}
2018-10-19 10:55:20 +00:00
Mirko Bonadei
bc6a06c058 Adding missing #include on absl/memory/memory.h.
These two files were using absl::make_unique without #including the
header that declares it.

Bug: None
Change-Id: I03019c9a7e06370631680b474d04dd33716b0fe3
Reviewed-on: https://webrtc-review.googlesource.com/c/107041
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25266}
2018-10-19 09:14:01 +00:00
Artem Titov
b5541a0023 Fix: Argv may be corrupted after InitGoogleMock found any related flags
Bug: webrtc:5996
Change-Id: I42f3c7eef990e06f89d7c847b0ccc89abe257111
Reviewed-on: https://webrtc-review.googlesource.com/c/106707
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25244}
2018-10-18 07:40:13 +00:00
Artem Titov
40a7a35eaa Extract functionality of test_main into separate library.
Extract functionality of test_main into separate library to be able to
reuse it if another main will be required.

Bug: webrtc:5996
Change-Id: I2925b4240bd0e4fb884b43bb16667ca2d6216bbd
Reviewed-on: https://webrtc-review.googlesource.com/c/105921
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25172}
2018-10-15 14:13:06 +00:00