Skip to content

Commit

Permalink
Allow regenerating a subset of snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
antonsviridov-src committed Aug 6, 2024
1 parent 115d6ce commit f8f12f6
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/snapshots/src/main/scala/tests/SaveSnapshots.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@ package tests
object SaveSnapshots {
def main(args: Array[String]): Unit = {
val expectDirectory = tests.snapshots.BuildInfo.snapshotDirectory.toPath
SemanticdbJavacSnapshotGenerator
.run(SnapshotContext(expectDirectory), new SaveSnapshotHandler)
val mapping = Map(
"minimized" -> new MinimizedSnapshotScipGenerator(),
"library" -> new LibrarySnapshotGenerator()
)

val enabledGenerators =
if (args.isEmpty)
mapping.values.toList
else
args.flatMap(mapping.get).toList

val generator = new AggregateSnapshotGenerator(enabledGenerators)

generator.run(SnapshotContext(expectDirectory), new SaveSnapshotHandler)
}
}

0 comments on commit f8f12f6

Please sign in to comment.