Browse Source

Config flag whether xerces-c is available in Storm

refactoring
Matthias Volk 5 years ago
parent
commit
72de6872ea
  1. 6
      cmake/CMakeLists.txt
  2. 1
      cmake/config.py.in
  3. 1
      setup.py
  4. 2
      tests/configurations.py
  5. 3
      tests/gspn/test_gspn.py

6
cmake/CMakeLists.txt

@ -55,6 +55,12 @@ else()
set(STORM_CLN_RF_BOOL "False") set(STORM_CLN_RF_BOOL "False")
endif() endif()
if(STORM_HAVE_XERCES)
set(STORM_XERCES_BOOL "True")
else()
set(STORM_XERCES_BOOL "False")
endif()
if(HAVE_STORM_DFT) if(HAVE_STORM_DFT)
set(HAVE_STORM_DFT_BOOL "True") set(HAVE_STORM_DFT_BOOL "True")
else() else()

1
cmake/config.py.in

@ -4,6 +4,7 @@ STORM_DIR = "@STORM_DIR@"
STORM_VERSION = "@STORM_VERSION@" STORM_VERSION = "@STORM_VERSION@"
STORM_CLN_EA = @STORM_CLN_EA_BOOL@ STORM_CLN_EA = @STORM_CLN_EA_BOOL@
STORM_CLN_RF = @STORM_CLN_RF_BOOL@ STORM_CLN_RF = @STORM_CLN_RF_BOOL@
STORM_XERCES = @STORM_XERCES_BOOL@
HAVE_STORM_DFT = @HAVE_STORM_DFT_BOOL@ HAVE_STORM_DFT = @HAVE_STORM_DFT_BOOL@
HAVE_STORM_GSPN = @HAVE_STORM_GSPN_BOOL@ HAVE_STORM_GSPN = @HAVE_STORM_GSPN_BOOL@
HAVE_STORM_PARS = @HAVE_STORM_PARS_BOOL@ HAVE_STORM_PARS = @HAVE_STORM_PARS_BOOL@

1
setup.py

@ -153,6 +153,7 @@ class CMakeBuild(build_ext):
f.write("RationalFunction = pycarl.{}.RationalFunction\n".format(rfpackage)) f.write("RationalFunction = pycarl.{}.RationalFunction\n".format(rfpackage))
f.write("FactorizedRationalFunction = pycarl.{}.FactorizedRationalFunction\n".format(rfpackage)) f.write("FactorizedRationalFunction = pycarl.{}.FactorizedRationalFunction\n".format(rfpackage))
f.write("\n") f.write("\n")
f.write("storm_with_xerces = {}\n".format(cmake_conf.STORM_XERCES))
f.write("storm_with_dft = {}\n".format(use_dft)) f.write("storm_with_dft = {}\n".format(use_dft))
f.write("storm_with_gspn = {}\n".format(use_gspn)) f.write("storm_with_gspn = {}\n".format(use_gspn))
f.write("storm_with_pars = {}\n".format(use_pars)) f.write("storm_with_pars = {}\n".format(use_pars))

2
tests/configurations.py

@ -3,6 +3,7 @@ import pytest
import stormpy._config as config import stormpy._config as config
# Skip not supported functionality # Skip not supported functionality
has_xml = config.storm_with_xerces
has_dft = config.storm_with_dft has_dft = config.storm_with_dft
has_gspn = config.storm_with_gspn has_gspn = config.storm_with_gspn
has_pars = config.storm_with_pars has_pars = config.storm_with_pars
@ -15,6 +16,7 @@ try:
except ImportError: except ImportError:
has_numpy = False has_numpy = False
xml = pytest.mark.skipif(not has_xml, reason="No support for XML via xerces")
dft = pytest.mark.skipif(not has_dft, reason="No support for DFTs") dft = pytest.mark.skipif(not has_dft, reason="No support for DFTs")
gspn = pytest.mark.skipif(not has_gspn, reason="No support for GSPNs") gspn = pytest.mark.skipif(not has_gspn, reason="No support for GSPNs")
pars = pytest.mark.skipif(not has_pars, reason="No support for parametric model checking") pars = pytest.mark.skipif(not has_pars, reason="No support for parametric model checking")

3
tests/gspn/test_gspn.py

@ -2,7 +2,7 @@ import os
import stormpy import stormpy
from configurations import gspn
from configurations import gspn, xml
@gspn @gspn
@ -211,6 +211,7 @@ class TestGSPNBuilder:
tt_0 = gspn_import.get_timed_transition("tt_0") tt_0 = gspn_import.get_timed_transition("tt_0")
assert tt_0.get_id() == id_tt_0 assert tt_0.get_id() == id_tt_0
@xml
def test_export_to_pnml(self, tmpdir): def test_export_to_pnml(self, tmpdir):
builder = stormpy.gspn.GSPNBuilder() builder = stormpy.gspn.GSPNBuilder()
builder.set_name("gspn_test") builder.set_name("gspn_test")

Loading…
Cancel
Save