Saturday, July 26, 2025

Test Driven Development in Xschem

What tests are currently implemented?

● Current Testing Infrastructure Analysis


  Test Structure:

  - 3 main test suites: create_save, open_close, netlisting

  - Test runner: run_regression.tcl orchestrates all tests

  - Test framework: Tcl-based with standardized test_utility.tcl

  - Not integrated: Tests are NOT part of the main Makefile build process


  Test Coverage:

  1. create_save.tcl: Tests script execution and schematic creation

  2. open_close.tcl: Tests file opening/closing for all .sch/.sym files in xschem_library

  3. netlisting.tcl: Tests netlisting in 4 formats (VHDL, Verilog, TDX, SPICE)


  Test Execution:

  - Tests run XSCHEM in headless mode (-q -x -r)

  - Captures debug output and validates against expected results

  - Tests are comprehensive but do NOT test keyboard/UI interactions


  Critical Gap for Refactoring:

  The existing tests validate file operations and netlisting but cannot test the handle_key_press() function since it requires

  interactive keyboard input. For safe refactoring, we'll need to:


  1. Extract testable helper functions from handle_key_press()

  2. Rely on manual testing for UI validation

  3. Use existing regression tests to ensure no core functionality breaks


  The current test infrastructure is sufficient for validating that our refactoring doesn't break file operations, but manual UI

  testing will be required for keyboard interaction validation.

No comments:

Post a Comment

Who Needs Cadence Anymore (for Schematic Tree Reporting that is :)? Make Your Own Reporter with chatGPT!

You know what I mean, if you've used Cadence - the SHIFT-T thing that gives you the schematic tree can be VERY useful, at times. No Cade...