Commit Graph

13 Commits

Author SHA1 Message Date
aarongreen
e596056be5 pw_perf_test: Reogranize source files
This CL moves `internal::Framework`, `internal::TestInfo`, and `State`
out of pw_perf_test.h and into their own separate files.

It also moves performance_test_generic.cc to
examples/example_perf_test.cc.

Finally, it removes perf_test_test.cc as this file created a no-op unit
test.

Change-Id: Id5e984cdf80bb7ed801be1f81ebb8cba8c05b91b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/178914
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Aaron Green <aarongreen@google.com>
2023-11-10 22:56:41 +00:00
aarongreen
5a7749d1f5 googletest: Fix some deps to work with upstream GoogleTest
This CL adds a few deps that are implicitly added by pw_unit_test.light,
but are needed when using upstream GoogleTest, e.g. when using

cmake ... \
  -Ddir_pw_third_party_googletest=/src.mtv/googletest \
  -Dpw_unit_test_GOOGLETEST_BACKEND=pw_third_party.googletest

Change-Id: I19c3e55c906f8a3cd82c5f2476f0b9d38b9b076f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/146213
Commit-Queue: Aaron Green <aarongreen@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2023-05-12 01:02:54 +00:00
Brian Barcenas
35714d4ced pw_perf_test: Added PW_PERF_TEST macro and its supporting components
Change-Id: I7dd3e7a1b5a48b38457647fc3fdbc8dd422f1934
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/118111
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Brian Barcenas <bbarcenas@google.com>
2022-12-03 02:32:03 +00:00
Brian Barcenas
23304eb9d5 pw_perf_test: State object support
Introducing the state object, which manages iterations and timings of
the tests.

Change-Id: I3dca90878681ba816aa15d7ef85b6423a6391140
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/114550
Commit-Queue: Brian Barcenas <bbarcenas@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2022-11-21 22:28:58 +00:00
Ewout van Bekkum
3ff13e2f5d pw_build/cmake: Migrate pw_add_module_facade -> pw_add_facade
Renames pw_add_module_facade to be named pw_add_facade. In addition,
it is updated to take a library type argument like pw_add_library.

Change-Id: I91e2b41cb1560b4a50ab2576f80a55c7ea1439ae
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/119450
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2022-11-15 18:16:52 +00:00
Ewout van Bekkum
b44a2d723a pw_build/cmake: Migrate pw_add_module_library -> pw_add_library
Updates pw_add_library to replace pw_add_module_library where
the library type must be explicitly specified, just like
pw_add_library_generic.

Migrates all pw_add_module_library uses to pw_add_library.

Change-Id: I62efdeca1e227a3c82667cac5e46fe383c280cc2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/119318
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2022-11-15 02:09:30 +00:00
Ewout van Bekkum
9710dafae1 cmake/pw_add_module_library: Remove use of IMPLEMENTS_FACADES
Removes the "magic" argument of pw_add_module_library which
internally adds the public_override directory which may be wrong
and links in the facade target even when not needed. Instead this
updates the CMake build to match GN and Bazel more closely and
permits explicit and concise build rules.

Change-Id: Ic6811880bd978b291c82feb31ccf007a10fface4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/117473
Reviewed-by: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-11-11 17:41:41 +00:00
Ewout van Bekkum
91a55b140d cmake: Migrate all facades to use BACKEND variables
Migrates all CMake facades to use BACKEND variables which are
defined in backend.cmake variables, similar to GN.

Change-Id: I63dd1a81aa0a796366f6c78c4823e6081a6463f1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/117413
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
2022-11-10 17:49:56 +00:00
Ewout van Bekkum
904bdf432d pw_build/cmake: Enable separate backend variable declarations
Extends the CMake facade API to mirror GN in its ability to specify
facade backend variables separate from the facade library
declarations. Outside of making this more consistent with the GN
build, this also enables enable_if for unit tests in the future.

As part of this backend variables for facades are no longer set to
{NAME}.NO_BACKEND_SET by default and instead are set to empty
strings if unset.

Change-Id: Ie0669c702a15a462cef92d546ad28ca945b71027
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/117412
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2022-11-10 16:22:42 +00:00
Ewout van Bekkum
b7088f6833 pw_build/cmake: Rename pw_add_facade to pw_add_module_facade
Renames pw_add_facade which is specific to upstream Pigweed
modules to be named pw_add_module_facade instead to mirror
pw_add_module_library's naming. This naming may not be final,
however makes it possible to enable a generic facade function
which is usable in downstream projects.

Change-Id: Ied33f81a869659bad4d55f9ce1dd59246e659fce
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/117411
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-11-09 17:40:41 +00:00
Ewout van Bekkum
bec5c02a01 pw_add_test: Migrate upstream pw_add_test to use PRIVATE_DEPS
Migrates all upstream pw_add_test instantiations outside of the
pw_auto_add_simple_module stamped ones to use PRIVATE_DEPS
instead of DEPS.

Change-Id: I1c7df0ec69cc265fb9b7fc4560a2bd99bca1419f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116365
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2022-11-04 17:41:59 +00:00
Brian Barcenas
fbd6d5d792 pw_perf_test: Added internal timing facade + backend
pw_perf_test now has a backend for which it will use
to time the tested components. This update includes
an implementation with pw_chrono, which will be used
for time-based measurements(nanoseconds).

Change-Id: I9a1bb9cf0964caa4d911a1c7c016bab3a41f1e32
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/113890
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Brian Barcenas <bbarcenas@google.com>
Reviewed-by: Erik Gilling <konkers@google.com>
2022-10-20 21:24:39 +00:00
Brian Barcenas
051673443f pw_perf_test: Initialized using pw module create
pw_perf_test is an upcoming module that will be similar to unit_test
but will instead display performance data. A small overview of the
timing interface is provided in pw_perf_test/docs.rst.

Change-Id: I74798931b769e99b3b4c7822c9b467db96b7883c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112971
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Brian Barcenas <bbarcenas@google.com>
2022-10-10 18:20:10 +00:00