Skip to content

Commit 332a5e3

Browse files
authored
Merge pull request #1664 from markopiers/out-itf-should-not-supress-output
Allow --verbosity to override default suppression by --out-itf (#1571)
2 parents 11605b6 + 42c6ed2 commit 332a5e3

File tree

5 files changed

+40
-8
lines changed

5 files changed

+40
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111
### Changed
12+
13+
- `--out-itf` does not suppress outputs anymore. Shown output amount only depends on `--verbosity` now (#1664)
14+
1215
### Deprecated
1316
### Removed
1417
### Fixed

docs/pages/docs/quint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Options:
229229
[string]
230230
--out-itf output the trace in the Informal Trace Format to file, e.g.,
231231
out_{seq}.itf.json where {seq} is the trace sequence number
232-
(suppresses all console output) [string]
232+
[string]
233233
--max-samples the maximum number of runs to attempt before giving up
234234
[number] [default: 10000]
235235
--n-traces how many traces to generate (only affects output to out-itf)

quint/io-cli-tests.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
This is a suite of blackbox integration tests for the `quint` executable.
32
The tests in this file check that particular output is produced when
43
particular input is received.
@@ -778,6 +777,7 @@ error: Invariant violated
778777
```
779778
quint run --out-itf=out-itf-example.itf.json --max-steps=5 --seed=123 \
780779
--invariant=totalSupplyDoesNotOverflowInv \
780+
--verbosity=0 \
781781
../examples/tutorials/coin.qnt
782782
cat out-itf-example.itf.json | jq '.states[0]."balances"."#map"[0]'
783783
rm out-itf-example.itf.json
@@ -799,6 +799,7 @@ rm out-itf-example.itf.json
799799
```
800800
quint run --out-itf=out-itf-mbt-example.itf.json --max-steps=5 --seed=123 \
801801
--invariant=totalSupplyDoesNotOverflowInv --mbt\
802+
--verbosity=0 \
802803
../examples/tutorials/coin.qnt
803804
cat out-itf-mbt-example.itf.json | jq '.states[1]'
804805
rm out-itf-mbt-example.itf.json
@@ -869,7 +870,7 @@ rm out-itf-mbt-example.itf.json
869870

870871
<!-- !test in successful run itf -->
871872
```
872-
quint run --out-itf=out-itf-example.itf.json --max-steps=5 --seed=123 ../examples/tutorials/coin.qnt
873+
quint run --out-itf=out-itf-example.itf.json --max-steps=5 --seed=123 --verbosity=0 ../examples/tutorials/coin.qnt
873874
cat out-itf-example.itf.json | jq '.states[0]."balances"."#map"[0]'
874875
rm out-itf-example.itf.json
875876
```
@@ -888,7 +889,7 @@ rm out-itf-example.itf.json
888889

889890
<!-- !test in run with n-traces itf -->
890891
```
891-
quint run --out-itf=out-itf-example.itf.json --n-traces=3 --mbt --max-steps=5 --seed=123 ../examples/tutorials/coin.qnt
892+
quint run --out-itf=out-itf-example.itf.json --n-traces=3 --mbt --max-steps=5 --seed=123 --verbosity=0 ../examples/tutorials/coin.qnt
892893
cat out-itf-example0.itf.json | jq '.["#meta"].status'
893894
cat out-itf-example1.itf.json | jq '.states[0]["mbt::actionTaken"]'
894895
rm out-itf-example*.itf.json
@@ -904,7 +905,7 @@ rm out-itf-example*.itf.json
904905

905906
<!-- !test in run with n-traces itf violation -->
906907
```
907-
quint run --out-itf=out-itf-example.itf.json --n-traces=3 --max-steps=5 --seed=123 ../examples/tutorials/coin.qnt \
908+
quint run --out-itf=out-itf-example.itf.json --n-traces=3 --max-steps=5 --seed=123 --verbosity=0 ../examples/tutorials/coin.qnt \
908909
--invariant=totalSupplyDoesNotOverflowInv
909910
cat out-itf-example0.itf.json | jq '.["#meta"].status'
910911
cat out-itf-example1.itf.json | jq '.["#meta"].status'
@@ -1476,3 +1477,31 @@ won(X) was witnessed in 99 trace(s) out of 100 explored (99.00%)
14761477
stalemate was witnessed in 1 trace(s) out of 100 explored (1.00%)
14771478
Use --seed=0x2b442ab439177 to reproduce.
14781479
```
1480+
1481+
### Run produces normal output on `--out-itf` with default verbosity
1482+
1483+
<!-- !test exit 1 -->
1484+
<!-- !test in run itf default verbosity -->
1485+
```
1486+
output=$(quint run --out-itf=out.itf.json --max-steps=5 --seed=123 \
1487+
--invariant=totalSupplyDoesNotOverflowInv \
1488+
../examples/tutorials/coin.qnt 2>&1)
1489+
exit_code=$?
1490+
rm out.itf.json
1491+
echo "$output" | head
1492+
exit $exit_code
1493+
```
1494+
1495+
<!-- !test out run itf default verbosity -->
1496+
```
1497+
An example execution:
1498+
1499+
[State 0]
1500+
{
1501+
balances:
1502+
Map("alice" -> 0, "bob" -> 0, "charlie" -> 0, "eve" -> 0, "null" -> 0),
1503+
minter: "null"
1504+
}
1505+
1506+
[State 1]
1507+
```

quint/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const runCmd = {
238238
type: 'string',
239239
})
240240
.option('out-itf', {
241-
desc: 'output the trace in the Informal Trace Format to file, e.g., out_{seq}.itf.json where {seq} is the trace sequence number (suppresses all console output)',
241+
desc: 'output the trace in the Informal Trace Format to file, e.g., out_{seq}.itf.json where {seq} is the trace sequence number',
242242
type: 'string',
243243
})
244244
.option('max-samples', {

quint/src/cliCommands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ function maybePrintWitnesses(verbosityLevel: number, outcome: Outcome, witnesses
517517
export async function runSimulator(prev: TypecheckedStage): Promise<CLIProcedure<TracingStage>> {
518518
const simulator = { ...prev, stage: 'running' as stage }
519519
const startMs = Date.now()
520-
// Force disable output if `--out-itf` is set
521-
const verbosityLevel = prev.args.outItf ? 0 : deriveVerbosity(prev.args)
520+
// Verboity level controls how much of the output is shown
521+
const verbosityLevel = deriveVerbosity(prev.args)
522522
const mainName = guessMainModule(prev)
523523
const main = prev.modules.find(m => m.name === mainName)
524524
if (!main) {

0 commit comments

Comments
 (0)