-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It was possible for mocks to be generated with an out-of-date cmock configuration while other functionality used the correct CMock configuration. Also cleaned up code structure and comments around mock and test runner generation.
- Loading branch information
Showing
10 changed files
with
71 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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,31 @@ | ||
require 'cmock' | ||
|
||
class GeneratorMocks | ||
|
||
constructor :configurator | ||
|
||
def manufacture(config) | ||
return CMock.new(config) | ||
end | ||
|
||
def build_configuration( output_path ) | ||
config = @configurator.get_cmock_config | ||
config[:mock_path] = output_path | ||
|
||
# Verbosity management for logging messages | ||
case @configurator.project_verbosity | ||
when Verbosity::SILENT | ||
config[:verbosity] = 0 # CMock is silent | ||
when Verbosity::ERRORS | ||
when Verbosity::COMPLAIN | ||
when Verbosity::NORMAL | ||
when Verbosity::OBNOXIOUS | ||
config[:verbosity] = 1 # Errors and warnings only so we can customize generation message ourselves | ||
else # DEBUG | ||
config[:verbosity] = 3 # Max verbosity | ||
end | ||
|
||
return config | ||
end | ||
|
||
end |
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
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
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
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
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
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