From f8f12f658a31d0a9127de2af90217864d4a0af95 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Tue, 6 Aug 2024 10:09:59 +0100 Subject: [PATCH] Allow regenerating a subset of snapshots --- .../src/main/scala/tests/SaveSnapshots.scala | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/snapshots/src/main/scala/tests/SaveSnapshots.scala b/tests/snapshots/src/main/scala/tests/SaveSnapshots.scala index 2859051f..d489fb7e 100644 --- a/tests/snapshots/src/main/scala/tests/SaveSnapshots.scala +++ b/tests/snapshots/src/main/scala/tests/SaveSnapshots.scala @@ -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) } }