[More Detail] [Collapse All]
Feature: Preference 'debug-output'

The feature 'debug-output' supports adding debug print command into
specification code. When option is set to false, debug output is not
done.

The debug output is controlled using preference 'debug-output' `sbuilder.yaml`.

Implementation uses mustache conditional 

   {{^PREFERENCES.debug-output}}\* {{/PREFERENCES.debug-output}}

to set TLA commnent mark \*  in front of print statement

   print <<"Default process {{>name_process.mustache}} for operation '{{interface_operation}}',tick=", currentTime>>;

Debug preference can be uses also in specification extension, which
are processed trough mustache rendering before being added to
specification code.
features/015-preferences/010-preference-debug-ouput.feature
- Background:
link

Empty preferences section in `sbuilder.yaml`
features/015-preferences/010-preference-debug-ouput.feature:22
Given I use a fixture named "fixture-resolver"
And YAML configuration file `cnf/sbuilder.yaml`
preferences:
- Scenario: Preference 'debug-output' true process output
link
features/015-preferences/010-preference-debug-ouput.feature:32
Given YAML configuration file `cnf/sbuilder.yaml` in path `preferences`
debug-output: true
When I generate TLA+ model setup `test`
And I do PLC transformation for setup `test`
And I do PLC transformation for setup `test`
And I run TLC for setup `test`
Then the output should match /Default process [\w]+ for operation/
- Scenario: Preference 'debug-output' default value: true
link
features/015-preferences/010-preference-debug-ouput.feature:45
When I generate TLA+ model setup `test`
And I do PLC transformation for setup `test`
And I do PLC transformation for setup `test`
And I run TLC for setup `test`
Then the output should match /Default process [\w]+ for operation/
- Scenario: Preference 'debug-output' false no process output
link
features/015-preferences/010-preference-debug-ouput.feature:54
Given YAML configuration file `cnf/sbuilder.yaml` in path `preferences`
debug-output: false
When I generate TLA+ model setup `test`
And I do PLC transformation for setup `test`
And I do PLC transformation for setup `test`
And I run TLC for setup `test`
Then the output should not match /Default process [\w]+ for operation/