Browse Source

Merge branch 'master' into wrap_highlevel

refactoring
Sebastian Junges 6 years ago
parent
commit
aa614b83dd
  1. 7
      setup.py
  2. 30
      tests/storage/test_prism.py

7
setup.py

@ -34,7 +34,7 @@ class CMakeBuild(build_ext):
('disable-dft', None, 'Disable support for DFTs'),
('disable-pars', None, 'Disable support for parametric models'),
('debug', None, 'Build in Debug mode'),
('jobs=', 'j', 'Number of jobs to use for compiling'),
('jobs=', 'j', 'Number of jobs to use for compiling')
]
config = SetupConfig()
@ -50,12 +50,13 @@ class CMakeBuild(build_ext):
", ".join(e.name for e in self.extensions))
# Build cmake version info
print("Stormpy - Building into {}".format(self.build_temp))
build_temp_version = self.build_temp + "-version"
setup_helper.ensure_dir_exists(build_temp_version)
# Write config
setup_helper.ensure_dir_exists("build")
self.config.write_config("build/build_config.cfg")
setup_helper.ensure_dir_exists(self.build_temp)
self.config.write_config(os.path.join(self.build_temp, "build_config.cfg"))
cmake_args = []
storm_dir = os.path.expanduser(self.config.get_as_string("storm_dir"))

30
tests/storage/test_prism.py

@ -0,0 +1,30 @@
import stormpy
import stormpy.logic
from helpers.helper import get_example_path
import pytest
class TestPrism:
def test_prism_to_jani_states(self):
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm"))
orig_properties = stormpy.parse_properties_for_prism_program("P=? [F s=7]", program)
assert len(orig_properties) == 1
jani_model, new_properties = program.to_jani(orig_properties)
assert len(new_properties) == len(orig_properties)
def test_prism_to_jani_labels(self):
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm"))
orig_properties = stormpy.parse_properties_for_prism_program("P=? [F \"two\"]", program)
assert len(orig_properties) == 1
jani_model, new_properties = program.to_jani(orig_properties)
assert len(new_properties) == len(orig_properties)
def test_prism_to_jani_repetitive(self):
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm"))
orig_properties = stormpy.parse_properties_for_prism_program("P=? [F \"two\"]", program)
jani_model, new_properties = program.to_jani(orig_properties)
assert len(new_properties) == len(orig_properties)
orig_properties = stormpy.parse_properties_for_prism_program("P=? [F s=7]", program)
jani_model, new_properties = program.to_jani(orig_properties, suffix = "2")
assert len(new_properties) == len(orig_properties)
Loading…
Cancel
Save