Add neat includes for src and test code#53
Open
gomathishankar37 wants to merge 4 commits intodevelopfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR simplifies header include statements across the unit tests and C implementation by switching from long relative paths (e.g., ../.../common/types.h) to short includes (e.g., "types.h"), and updates the autotools include paths so the compiler can resolve those headers.
Changes:
- Replaced relative
#includepaths inunittest/*.cppwith short quoted includes. - Replaced relative
#includepaths inc_sourcecode/src/**with short quoted includes. - Expanded/adjusted
AM_CPPFLAGSin bothunittest/Makefile.amandc_sourcecode/src/Makefile.amto include the needed source subdirectories.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| unittest/utils_gtest.cpp | Switches C header includes to short names (relies on updated include paths). |
| unittest/upload_gtest.cpp | Same include-path simplification for upload-related headers. |
| unittest/upload_gmock.cpp | Same include-path simplification for common types header. |
| unittest/scanner_gtest.cpp | Same include-path simplification for scanner + common headers. |
| unittest/scanner_gmock.cpp | Same include-path simplification for common types header. |
| unittest/ratelimit_gtest.cpp | Same include-path simplification for ratelimit + types headers. |
| unittest/prerequisites_gtest.cpp | Same include-path simplification for prerequisites + common headers. |
| unittest/platform_gtest.cpp | Same include-path simplification for platform + common headers. |
| unittest/mainapp_test_fixture.h | Same include-path simplification for init + common headers. |
| unittest/mainapp_gmock.cpp | Same include-path simplification for common headers used by mocks. |
| unittest/lock_manager_gtest.cpp | Same include-path simplification for lock_manager header. |
| unittest/config_manager_gtest.cpp | Same include-path simplification for config + RFC interface header. |
| unittest/archive_gtest.cpp | Same include-path simplification for archive + common headers. |
| unittest/Makefile.am | Adds required -I entries so unit tests can use short includes. |
| c_sourcecode/src/utils/prerequisites.h | Switches types.h include to short form. |
| c_sourcecode/src/utils/prerequisites.c | Switches errors.h include to short form. |
| c_sourcecode/src/utils/cleanup_batch.h | Switches types.h include to short form. |
| c_sourcecode/src/utils/cleanup_batch.c | Switches errors.h include to short form. |
| c_sourcecode/src/upload/upload.c | Switches RFC interface + logger includes to short form. |
| c_sourcecode/src/t2Interface/telemetryinterface.c | Switches logger include to short form. |
| c_sourcecode/src/scanner/scanner.h | Switches types.h include to short form. |
| c_sourcecode/src/scanner/scanner.c | Switches types.h + logger includes to short form. |
| c_sourcecode/src/rfcInterface/rfcinterface.c | Switches logger include to short form. |
| c_sourcecode/src/rbusInterface/rbus_interface.c | Switches logger include to short form. |
| c_sourcecode/src/ratelimit/ratelimit.c | Switches logger include to short form. |
| c_sourcecode/src/platform/platform.h | Switches types.h include to short form. |
| c_sourcecode/src/platform/platform.c | Switches errors.h + logger includes to short form. |
| c_sourcecode/src/main.c | Switches many internal includes to short form; updates telemetry header include. |
| c_sourcecode/src/init/system_init.h | Switches types.h include to short form. |
| c_sourcecode/src/init/system_init.c | Switches common + internal module includes to short form. |
| c_sourcecode/src/config/config_manager.h | Switches types.h include to short form. |
| c_sourcecode/src/config/config_manager.c | Switches common + interface includes to short form. |
| c_sourcecode/src/archive/archive_crash.h | Switches types.h include to short form. |
| c_sourcecode/src/archive/archive.c | Switches logger include to short form. |
| c_sourcecode/src/Makefile.am | Adds needed -I entries (notably -I$(top_srcdir)/src and additional module dirs) to support short includes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.