-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests with complex perm expressions, fixing some problems
- Loading branch information
1 parent
cc34751
commit 97138be
Showing
3 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
// | ||
// Copyright (c) 2011-2022 ETH Zurich. | ||
|
||
import viper.silicon.{Silicon, SiliconFrontend} | ||
import viper.silver.reporter.NoopReporter | ||
import viper.silver.testing.{LocatedAnnotation, MissingOutput, SilSuite, UnexpectedOutput} | ||
import viper.silver.verifier.Verifier | ||
|
||
import java.nio.file.Path | ||
|
||
class SiliconTestsKInductionCondPerms extends SilSuite { | ||
private val siliconTestDirectories = | ||
Seq("kinduct") | ||
|
||
private val silTestDirectories = Seq() | ||
//Seq("all", | ||
// "quantifiedpermissions", "quantifiedpredicates", "quantifiedcombinations", | ||
// "wands", "termination", "refute", | ||
// "examples") | ||
|
||
val testDirectories: Seq[String] = siliconTestDirectories ++ silTestDirectories | ||
|
||
override def frontend(verifier: Verifier, files: Seq[Path]): SiliconFrontend = { | ||
require(files.length == 1, "tests should consist of exactly one file") | ||
|
||
val fe = new SiliconFrontend(NoopReporter) | ||
fe.init(verifier) | ||
fe.reset(files.head) | ||
fe | ||
} | ||
|
||
override def annotationShouldLeadToTestCancel(ann: LocatedAnnotation): Boolean = { | ||
ann match { | ||
case UnexpectedOutput(_, _, _, _, _, _) => true | ||
case MissingOutput(_, _, _, _, _, issue) => issue != 34 | ||
case _ => false | ||
} | ||
} | ||
|
||
val silicon: Silicon = { | ||
val reporter = NoopReporter | ||
val debugInfo = ("startedBy" -> "viper.silicon.SiliconTests") :: Nil | ||
new Silicon(reporter, debugInfo) | ||
} | ||
|
||
def verifiers: Seq[Silicon] = Seq(silicon) | ||
|
||
override def configureVerifiersFromConfigMap(configMap: Map[String, Any]): Unit = { | ||
val args = Silicon.optionsFromScalaTestConfigMap(prefixSpecificConfigMap(configMap).getOrElse("silicon", Map())) | ||
silicon.parseCommandLine(commandLineArguments ++ args :+ Silicon.dummyInputFilename) | ||
} | ||
|
||
val commandLineArguments: Seq[String] = | ||
Seq("--timeout", "600" /* seconds */, "--enableMoreCompleteExhale", "--enableKInduction=1", "--conditionalizePermissions") | ||
} |