Skip to content

Validation of tm.defines and tm.useDef#47

Merged
PaulKlint merged 12 commits into
mainfrom
add-usedef-tests
Jun 3, 2026
Merged

Validation of tm.defines and tm.useDef#47
PaulKlint merged 12 commits into
mainfrom
add-usedef-tests

Conversation

@sungshik

@sungshik sungshik commented May 29, 2026

Copy link
Copy Markdown
Contributor

This PR:

  • Updates the existing checkAllTypesAvailable function to assert the general validaty (instead of only type availability) of tm.defines. Execution of this function can be configured using new flag assertValidDefines in TypePalConfig (default: true; same behavior as before this PR).
  • Adds a new assertValidUseDef function to assert the general validity of tm.useDef. Execution of this function can be configured using new flag assertValidUseDef in TypePalConfig (default: false).
  • Adds a name argument to getModel function argument of runTests in the test framework. This makes it possible to configure the collector/solver specifically for each example.
  • Updates the tests to enable assertValidUseDef, except in examples when an invalid use-def pair is expected to exist (using the previous point).
  • Fixes an issue that caused assertValidUseDef to fail: uses discovered by the solver (instead of the collector) weren't included in tm.uses yet.

I locally ran the tests of rascal with this branch of typepal -- no failures.

@sungshik sungshik changed the title Add usedef tests Validation of tm.defines and tm.useDef May 29, 2026
sungshik added 3 commits June 1, 2026 09:19
… be able to change the config of the collector/solver depending on the particular example, if needed)
@sungshik sungshik marked this pull request as ready for review June 1, 2026 08:09
Comment thread src/analysis/typepal/ConfigurableScopeGraph.rsc Outdated
Comment thread src/analysis/typepal/Solver.rsc

@PaulKlint PaulKlint left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. See two comments

sungshik added 2 commits June 1, 2026 11:44
…of Typepal's public API (and at least one consumer in the integration test exists)
@sungshik sungshik force-pushed the add-usedef-tests branch from 297ef42 to 92744aa Compare June 1, 2026 14:45
@sungshik

sungshik commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Integration test succeeds

@PaulKlint PaulKlint merged commit 76e406a into main Jun 3, 2026
1 check passed
@PaulKlint PaulKlint deleted the add-usedef-tests branch June 3, 2026 09:05
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