-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: Add CMake presets for running tests with logging
Using cache variables to configure the logging infrastructure requires a different handling for testing. CMake's preset functionality helps to build the project with different settings and run the corresponding tests.
- Loading branch information
1 parent
df92701
commit b0d8b97
Showing
3 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -3,3 +3,7 @@ Language: Cpp | |
BasedOnStyle: LLVM | ||
IndentWidth: 4 | ||
ColumnLimit: 120 | ||
--- | ||
Language: Json | ||
BasedOnStyle: llvm | ||
|
This file contains 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,88 @@ | ||
{ | ||
"version": 3, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 21, | ||
"patch": 0 | ||
}, | ||
"configurePresets": [ | ||
{ | ||
"name": "log_base", | ||
"description": "Run the tests with corresponding log level", | ||
"hidden": true, | ||
"binaryDir": "${sourceDir}/build-presets/log_tests/${presetName}", | ||
"cacheVariables": { | ||
"WAKAAMA_LOG_CUSTOM_HANDLER": { | ||
"type": "BOOL", | ||
"value": "ON" | ||
}, | ||
"WAKAAMA_ENABLE_EXAMPLES": { | ||
"type": "BOOL", | ||
"value": "OFF" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "log_dbg", | ||
"description": "Run the tests with debug log level", | ||
"inherits": "log_base", | ||
"cacheVariables": { | ||
"WAKAAMA_LOG_LEVEL": { | ||
"type": "STRING", | ||
"value": "DBG" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "log_info", | ||
"description": "Run the tests with info log level", | ||
"inherits": "log_base", | ||
"cacheVariables": { | ||
"WAKAAMA_LOG_LEVEL": { | ||
"type": "STRING", | ||
"value": "INFO" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "log_warn", | ||
"description": "Run the tests with warning log level", | ||
"inherits": "log_base", | ||
"cacheVariables": { | ||
"WAKAAMA_LOG_LEVEL": { | ||
"type": "STRING", | ||
"value": "WARN" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "log_fatal", | ||
"description": "Run the tests with fatal log level", | ||
"inherits": "log_base", | ||
"cacheVariables": { | ||
"WAKAAMA_LOG_LEVEL": { | ||
"type": "STRING", | ||
"value": "FATAL" | ||
} | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "log_dbg", | ||
"configurePreset": "log_dbg" | ||
}, | ||
{ | ||
"name": "log_info", | ||
"configurePreset": "log_info" | ||
}, | ||
{ | ||
"name": "log_warn", | ||
"configurePreset": "log_warn" | ||
}, | ||
{ | ||
"name": "log_fatal", | ||
"configurePreset": "log_fatal" | ||
} | ||
] | ||
} |
This file contains 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