Skip to content

Commit

Permalink
make+GitHub: assert test vectors are updated
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Jul 25, 2023
1 parent 7de9ef1 commit 0307a71
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ jobs:
- name: Run go mod tidy
run: make mod-check

test-vector-check:
name: test vector check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3

- name: Setup go environment
uses: ./.github/actions/setup-go

- name: Run test vector creation check
run: make test-vector-check

########################
# Compilation check.
########################
Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,22 @@ mod-check: mod-tidy
@$(call print, "Checking modules.")
if test -n "$$(git status | grep -e "go.mod\|go.sum")"; then echo "Running go mod tidy changes go.mod/go.sum"; git status; git diff; exit 1; fi

gen-test-vectors:
@$(call print, "Generating test vectors.")
make unit gen-test-vectors=true pkg=address case=TestAddressEncoding
make unit gen-test-vectors=true pkg=asset case=TestAssetEncoding
make unit gen-test-vectors=true pkg=mssmt case=TestProofEncoding
make unit gen-test-vectors=true pkg=mssmt case=TestInsertionOverflow
make unit gen-test-vectors=true pkg=mssmt case=TestReplaceWithEmptyBranch
make unit gen-test-vectors=true pkg=mssmt case=TestReplace
make unit gen-test-vectors=true pkg=proof case=TestGenesisProofVerification
make unit gen-test-vectors=true pkg=tappsbt case=TestEncodingDecoding
make unit gen-test-vectors=true pkg=vm case=TestVM

test-vector-check: gen-test-vectors
@$(call print, "Checking test vectors.")
if test -n "$$(git status | grep -e ".json")"; then echo "Test vectors not updated"; git status; git diff; exit 1; fi

clean:
@$(call print, "Cleaning source.$(NC)")
$(RM) coverage.txt
Expand Down

0 comments on commit 0307a71

Please sign in to comment.