cmake_test/asserts/file_contains
- cmake_test/asserts/file_contains.ct_assert_file_contains(file text)
Assert a file contains the specified text.
Asserts that the file at the specified path contains the specified text. If the file does not exist or does not contain the specified contents, an
ASSERTION_FAILEDexception is raised.- Parameters:
file (path) – The file to check
text (str) – The text to check for
- cmake_test/asserts/file_contains.ct_assert_file_does_not_contain(file text)
Assert a file does not contain the specified text.
Asserts that the file at the specified path does not contain the specified text.
If the path does not exist or the file at that path does contain the text, an
ASSERTION_FAILEDexception will be raised.- Parameters:
file (path) – The file to check
text (str) – The text to check for
- cmake_test/asserts/file_contains.ct_file_contains(result file text)
Determines if a file contains some text.
This function checks whether a file contains some text and returns a boolean result.
Will raise an
ASSERTION_FAILEDexception if the file does not exist.- Parameters:
result (bool*) – Name to use for the variable which will hold the result.
file (path) – The file to check.
text (str) – The text to check for.
- Returns:
resultwill be set toTRUEif file contains the text andFALSEif it does not.- Return type:
bool