-
Notifications
You must be signed in to change notification settings - Fork 0
CI/CD - update to use CMakeLib v1.2.0 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
abde0c4
CI/CD - update to use CMakeLib v1.2.0
koudis 54945d1
CI/CD - update to use CMakeLib v1.2.1
koudis b6071c1
CI/CD - update export to make it work without download
koudis 831762b
Fix Unix home tests
koudis 5ef60d6
Bullet proof variant of uninstall for Windows
koudis f51624f
Delete Windows USERPROFILE test
koudis 270a0d9
Test uninstall functionality explicitly.
koudis f93d66b
Make CI/CD work for Mac OS and Windows
koudis 1dd4498
README.md for tests added
koudis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # CMCONF Test Suite | ||
|
|
||
| Comprehensive test suite for the CMCONF (CMake Configuration Framework) component library. | ||
|
|
||
| ## Test Modules | ||
|
|
||
| Currently tested functionality | ||
|
|
||
| - **`CMCONF_SET`** - Configuration variable setting | ||
| - **`CMCONF_GET`** - Configuration variable retrieval | ||
| - **`CMCONF_INIT_SYSTEM`** - System name configuration | ||
| - **`INSTALL Feature`** - Configuration installation | ||
| - **`UNINSTALL Feature`** - Configuration uninstallation | ||
|
|
||
| Not covered functionality | ||
|
|
||
| - Edge cases for Windows OS regard of `reg` command behaviour. | ||
| It is expected that this command is available on Windows be default. | ||
| If not, not only CMake but also Windows itself is broken. | ||
|
|
||
| ### Test Structure | ||
|
|
||
| Tests are organized into subdirectories within `test_cases`, separated into: | ||
|
|
||
| - **`pass/`** - Tests that verify correct functionality and expected behavior | ||
| - **`fail/`** - Tests that verify proper error handling and validation | ||
|
|
||
| Each test case directory contains a `CMakeLists.txt` file that tests specific functionality. | ||
|
|
||
| Configuration templates and test resources are placed in the `config_templates` directory. | ||
|
|
||
| ## Test Framework | ||
|
|
||
| - `TEST.cmake` - Common test macros. It is reused from CMLIB. | ||
| - `cache_var.cmake` - Macros to force set and restore cache variables. It is reused from CMLIB. | ||
| - `test_cmconf_helpers.cmake` - CMCONF-specific test helper functions and macros | ||
|
|
||
| ### Test Resource Creation and Maintenance | ||
|
|
||
| When external resources are needed to test functionality: | ||
|
|
||
| - Configuration templates are provided in the `config_templates` directory | ||
| - Test configurations are created from predefined templates | ||
| - There are no external dependencies to download or install | ||
| - There shall be no dynamic creation of test resources during a test run (exceptions can apply if reasoned) | ||
|
|
||
| ## Running Tests | ||
|
|
||
| **All tests are designed to be run from a clean source tree.** | ||
|
|
||
| CMCONF is consistent and functional only when all tests pass. | ||
|
|
||
| Any test failure indicates CMCONF is not working as expected, even if the failure seems unrelated to required functionality. Complete system consistency is essential for reliable operation. | ||
|
|
||
| ### Run All Tests | ||
|
|
||
| Tests shall be run in Project and Script mode. | ||
|
|
||
| ```bash | ||
| # Project mode | ||
| git clean -xfd . | ||
| cmake . | ||
|
|
||
| # Script mode | ||
| git clean -xfd . | ||
| cmake -P ./test/CMakeLists.txt | ||
| ``` | ||
|
|
||
| ### Clean Up | ||
|
|
||
| ```bash | ||
| git clean -xfd . | ||
| ``` | ||
|
|
||
| ## Platform Considerations | ||
|
|
||
| Tests are designed to run on Linux-based systems as the main development platform. Platform-specific behavior is tested where applicable, particularly for: | ||
|
|
||
| - Unix home directory handling | ||
| - System-specific configuration paths (windows vs unix) | ||
| - Platform-specific variable behaviors |
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
21 changes: 0 additions & 21 deletions
21
test/test_cases/fail/windows_userprofile_missing/CMakeLists.txt
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
test/test_cases/fail/windows_userprofile_missing/test_config/CMakeLists.txt
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
test/test_cases/pass/uninstall_verification/CMakeLists.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ## Main | ||
| # | ||
| # Test that CMCONF uninstallation actually removes the package from registry | ||
| # | ||
| # Strategy: Single file for sequential state-dependent test | ||
| # Steps must execute in exact order with shared state. | ||
| # Splitting would require complex state passing and risk inconsistent cleanup on failures. | ||
| # | ||
|
|
||
| IF(NOT DEFINED CMAKE_SCRIPT_MODE_FILE) | ||
| CMAKE_MINIMUM_REQUIRED(VERSION 3.22) | ||
| PROJECT(CMCONF_UNINSTALL_VERIFICATION_TEST) | ||
| ENDIF() | ||
|
|
||
| FIND_PACKAGE(CMLIB REQUIRED) | ||
|
|
||
| INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../TEST.cmake") | ||
| INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../cache_var.cmake") | ||
| INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../../CMCONF.cmake") | ||
| INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../test_cmconf_helpers.cmake") | ||
| INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../config_templates/config_template.cmake") | ||
|
|
||
| TEST_CMCONF_CHECK_AND_INSTALL_CONFIG("${CMCONF_TEST_CONFIG_FILE}" "TEST") | ||
|
|
||
| SET(package_name "CMCONF_TEST") | ||
| FIND_PACKAGE(${package_name} QUIET) | ||
| IF(NOT ${package_name}_FOUND) | ||
| MESSAGE(FATAL_ERROR "Package ${package_name} should be found after installation, but it was not found") | ||
| ENDIF() | ||
|
|
||
| CMCONF_INIT_SYSTEM(TEST) | ||
| CMCONF_GET(VARIABLE_A) | ||
| TEST_VAR_DEFINED(VARIABLE_A) | ||
| TEST_VAR_EQUALS_LITERAL(VARIABLE_A "test_value_a") | ||
|
|
||
| TEST_CMCONF_UNINSTALL_CONFIG("${CMCONF_TEST_CONFIG_FILE}" "TEST") | ||
|
|
||
| UNSET(${package_name}_FOUND CACHE) | ||
| UNSET(${package_name}_DIR CACHE) | ||
| UNSET(${package_name}_CONFIG CACHE) | ||
|
|
||
| FIND_PACKAGE(${package_name} QUIET) | ||
| IF(${package_name}_FOUND) | ||
| MESSAGE(FATAL_ERROR "Package ${package_name} should NOT be found after uninstallation, but it was still found at: ${${package_name}_DIR}") | ||
| ENDIF() |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.