コード例 #1
0
ファイル: test.py プロジェクト: rowhit/spark2014
from test_support import *
from gnatpython.env import putenv
import shutil

def copy_project_file():
    lemma_gpr = os.path.join(spark_install_path(), 'lib', 'gnat', 'spark_lemmas.gpr')
    shutil.copyfile(lemma_gpr, 'spark_lemmas.gpr')

def copy_lemma_files():
    include_dir = os.path.join(spark_install_path(), 'include', 'spark')
    lemma_files = glob.glob(os.path.join(include_dir, '*.ad?'))
    for f in lemma_files:
        curdir = os.getcwd()
        for f in lemma_files:
            new_f = os.path.join(curdir, os.path.basename(f))
            shutil.copyfile(f, new_f)

def copy_proof_files():
    proof_dir = os.path.join(spark_install_path(), 'lib', 'gnat', 'proof')
    shutil.copytree(proof_dir, 'proof')

copy_project_file()
copy_lemma_files()
copy_proof_files()
putenv("SPARK_LEMMAS_OBJECT_DIR", "obj")
putenv("SPARK_LEMMAS_BODY_MODE", "On")
putenv("SPARK_LEMMAS_INSTALLED", "False")
prove_all(opt=["--prover=cvc4"], counterexample=False)
コード例 #2
0
ファイル: test.py プロジェクト: rowhit/spark2014
from test_support import *
from gnatpython.env import putenv

putenv("SPARK_LEMMAS_OBJECT_DIR", TESTDIR)
prove_all(opt=["-u", "add.adb"])
コード例 #3
0
import gnatpython.ex
from gnatpython.env import putenv
from time import sleep
from t32api import PATH_TO_T32_HOME, PATH_TO_T32


# ---------
# -- log --
# ---------
def log(str):
    print "trace32/pre_testsuite.py:" + str


altrun_dir_path = os.path.dirname(os.path.realpath(__file__))

putenv('T32SYS', PATH_TO_T32_HOME)
putenv('T32TMP', "/tmp")
putenv('T32PDFVIEWER',
       PATH_TO_T32_HOME + "/bin/pc_linux64/t32_startpdfviewer.sh")

# Run t32usbchecker to reset the probe in case it is already connected.
#
# This can happen when the testsuite crashes, for instance with an rlimit. The
# probe is still trying to talk with the previous Trace32 instance that was
# killed by rlimit.
#
# It should be possble to achive the same result with the
# CONNECTIONMODE=AUTOCONNECT parameter of the configuration, however this
# parameter doesn't work with the SCREEN=OFF mode.
p = gnatpython.ex.Run([os.path.dirname(PATH_TO_T32) + '/t32usbchecker'],
                      output="t32usbchecker.out",