Skip to content

Commit 2fda528

Browse files
authored
Merge pull request #412 from amaissen/master
Add test suite for ADT plugin
2 parents 3532b64 + 1a5b099 commit 2fda528

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
//
5+
// Copyright (c) 2011-2021 ETH Zurich.
6+
7+
package viper.carbon
8+
9+
import viper.silver.frontend.Frontend
10+
import viper.silver.logger.SilentLogger
11+
import viper.silver.reporter.{NoopReporter, StdIOReporter}
12+
import viper.silver.testing.SilSuite
13+
import viper.silver.verifier.Verifier
14+
15+
import java.nio.file.Path
16+
17+
/** All tests for the Adt Plugin. */
18+
class AdtPluginTests extends SilSuite {
19+
override def testDirectories: Seq[String] = Vector("adt")
20+
21+
override def frontend(verifier: Verifier, files: Seq[Path]): Frontend = {
22+
require(files.length == 1, "tests should consist of exactly one file")
23+
val fe = new CarbonFrontend(NoopReporter, SilentLogger().get)
24+
fe.init(verifier)
25+
fe.reset(files.head)
26+
fe
27+
}
28+
29+
val carbon: CarbonVerifier = CarbonVerifier(StdIOReporter())
30+
31+
lazy val verifiers = List(carbon)
32+
33+
override def configureVerifiersFromConfigMap(configMap: Map[String, Any]): Unit = {
34+
carbon.parseCommandLine(Seq("--plugin", "viper.silver.plugin.standard.adt.AdtPlugin") :+ "dummy-file-to-prevent-cli-parser-from-complaining-about-missing-file-name.silver.vpr")
35+
}
36+
37+
38+
}

0 commit comments

Comments
 (0)