Search in sources :

Example 11 with ProgramParser

use of com.dat3m.dartagnan.parsers.program.ProgramParser in project Dat3M by hernanponcedeleon.

the class BranchTest method test.

@Test
public void test() {
    try (SolverContext ctx = TestHelper.createContext();
        ProverEnvironment prover1 = ctx.newProverEnvironment(ProverOptions.GENERATE_MODELS);
        ProverEnvironment prover2 = ctx.newProverEnvironment(ProverOptions.GENERATE_MODELS)) {
        Program program = new ProgramParser().parse(new File(path));
        VerificationTask task = VerificationTask.builder().withSolverTimeout(60).withTarget(Arch.LKMM).build(program, wmm, EnumSet.of(Property.getDefault()));
        assertEquals(expected, TwoSolvers.run(ctx, prover1, prover2, task));
    } catch (Exception e) {
        fail("Missing resource file");
    }
}
Also used : SolverContext(org.sosy_lab.java_smt.api.SolverContext) Program(com.dat3m.dartagnan.program.Program) VerificationTask(com.dat3m.dartagnan.verification.VerificationTask) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) ProverEnvironment(org.sosy_lab.java_smt.api.ProverEnvironment) File(java.io.File) IOException(java.io.IOException) Test(org.junit.Test)

Example 12 with ProgramParser

use of com.dat3m.dartagnan.parsers.program.ProgramParser in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintLinux3.

@Test()
public void PrintLinux3() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.LITMUS_RESOURCE_PATH + "litmus/C/manual/atomic/C-atomic-01.litmus"));
    assertNotNull(new Printer().print(p));
    assertNotNull(p.getAss().toString());
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Example 13 with ProgramParser

use of com.dat3m.dartagnan.parsers.program.ProgramParser in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintLinux.

@Test()
public void PrintLinux() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/C-rcu-link-after.litmus"));
    assertNotNull(new Printer().print(p));
    assertNotNull(p.getAss().toString());
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Example 14 with ProgramParser

use of com.dat3m.dartagnan.parsers.program.ProgramParser in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintBpl1.

// Test to call toString() of most events
@Test()
public void PrintBpl1() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "boogie/concurrency/fib_bench-1-O0.bpl"));
    assertNotNull(new Printer().print(p));
    LoopUnrolling.newInstance().run(p);
    Compilation.newInstance().run(p);
    assertNotNull(new Printer().print(p));
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Example 15 with ProgramParser

use of com.dat3m.dartagnan.parsers.program.ProgramParser in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintAARCH64.

@Test()
public void PrintAARCH64() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/MP+popl+poap.litmus"));
    assertNotNull(new Printer().print(p));
    assertNotNull(p.getAss().toString());
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Aggregations

ProgramParser (com.dat3m.dartagnan.parsers.program.ProgramParser)20 Program (com.dat3m.dartagnan.program.Program)20 File (java.io.File)19 Test (org.junit.Test)18 Printer (com.dat3m.dartagnan.utils.printer.Printer)8 Compilation (com.dat3m.dartagnan.program.processing.compilation.Compilation)6 VerificationTask (com.dat3m.dartagnan.verification.VerificationTask)4 ProverEnvironment (org.sosy_lab.java_smt.api.ProverEnvironment)4 SolverContext (org.sosy_lab.java_smt.api.SolverContext)4 ParserCat (com.dat3m.dartagnan.parsers.cat.ParserCat)3 Wmm (com.dat3m.dartagnan.wmm.Wmm)3 Result (com.dat3m.dartagnan.utils.Result)2 IOException (java.io.IOException)2 Configuration (org.sosy_lab.common.configuration.Configuration)2 OptionInfo.collectOptions (com.dat3m.dartagnan.configuration.OptionInfo.collectOptions)1 PHANTOM_REFERENCES (com.dat3m.dartagnan.configuration.OptionNames.PHANTOM_REFERENCES)1 Property (com.dat3m.dartagnan.configuration.Property)1 ParserWitness (com.dat3m.dartagnan.parsers.witness.ParserWitness)1 SourceLanguage (com.dat3m.dartagnan.program.Program.SourceLanguage)1 CreateGitInfo (com.dat3m.dartagnan.utils.GitInfo.CreateGitInfo)1