2017-07-26 03:27:23 +00:00
|
|
|
#!/usr/bin/env python
|
2014-07-14 19:32:44 +00:00
|
|
|
#
|
|
|
|
#
|
2017-07-26 03:27:23 +00:00
|
|
|
# Copyright 2017, CSIRO
|
2014-07-14 19:32:44 +00:00
|
|
|
#
|
|
|
|
# This software may be distributed and modified according to the terms of
|
|
|
|
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
|
|
|
|
# See "LICENSE_BSD2.txt" for details.
|
|
|
|
#
|
|
|
|
# @TAG(NICTA_BSD)
|
|
|
|
#
|
|
|
|
|
2017-07-26 03:27:23 +00:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
# Settings
|
|
|
|
L4V_ARCH_DEFAULT="ARM"
|
2018-06-20 07:08:24 +00:00
|
|
|
L4V_ARCH_LIST=["ARM","ARM_HYP","X64","RISCV64"]
|
2017-07-26 03:27:23 +00:00
|
|
|
|
2014-07-14 19:32:44 +00:00
|
|
|
# Fetch directory this script is stored in.
|
2017-07-26 03:27:23 +00:00
|
|
|
DIR=os.path.dirname(os.path.realpath(__file__))
|
2014-07-14 19:32:44 +00:00
|
|
|
|
|
|
|
# Add repo version of Isabelle to our path.
|
2017-07-26 03:27:23 +00:00
|
|
|
os.environ["PATH"] += os.pathsep + DIR
|
2014-07-14 19:32:44 +00:00
|
|
|
|
2017-06-09 05:01:53 +00:00
|
|
|
# Export L4V_ARCH variable as ARM (Default)
|
2017-07-26 03:27:23 +00:00
|
|
|
if not os.environ.has_key("L4V_ARCH"):
|
|
|
|
os.environ["L4V_ARCH"] = L4V_ARCH_DEFAULT
|
2014-07-14 19:32:44 +00:00
|
|
|
|
2017-07-26 03:27:23 +00:00
|
|
|
L4V_ARCH=os.environ["L4V_ARCH"]
|
|
|
|
|
2017-10-23 03:47:37 +00:00
|
|
|
# Test Orphanage when L4V_ARCH=ARM;
|
|
|
|
# we need to set this flag here to test the above equality in the ROOT file.
|
|
|
|
# To be removed when we finish proving Orphanage for ARM_HYP and X64
|
|
|
|
if L4V_ARCH == "ARM":
|
|
|
|
os.environ["L4V_ARCH_IS_ARM"]= L4V_ARCH
|
|
|
|
print "Testing Orphanage for ARM"
|
|
|
|
|
2017-07-26 03:27:23 +00:00
|
|
|
# Check we are using a known Architecture
|
|
|
|
if L4V_ARCH not in L4V_ARCH_LIST:
|
|
|
|
sys.exit("Unknown architecture L4V_ARCH=%s" % L4V_ARCH)
|
|
|
|
|
|
|
|
print "Testing for L4V_ARCH=%s:" % L4V_ARCH
|
2017-04-28 10:17:36 +00:00
|
|
|
|
2018-01-18 01:20:09 +00:00
|
|
|
# enable timing logs in isabelle builds and set report interval to 3 seconds
|
|
|
|
os.environ["ISABELLE_TIMING_LOG"]="3.0s"
|
|
|
|
|
2017-05-12 07:00:46 +00:00
|
|
|
# Enable quick_and_dirty mode for various images
|
2017-07-26 03:27:23 +00:00
|
|
|
if os.environ.has_key("QUICK_AND_DIRTY"):
|
2017-08-08 06:11:20 +00:00
|
|
|
os.environ["AINVS_QUICK_AND_DIRTY"]=1
|
2017-07-26 03:27:23 +00:00
|
|
|
os.environ["REFINE_QUICK_AND_DIRTY"]=1
|
|
|
|
os.environ["CREFINE_QUICK_AND_DIRTY"]=1
|
|
|
|
print "Testing with QUICK_AND_DIRTY"
|
2016-08-03 05:36:28 +00:00
|
|
|
|
2017-07-26 03:27:23 +00:00
|
|
|
# Lists of excluded tests for diferent archs
|
|
|
|
EXCLUDE={}
|
2017-08-15 06:26:06 +00:00
|
|
|
|
2017-07-26 03:27:23 +00:00
|
|
|
EXCLUDE["ARM_HYP"]=[
|
|
|
|
"Access",
|
|
|
|
"Bisim",
|
2017-08-15 06:26:06 +00:00
|
|
|
"DRefine",
|
2018-10-03 00:28:38 +00:00
|
|
|
"RefineOrphanage",
|
2017-08-15 06:26:06 +00:00
|
|
|
"SimplExportAndRefine"]
|
2017-07-26 03:27:23 +00:00
|
|
|
|
|
|
|
EXCLUDE["ARM"]=[]
|
|
|
|
|
2017-08-09 07:17:11 +00:00
|
|
|
EXCLUDE["X64"]=[
|
2017-08-09 07:10:06 +00:00
|
|
|
"Access",
|
2017-10-04 02:50:03 +00:00
|
|
|
"AutoCorresSEL4",
|
2017-08-09 07:10:06 +00:00
|
|
|
"Bisim",
|
|
|
|
"CamkesDarpaReport",
|
|
|
|
"CamkesGlueProofs",
|
|
|
|
"DBaseRefine",
|
|
|
|
"DSpec",
|
2018-10-03 00:28:38 +00:00
|
|
|
"RefineOrphanage",
|
2017-10-04 02:50:03 +00:00
|
|
|
"SepTacticsExamples",
|
2018-06-30 14:02:52 +00:00
|
|
|
"SimplExportAndRefine",
|
2018-10-03 00:28:38 +00:00
|
|
|
"AsmRefine"
|
|
|
|
]
|
2017-08-09 07:10:06 +00:00
|
|
|
|
2018-06-20 07:08:24 +00:00
|
|
|
EXCLUDE["RISCV64"]=[
|
2018-07-10 13:52:04 +00:00
|
|
|
"AInvs",
|
|
|
|
"ASepSpec",
|
2018-06-20 07:08:24 +00:00
|
|
|
"DSpec",
|
|
|
|
"c-kernel",
|
|
|
|
"CKernel",
|
|
|
|
"CSpec",
|
|
|
|
"CamkesDarpaReport",
|
2018-06-30 14:02:52 +00:00
|
|
|
"CamkesGlueProofs",
|
2018-10-03 00:28:38 +00:00
|
|
|
"RefineOrphanage",
|
2018-06-30 14:02:52 +00:00
|
|
|
"AsmRefine"
|
2018-06-20 07:08:24 +00:00
|
|
|
]
|
|
|
|
|
2017-07-26 03:27:23 +00:00
|
|
|
# Check EXCLUDE is exhaustive over the available architectures
|
|
|
|
if not set(L4V_ARCH_LIST) <= set(EXCLUDE.keys()):
|
|
|
|
sys.exit("[INTERNAL ERROR] exclusion lists are non-exhaustive")
|
2017-04-28 10:17:36 +00:00
|
|
|
|
2014-07-14 19:32:44 +00:00
|
|
|
# Run the tests from the script directory.
|
2017-07-26 03:27:23 +00:00
|
|
|
os.chdir(DIR)
|
|
|
|
|
|
|
|
# Arguments:
|
|
|
|
args = ['./misc/regression/run_tests.py'] # Script name
|
|
|
|
args += [r for t in EXCLUDE[L4V_ARCH] for r in ['-r', t]] # Exclusion list
|
|
|
|
args += sys.argv[1:] # Other arguments
|
|
|
|
|
|
|
|
# Run the thing!!
|
|
|
|
os.execvp('./misc/regression/run_tests.py',args)
|