Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/komet/kasmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions src/komet/komet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)


Expand Down
3 changes: 3 additions & 0 deletions src/komet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
class KSorobanError(RuntimeError): ...


class KSorobanFailure(RuntimeError): ...


class SorobanDefinition:
"""Anything related to the Soroban K definition goes here."""

Expand Down
Loading