Skip to content

Commit

Permalink
kiele: Add coverage command
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrepta committed Oct 18, 2021
1 parent a8cfa25 commit a7f7977
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kiele
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ run_coverage() {
if ! nc -z "$kiele_host" "$kiele_port"; then
notif "No listener found on port $kiele_port, so there wont be any coverage data!"
fi
kiele-coverage.py "$run_file" --port "$kiele_port" > "$output_path"
kiele-coverage.py "$run_file" --port "$kiele_port" --output "$output_path"
}

run_generate_report() {
Expand Down Expand Up @@ -153,7 +153,7 @@ if [[ "$run_command" == 'help' ]] || [[ "$run_command" == '--help' ]] ; then
$0 krun [--backend (standalone|haskell|node|check)] <KIELE arg>* <pgm> <K arg>*
$0 check <KIELE arg>* <pgm> <K arg>*
$0 vm <KIELE arg>*
$0 coverage <combined.json path> [-o|--output <Report output path>]
$0 coverage <combined.json path> [-p|--port <client port>] [-o|--output <Report output path>]
$0 generate-report [--create-archive] <Report json path> [-o|--output <Report output path>]
$0 upload <Report json path>
Expand Down
5 changes: 4 additions & 1 deletion kiele-coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def make_parser():
parser = argparse.ArgumentParser()
parser.add_argument(type=str, metavar='<isolc combined-json>', dest='combined',
help='combined.json file generated by isolc with asm,srcmap options')
parser.add_argument('-o', '--output', type=str, default='report.json', metavar='<output file>', dest='output',
help='Output file')
parser.add_argument('-p', '--port', type=int, default=8546, metavar='<port>', dest='port',
help='Port number for RPC client')
return parser
Expand Down Expand Up @@ -105,4 +107,5 @@ def make_parser():
""" Get coverage from client """
retrieve_coverage(output, args.port)

print(json.dumps(output, indent=2))
with open(args.output, mode='w') as f:
f.write(json.dumps(output, indent=2))

0 comments on commit a7f7977

Please sign in to comment.