-
Notifications
You must be signed in to change notification settings - Fork 0
Allow system name reinit #4
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
16d0889
Allow reinit of system name
koudis 2351f15
Do not allow SYSTEM_NAME override when CMCONF install
koudis 540cec6
Update README.md - clarifying override usage
koudis 27fdeb5
README updated
koudis b674ff0
Do not allow SYSTEM_NAME OVERRIDE when uninstalling
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
29 changes: 29 additions & 0 deletions
29
test/test_cases/fail/install_with_override_allowed/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,29 @@ | ||
| ## Main | ||
| # | ||
| # Test CMCONF installation error when CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED is ON | ||
| # | ||
|
|
||
| IF(NOT DEFINED CMAKE_SCRIPT_MODE_FILE) | ||
| CMAKE_MINIMUM_REQUIRED(VERSION 3.22) | ||
| PROJECT(CMCONF_INSTALL_WITH_OVERRIDE_ALLOWED_TEST) | ||
| ENDIF() | ||
|
|
||
| FIND_PACKAGE(CMLIB REQUIRED) | ||
|
|
||
| INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../TEST.cmake") | ||
|
|
||
| EXECUTE_PROCESS( | ||
| COMMAND "${CMAKE_COMMAND}" -DCMCONF_INSTALL_AS_SYMLINK=ON -DCMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED=ON -P "${CMAKE_CURRENT_LIST_DIR}/../../../config_templates/CMCONF_TEST_SYSTEMConfig.cmake" | ||
| RESULT_VARIABLE install_result | ||
| ERROR_VARIABLE install_error | ||
| OUTPUT_VARIABLE install_output | ||
| ) | ||
|
|
||
| IF(install_result EQUAL 0) | ||
| MESSAGE(FATAL_ERROR "Expected installation to fail when CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED=ON but it succeeded") | ||
| ENDIF() | ||
|
|
||
| IF(NOT install_error MATCHES "CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED is not allowed during CMCONF config.*installation") | ||
| MESSAGE(FATAL_ERROR "Expected error message not found in output: ${install_error}") | ||
| ENDIF() | ||
|
|
29 changes: 29 additions & 0 deletions
29
test/test_cases/fail/uninstall_with_override_allowed/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,29 @@ | ||
| ## Main | ||
| # | ||
| # Test CMCONF uninstallation error when CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED is ON | ||
| # | ||
|
|
||
| IF(NOT DEFINED CMAKE_SCRIPT_MODE_FILE) | ||
| CMAKE_MINIMUM_REQUIRED(VERSION 3.22) | ||
| PROJECT(CMCONF_UNINSTALL_WITH_OVERRIDE_ALLOWED_TEST) | ||
| ENDIF() | ||
|
|
||
| FIND_PACKAGE(CMLIB REQUIRED) | ||
|
|
||
| INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../TEST.cmake") | ||
|
|
||
| EXECUTE_PROCESS( | ||
| COMMAND "${CMAKE_COMMAND}" -DCMCONF_UNINSTALL=ON -DCMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED=ON -P "${CMAKE_CURRENT_LIST_DIR}/../../../config_templates/CMCONF_TEST_SYSTEMConfig.cmake" | ||
| RESULT_VARIABLE uninstall_result | ||
| ERROR_VARIABLE uninstall_error | ||
| OUTPUT_VARIABLE uninstall_output | ||
| ) | ||
|
|
||
| IF(uninstall_result EQUAL 0) | ||
| MESSAGE(FATAL_ERROR "Expected uninstallation to fail when CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED=ON but it succeeded") | ||
| ENDIF() | ||
|
|
||
| IF(NOT uninstall_error MATCHES "CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED is not allowed during CMCONF config.*uninstallation") | ||
| MESSAGE(FATAL_ERROR "Expected error message not found in output: ${uninstall_error}") | ||
| ENDIF() | ||
|
|
18 changes: 18 additions & 0 deletions
18
test/test_cases/pass/system_name_override_allowed/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,18 @@ | ||
| ## Main | ||
| # | ||
| # Test CMCONF_INIT_SYSTEM allows changing system name when CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED=ON | ||
| # | ||
|
|
||
| IF(NOT DEFINED CMAKE_SCRIPT_MODE_FILE) | ||
| CMAKE_MINIMUM_REQUIRED(VERSION 3.22) | ||
| PROJECT(CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED_TEST) | ||
| ENDIF() | ||
|
|
||
| FIND_PACKAGE(CMLIB REQUIRED) | ||
|
|
||
| INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../TEST.cmake") | ||
|
|
||
| TEST_RUN_AND_CHECK_OUTPUT("test_config" | ||
| WARNING_MESSAGE "CMCONF\\\\[FIRST_SYSTEM\\\\] - Overriding system name from 'FIRST_SYSTEM' to.*'SECOND_SYSTEM'" | ||
| ) | ||
|
|
19 changes: 19 additions & 0 deletions
19
test/test_cases/pass/system_name_override_allowed/test_config/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,19 @@ | ||
| IF(NOT DEFINED CMAKE_SCRIPT_MODE_FILE) | ||
| CMAKE_MINIMUM_REQUIRED(VERSION 3.22) | ||
| PROJECT(CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED_TEST_CONFIG) | ||
| ENDIF() | ||
|
|
||
| FIND_PACKAGE(CMLIB REQUIRED) | ||
|
|
||
| INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../../../CMCONF.cmake") | ||
|
|
||
| SET(CMCONF_SYSTEM_NAME_OVERRIDE_ALLOWED ON CACHE INTERNAL "" FORCE) | ||
|
|
||
| CMCONF_INIT_SYSTEM("FIRST_SYSTEM") | ||
|
|
||
| CMCONF_INIT_SYSTEM("SECOND_SYSTEM") | ||
|
|
||
| IF(NOT CMCONF_SYSTEM_NAME STREQUAL "SECOND_SYSTEM") | ||
| MESSAGE(FATAL_ERROR "System name should be SECOND_SYSTEM but is '${CMCONF_SYSTEM_NAME}'") | ||
| ENDIF() | ||
|
|
24 changes: 24 additions & 0 deletions
24
test/test_cases/pass/system_name_reinit_same/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,24 @@ | ||
| ## Main | ||
| # | ||
| # Test CMCONF_INIT_SYSTEM allows re-initialization with the same system name silently | ||
| # | ||
|
|
||
| IF(NOT DEFINED CMAKE_SCRIPT_MODE_FILE) | ||
| CMAKE_MINIMUM_REQUIRED(VERSION 3.22) | ||
| PROJECT(CMCONF_SYSTEM_NAME_REINIT_SAME_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") | ||
|
|
||
| CMCONF_INIT_SYSTEM("TEST_REINIT") | ||
| CMCONF_INIT_SYSTEM("TEST_REINIT") | ||
| CMCONF_INIT_SYSTEM("test_reinit") | ||
|
|
||
| IF(NOT CMCONF_SYSTEM_NAME STREQUAL "TEST_REINIT") | ||
| MESSAGE(FATAL_ERROR "System name should be TEST_REINIT but is '${CMCONF_SYSTEM_NAME}'") | ||
| ENDIF() | ||
|
|
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.