Skip to content

Test coverage: preprocessor directives #54

Description

@robtaylor

Summary

Preprocessor test coverage is limited to basic macro expansion scenarios.

Current State

Only 4 test cases in openvaf/preprocessor/src/tests.rs:

  • smoke_test - Basic ifdef/ifndef, define, multiline macros
  • whitespaces - Whitespace handling in macros
  • condition_enabled / condition_disabled - Conditional compilation

Missing Coverage

Untested directives

  • `undef - Macro undefinition
  • `elsif - Else-if chains
  • `line - Line number control
  • `FILE, `LINE - Predefined macros
  • `pragma - Pragma directives
  • `resetall - Reset all directives

Untested scenarios

  • Nested `include (include within include)
  • Include search path priority
  • Circular include detection
  • Macro redefinition warnings
  • Macro argument edge cases (empty args, special chars)
  • Line continuation edge cases
  • Comment handling within macros

Error cases

  • Missing include file
  • Unterminated ifdef/ifndef
  • Malformed macro definitions
  • Recursive macro expansion

Suggested Action

  1. Expand preprocessor test suite with missing directive tests
  2. Add error case tests with expected diagnostics
  3. Test edge cases found in real-world Verilog-A models

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions