diff --git a/src/komet/kasmer.py b/src/komet/kasmer.py index 6820974..9e96b0b 100644 --- a/src/komet/kasmer.py +++ b/src/komet/kasmer.py @@ -42,7 +42,7 @@ ) from .proof import is_functional, run_claim, run_functional_claim from .scval import SCType -from .utils import KSorobanError, concrete_definition +from .utils import KSorobanError, KSorobanFailure, concrete_definition if TYPE_CHECKING: from collections.abc import Iterable, Mapping @@ -337,7 +337,7 @@ def deploy_and_run( pretty_args = ', '.join(self.definition.krun.pretty_print(a) for a in err.counterexample) console.print(f' {err.test_name} ({pretty_args})') - raise KSorobanError(failed) + raise KSorobanFailure(failed) def deploy_and_prove( self, diff --git a/src/komet/komet.py b/src/komet/komet.py index b17b122..35bbbda 100644 --- a/src/komet/komet.py +++ b/src/komet/komet.py @@ -22,7 +22,7 @@ from komet.proof import simplify from .kasmer import Kasmer -from .utils import KSorobanError, concrete_definition, symbolic_definition +from .utils import KSorobanError, KSorobanFailure, concrete_definition, symbolic_definition if TYPE_CHECKING: from collections.abc import Iterator @@ -164,7 +164,11 @@ def _exec_test(*, dir_path: Path | None, wasm: Path | None, max_examples: int, i try: kasmer.deploy_and_run(wasm, child_wasms, max_examples, id) sys.exit(0) - except KSorobanError: + except KSorobanFailure: + # Assume that the failures have been printed already + sys.exit(1) + except KSorobanError as err: + print(str(err), file=sys.stderr) sys.exit(1) diff --git a/src/komet/utils.py b/src/komet/utils.py index 15e0e56..17caf8b 100644 --- a/src/komet/utils.py +++ b/src/komet/utils.py @@ -28,6 +28,9 @@ class KSorobanError(RuntimeError): ... +class KSorobanFailure(RuntimeError): ... + + class SorobanDefinition: """Anything related to the Soroban K definition goes here."""