@@ -18,6 +18,12 @@ import test_util.TestCustomisation
18
18
*/
19
19
20
20
trait SystemTests extends AnyFunSuite , BASILTest , Retries , TestCustomisation {
21
+
22
+ /**
23
+ * A suffix appended to output file names, in order to avoid clashes between test suites.
24
+ */
25
+ def testSuiteSuffix = " _" + this .getClass.getSimpleName
26
+
21
27
case class TestResult (
22
28
name : String ,
23
29
passed : Boolean ,
@@ -154,15 +160,23 @@ trait SystemTests extends AnyFunSuite, BASILTest, Retries, TestCustomisation {
154
160
def runTest (path : String , name : String , variation : String , conf : TestConfig ): Unit = {
155
161
val directoryPath = path + " /" + name + " /"
156
162
val variationPath = directoryPath + variation + " /" + name
157
- val inputPath = if conf.useBAPFrontend then variationPath + " .adt" else variationPath + " .gts"
158
- val BPLPath = if conf.useBAPFrontend then variationPath + " _bap.bpl" else variationPath + " _gtirb.bpl"
163
+ val suiteSuffix = testSuiteSuffix
164
+
165
+ // input files:
166
+ val inputPath = variationPath + (if conf.useBAPFrontend then " .adt" else " .gts" )
159
167
val specPath = directoryPath + name + " .spec"
160
168
val RELFPath = variationPath + " .relf"
161
- val resultPath =
162
- if conf.useBAPFrontend then variationPath + " _bap_result.txt" else variationPath + " _gtirb_result.txt"
163
- val testSuffix = if conf.useBAPFrontend then " :BAP" else " :GTIRB"
169
+
170
+ // output files:
171
+ val lifterString = if conf.useBAPFrontend then s " _bap " else s " _gtirb "
172
+ val BPLPath = variationPath + lifterString + suiteSuffix + " .bpl"
173
+ val resultPath = variationPath + lifterString + suiteSuffix + " _result.txt"
174
+
175
+ // reference file:
164
176
val expectedOutPath = if conf.useBAPFrontend then variationPath + " .expected" else variationPath + " _gtirb.expected"
165
177
178
+ val testSuffix = if conf.useBAPFrontend then " :BAP" else " :GTIRB"
179
+
166
180
Logger .info(s " $name/ $variation$testSuffix" )
167
181
val timer = PerformanceTimer (s " test $name/ $variation$testSuffix" )
168
182
runBASIL(inputPath, RELFPath , Some (specPath), BPLPath , conf.staticAnalysisConfig, conf.simplify)
@@ -250,6 +264,7 @@ trait SystemTests extends AnyFunSuite, BASILTest, Retries, TestCustomisation {
250
264
251
265
@ test_util.tags.StandardSystemTest
252
266
class SystemTestsBAP extends SystemTests {
267
+ override def testSuiteSuffix = " "
253
268
runTests(" correct" , TestConfig (useBAPFrontend = true , expectVerify = true , checkExpected = true , logResults = true ))
254
269
runTests(
255
270
" incorrect" ,
@@ -262,6 +277,7 @@ class SystemTestsBAP extends SystemTests {
262
277
263
278
@ test_util.tags.StandardSystemTest
264
279
class SystemTestsGTIRB extends SystemTests {
280
+ override def testSuiteSuffix = " "
265
281
runTests(" correct" , TestConfig (useBAPFrontend = false , expectVerify = true , checkExpected = true , logResults = true ))
266
282
runTests(
267
283
" incorrect" ,
0 commit comments