Skip to content
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

Implement Rule #71

Merged
merged 14 commits into from
Jul 23, 2024
Merged

Implement Rule #71

merged 14 commits into from
Jul 23, 2024

Conversation

williaml33moore
Copy link
Owner

No description provided.

Implementing Gherkin rule syntax.

- modified:   test/bathtub_pkg_test_suite/gherkin_parser_unit_test.sv
  - New test for rule.
  - Doesn't fail because the keyword is not recognized, so it is treated as a description.
Reference the rule class, which doesn't exist yet.
- modified:   src/bathtub_pkg/gherkin_document_printer/gherkin_document_printer.svh
- modified:   src/bathtub_pkg/gherkin_document_runner/gherkin_document_runner.svh
  - Placeholder for `visit_rule()`

- modified:   src/gherkin_pkg/gherkin_pkg.sv
  - New class `rule`
  - New struct type `rule_value`
- modified:   src/gherkin_pkg/gherkin_pkg.sv
  - Add member `rules` to class `feature`
  - Add member `background` to class `rule`
- modified:   test/bathtub_pkg_test_suite/gherkin_parser_unit_test.sv
  - Test feature has a member `rules`
- modified:   src/bathtub_pkg/gherkin_parser/gherkin_parser.svh
  - Update `parse_feature_description()` so keyword "Rule" is not interpreted as description.
  - New method `parse_rule_description()` implements rules for parsing the rule description.
  - Read new file `parse_rule.svh`.

- modified:   src/bathtub_pkg/gherkin_parser/parse_feature.svh
  - Handle "Rule" keyword.

- new file:   src/bathtub_pkg/gherkin_parser/parse_rule.svh
  - New file parses rules.
  - Based on `parse_feature.svh` since they're very similar..

- modified:   test/bathtub_pkg_test_suite/gherkin_parser_unit_test.sv
  - Test that rule was successfully parsed.
  - Passes.
- modified:   test/bathtub_pkg_test_suite/gherkin_parser_unit_test.sv
  - Add scenario checking to `Test_that_parser_parses_simple_rule`
  - New unit test `Test_that_parser_parses_rule_with_scenario_outline`
- modified:   test/bathtub_pkg_test_suite/gherkin_parser_unit_test.sv
  - New test `Test_that_parser_parses_rule_with_scenario_definitions`
- modified:   test/bathtub_pkg_test_suite/gherkin_parser_unit_test.sv
  - New test `Test_that_parser_parses_rule_with_description`
…runner.svh

  - Add rule support to runner.
  - New `rule_background` member which gets run at the beginning of every scenario.
  - Fixed a bug where `visit_feature()` was hanging if there were no scenarios.
  - Visit rules from `visit_feature()`
  - New `visit_rule()` task for running rules.

- modified:   src/bathtub_pkg/scenario_sequence.svh
  - Run rules from scenario sequence.

- new file:   test/e2e/gherkin_parser/__init__.py
  - Make the module a package to prevent namespace collisions.

- new file:   test/e2e/gherkin_parser/features/rules.feature
  - Feature file to test rule parser.

- new file:   test/e2e/gherkin_parser/gherkin_parser.f
  - Options file for `gherkin_parser` tests.

- new file:   test/e2e/gherkin_parser/gherkin_parser_env.svh
  - Environment class for `gherkin_parser` tests.

- new file:   test/e2e/gherkin_parser/gherkin_parser_step_def_seqs.svh
  - Step definition sequences for `gherkin_parser` tests.
  - Contains only mock step.

- new file:   test/e2e/gherkin_parser/gherkin_parser_tb_top.sv
  - Top testbench module for `gherkin_parser` tests.

- new file:   test/e2e/gherkin_parser/gherkin_parser_test.py
  - New end-to-end test for rules.

- new file:   test/e2e/gherkin_parser/gherkin_parser_tests.svh
  - Include `gherkin_parser` tests.

- new file:   test/e2e/gherkin_parser/tests/gherkin_parser_rules_test.svh
  - New end-to-end test for rules.
  - Not self-checking yet, but it doesn't crash or hang.
- modified:   test/e2e/gherkin_parser/tests/gherkin_parser_rules_test.svh
  - Test is now self-checking.
  - Expected values are hard-coded in the test.
  - This is not great, but it will do for now.
Add rule printing support to gherkin printer.

- modified:   src/bathtub_pkg/gherkin_document_printer/gherkin_document_printer.svh
  - Visit rules from `visit_feature()`.
  - `visit_rule()` is currently a placeholder that triggers an error, causing the test to fail for now.

- modified:   test/e2e/gherkin_parser/gherkin_parser_test.py
  - New test `test_gherkin_printer_e2e` runs a rule test with high verbosity so the Gherkin printer prints the feature file.
  - Not self-checking yet, other than checking that the test runs and passes.
  - Doesn't check output yet.
- modified:   src/bathtub_pkg/gherkin_document_printer/gherkin_document_printer.svh
  - Built out `visit_rule()` task, based on `visit_feature()`.
  - Discovered that Questa treated my indentations as integers.
  - Refactored indentations into static `indent()` function that produces strings.
- modified:   test/e2e/gherkin_parser/gherkin_parser_test.py
  - Print test isn't self-checking.
  - That's fine for now; printing is low-priority.
  - As long as the test doesn't crash or hang, I'm happy.
@williaml33moore williaml33moore linked an issue Jul 23, 2024 that may be closed by this pull request
@williaml33moore williaml33moore merged commit a829750 into main Jul 23, 2024
@williaml33moore williaml33moore deleted the 66-implement-rule branch July 23, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Rule
1 participant