Repository navigation
Unit & feature tests infrastructure - #12199
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
|
Thanks. I'll start going through this one. |
lumachad
left a comment
There was a problem hiding this comment.
Left some high level comments of what we should change. Mostly cleaning up the license headers and polishing up the GoogleTest/GMock/etc dependency discovery.
Downloading these dependencies wouldn't be acceptable I'm afraid.
4f83147 to
698323b
Compare
|
Looks like we have conflicts. |
|
@motokultivator FTR, I'm waiting for these conflicts to be cleaned up before I do another review. |
698323b to
6cf87ce
Compare
Done. Sorry for the delay, I was OOO. |
|
@motokultivator Let's skip commit 2. What we want is just a clean cmake change that provides a way to build tests and then dummy examples of those tests in a second commit. After that is in, then we can start adapting dbgapi's code to be testable. For instance, the rocr-debug-agent unit testing effort: #12460 |
6cf87ce to
b202464
Compare
|
This is still adding much more than required for smoke tests. We need just the cmake changes and a dummy smoke test. |
b202464 to
0f75900
Compare
How about this: CMake, a project skeleton, a README, and a smoke test as an example? |
0f75900 to
d131d6c
Compare
d131d6c to
995db06
Compare
|
Labelling ci:skip until we pick up ROCm/TheRock#8943 |
amd-bfilipov
left a comment
There was a problem hiding this comment.
Gave this to my claude to compare this with similar PR that I have merged, by comparing comments on that PR and if any of those are applicable to this PR. None of them apply here and (or they have been addressed).
From my perspective, looks good, approved.
|
Blocked by ROCm/TheRock#8943. |
Introduce the build system plumbing required to host a GoogleTest based unit and feature test suite for rocdbgapi. ENABLE_TESTS is a master switch that enables all test tiers. ENABLE_UNIT_TESTS enables just the unit tier and can be toggled independently, matching the pattern used by rocr-debug-agent's ENABLE_TESTS and ENABLE_UNIT_TESTS options. Both default OFF so downstream consumers (e.g. TheRock superbuild) are not forced to pick up GoogleTest/GMock until they opt in with -DENABLE_TESTS=ON. Reusable helpers register unit test executables uniformly. GoogleTest resolution prefers GTest::* targets already provided by a parent project (e.g. TheRock superbuild) and otherwise uses find_package(GTest CONFIG) to locate a system installation. All four targets (gtest, gtest_main, gmock, gmock_main) must be present. Incomplete installations fail with clear error messages and installation instructions. test/CMakeLists.txt and test/unit/CMakeLists.txt define the test tree skeleton and per target registration scaffolding. A minimal smoke test exercises both GoogleTest and GMock as an example for usage. Built unit test binaries install under tests/rocdbgapi relative to CMAKE_INSTALL_PREFIX. All new CMake files use SPDX license headers (MIT). Building the test suite requires GoogleTest and GMock, only when opted in. The main README documents this as a build prerequisite with per distro package names, and test/README.md documents the test tree layout, build switches, and usage without repeating that material. The CHANGELOG records the new dependency and options. Co-Authored-By: Luis Machado <luis.machado@amd.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
995db06 to
6d23843
Compare
|
Disabled tests by default and merged, so we don't stay blocked by #8943. |
Introduce the build system plumbing required to host a GoogleTest based unit and feature test suite for rocdbgapi. ENABLE_TESTS is a master switch that enables all test tiers. ENABLE_UNIT_TESTS enables just the unit tier and can be toggled independently, matching the pattern used by rocr-debug-agent's ENABLE_TESTS and ENABLE_UNIT_TESTS options. Both default OFF so downstream consumers (e.g. TheRock superbuild) are not forced to pick up GoogleTest/GMock until they opt in with -DENABLE_TESTS=ON. Reusable helpers register unit test executables uniformly. GoogleTest resolution prefers GTest::* targets already provided by a parent project (e.g. TheRock superbuild) and otherwise uses find_package(GTest CONFIG) to locate a system installation. All four targets (gtest, gtest_main, gmock, gmock_main) must be present. Incomplete installations fail with clear error messages and installation instructions. test/CMakeLists.txt and test/unit/CMakeLists.txt define the test tree skeleton and per target registration scaffolding. A minimal smoke test exercises both GoogleTest and GMock as an example for usage. Built unit test binaries install under tests/rocdbgapi relative to CMAKE_INSTALL_PREFIX. All new CMake files use SPDX license headers (MIT). Building the test suite requires GoogleTest and GMock, only when opted in. The main README documents this as a build prerequisite with per distro package names, and test/README.md documents the test tree layout, build switches, and usage without repeating that material. The CHANGELOG records the new dependency and options. Co-Authored-By: Luis Machado <luis.machado@amd.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> [rocm-systems] ROCm/rocm-systems#12199 (commit f9a7ae7)
TheRock Submodule Bump ActivityNewest first
|
Summary
Introduces the build system plumbing required to host a GoogleTest-based unit and feature test suite for rocdbgapi.
ENABLE_TESTSis a master switch enabling all test tiers;ENABLE_UNIT_TESTSenables just the unit tier and can be toggled independently, matching the pattern already used by rocr-debug-agent. Both default OFF so downstream consumers (e.g. the TheRock superbuild) are not forced to pick up GoogleTest/GMock until they opt in with-DENABLE_TESTS=ON.GTest::*targets already provided by a parent project (e.g. the TheRock superbuild), falling back tofind_package(GTest CONFIG)for a system installation. All four targets (gtest,gtest_main,gmock,gmock_main) must be present; incomplete installations fail with clear error messages and installation instructions.test/CMakeLists.txtandtest/unit/CMakeLists.txtdefine the test tree skeleton and per-target registration scaffolding. A minimal smoke test exercises both GoogleTest and GMock as a usage example.tests/rocdbgapirelative toCMAKE_INSTALL_PREFIX.Building the test suite requires GoogleTest and GMock, only when opted in with
-DENABLE_TESTS=ON. The main README documents this as a build prerequisite with per-distro package names, andtest/README.mddocuments the test tree layout, build switches, and usage without duplicating that material. The CHANGELOG records the new dependency and options.ISSUE ID : AIROCGDB-634
Test plan
ENABLE_TESTS=ONand confirm the smoke test builds and passesENABLE_TESTS=ON -DENABLE_UNIT_TESTS=OFFand confirm behavior matches rocr-debug-agent's patterntests/rocdbgapi🤖 Generated with Claude Code