package simpleMP;

import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.FileNotFoundException;

import org.junit.BeforeClass;
import org.junit.Test;

import config.Example;
import edu.udel.cis.vsl.tass.config.VerifyConfiguration;
import edu.udel.cis.vsl.tass.config.RunConfiguration.ReductionStrategy;
import edu.udel.cis.vsl.tass.front.minimp.ModelExtractor;
import edu.udel.cis.vsl.tass.model.IF.ModelIF;
import edu.udel.cis.vsl.tass.verify.Verification;

public class PidTest {

	private static ModelIF model;
	private static VerifyConfiguration configuration;
	private static int nprocs = 3;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		File rootDirectory = new File(Example.exampleDirectory, "simpleMP");

		configuration = new VerifyConfiguration(new File(rootDirectory,
				"TASSREP"));
		configuration.setSourceFile(new File(rootDirectory, "pid.c"));
		configuration.setNumProcs(nprocs);
		configuration.setModelName("pid");
		configuration.setReductionStrategy(ReductionStrategy.URGENT);
		model = ModelExtractor.extractModel(configuration);
	}

	@Test
	public void testVerify() throws FileNotFoundException {
		assertTrue(Verification.verify(model, configuration, true));
	}
}
