Enable testing via CTest (#8737)
Convenience feature: enable users to test via the familiar `ctest` command rather than making the `check` target.
They would be able to use the familiar CMake pattern:
```
cmake -S source/protobuf -B build/protobuf ...
cmake --build build/protobuf
ctest --test-dir build/protobuf
cmake --install build/protobuf
```
This is a follow-up to 9f447fc9d3da93da29b8301f1a8ca57b1ea812d7
diff --git a/cmake/tests.cmake b/cmake/tests.cmake
index 2c9e38e..7a359e2 100644
--- a/cmake/tests.cmake
+++ b/cmake/tests.cmake
@@ -255,3 +255,7 @@
COMMAND tests
DEPENDS tests test_plugin
WORKING_DIRECTORY ${protobuf_source_dir})
+
+add_test(NAME check
+ COMMAND tests
+ WORKING_DIRECTORY "${protobuf_source_dir}")