blob: bc5f647aad7072d431bf4386515d62a1e12e8f2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
using NUnit.Framework;
using System;
using Microsoft.Boogie;
namespace TestUtil
{
public class ProgramLoader
{
public static Program LoadProgramFrom(string programText, string fileName="file.bpl")
{
Assert.IsNotNullOrEmpty (programText);
Assert.IsNotNullOrEmpty (fileName);
int errors = 0;
Program p = null;
errors = Parser.Parse(programText, fileName, out p, /*useBaseName=*/false);
Assert.AreEqual(0, errors);
Assert.IsNotNull(p);
// Resolve
errors = p.Resolve();
Assert.AreEqual(0, errors);
// Type check
errors = p.Typecheck();
Assert.AreEqual(0, errors);
return p;
}
}
}
|