Skip to content

Comments

Add testing infrastructure for slang#272

Open
fischeti wants to merge 41 commits intofischeti/slang-picklerfrom
fischeti/slang-test
Open

Add testing infrastructure for slang#272
fischeti wants to merge 41 commits intofischeti/slang-picklerfrom
fischeti/slang-test

Conversation

@fischeti
Copy link
Contributor

@fischeti fischeti commented Feb 17, 2026

I added another testing repository in tests/pickle to test out multiple SystemVerilog options. The testing is done on multiple levels:

Unit tests basic.rs

Just checks that parsing is sucessful or proper error is returned when broken SV code is provided.

Refactoring tests pickle.rs

Tests renaming feature of --prefix/--suffix as well as file filtering with --top

CLI regression cli_regression.rs

Existing test framework to check the emitted output against regression (to be enabled)


This is part 2 of 3 in a stack made with GitButler:

@fischeti fischeti force-pushed the fischeti/slang-test branch from c6356eb to 5a1fd38 Compare February 17, 2026 14:12
@fischeti fischeti force-pushed the fischeti/slang-pickler branch from 038b5fa to 3795c0a Compare February 17, 2026 17:16
@fischeti fischeti force-pushed the fischeti/slang-test branch from 5a1fd38 to 1d36e68 Compare February 17, 2026 17:16
@fischeti fischeti marked this pull request as ready for review February 17, 2026 17:37
@fischeti fischeti requested a review from micprog February 17, 2026 17:37
@fischeti fischeti force-pushed the fischeti/slang-pickler branch from 3795c0a to f295d10 Compare February 18, 2026 08:33
@fischeti fischeti force-pushed the fischeti/slang-test branch 6 times, most recently from 13ff13e to dc432c0 Compare February 22, 2026 17:28
@fischeti fischeti force-pushed the fischeti/slang-pickler branch from 07a9b8f to 2644c35 Compare February 22, 2026 17:46
@fischeti fischeti force-pushed the fischeti/slang-test branch from dc432c0 to 9a4317a Compare February 22, 2026 17:46
Will result in ABI mismatches i.e. segfaults otherwise
Prevent multiple inclusion of the header by adding a traditional
#ifndef/define/endif include guard (BENDER_SLANG_BRIDGE_H). This
replaces the lone #pragma once for better portability and ensures the
header can be safely included multiple times across translation units.
Introduce safe wrapper types for the opaque FFI objects and move the
extension methods into proper Rust structs to provide a clearer,
idiomatic API and safer ownership semantics.

- Add SyntaxTree wrapper around SharedPtr<ffi::SyntaxTree> with Clone,
  display, as_debug, rename, and fmt impls (Display/Debug).
- Add SlangContext wrapper around UniquePtr<ffi::SlangContext> with new,
  set_includes, set_defines, and parse returning a SyntaxTree.
- Replace new_session() to return SlangContext instead of raw pointer.
- Update callers: remove use of extension traits and change formatting
  at pickling to use Debug/Display impls (write!("{:?}", renamed_tree)).
bender-slang: Fix windows build 2
@fischeti fischeti force-pushed the fischeti/slang-pickler branch from 2644c35 to 0ca1013 Compare February 24, 2026 10:53
@fischeti fischeti force-pushed the fischeti/slang-test branch from 9a4317a to 4aa7806 Compare February 24, 2026 10:53
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.

2 participants