Skip to content

Commit

Permalink
Merge pull request #108 from near/viktar/spectest-i32
Browse files Browse the repository at this point in the history
CI: i32 spectest
  • Loading branch information
MCJOHN974 authored Nov 24, 2023
2 parents 48c7108 + 3fc30db commit fbe8b11
Show file tree
Hide file tree
Showing 574 changed files with 9,408 additions and 15 deletions.
6 changes: 5 additions & 1 deletion ci/spectest-zkasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ fi
# Assert results of running tests commited
TEST_PATH=../../${1:-"cranelift/zkasm_data/spectest/i64/generated"}
# We don't expect all tests will pass so ignore if testing script exits with non zero code
(npm test --prefix tests/zkasm $TEST_PATH || true) | python3 ci/zkasm-result.py
(npm test --prefix tests/zkasm $TEST_PATH || true) | python3 ci/zkasm-result.py -b 64

TEST_PATH=../../${1:-"cranelift/zkasm_data/spectest/i32/generated"}
# We don't expect all tests will pass so ignore if testing script exits with non zero code
(npm test --prefix tests/zkasm $TEST_PATH || true) | python3 ci/zkasm-result.py -b 32
18 changes: 14 additions & 4 deletions ci/zkasm-result.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import os
import csv
import sys
import argparse


tests_dir = 'cranelift/zkasm_data/spectest/i64'
generated_dir = 'cranelift/zkasm_data/spectest/i64/generated'
state_csv_path = 'cranelift/codegen/src/isa/zkasm/docs/state.csv'
parser = argparse.ArgumentParser(description='Example script to demonstrate flag usage.')
parser.add_argument('-b', type=int, help='An integer value for the -b flag')
parser.add_argument('--update', action='store_true', help='Flag to specify update')
args = parser.parse_args()
bitness = args.b
update = args.update



tests_dir = f'cranelift/zkasm_data/spectest/i{bitness}'
generated_dir = f'cranelift/zkasm_data/spectest/i{bitness}/generated'
state_csv_path = f'cranelift/codegen/src/isa/zkasm/docs/spectests/i{bitness}.csv'


def check_compilation_status():
Expand Down Expand Up @@ -57,7 +67,7 @@ def assert_with_csv(status_map):
def main():
status_map = check_compilation_status()
update_status_from_stdin(status_map)
if '--update' in sys.argv:
if update:
write_csv(status_map)
else:
if assert_with_csv(status_map) != 0:
Expand Down
Loading

0 comments on commit fbe8b11

Please sign in to comment.