Skip to content

Commit

Permalink
Adjust serialisation test (skip it on Mac, avoid using time -f)
Browse files Browse the repository at this point in the history
  • Loading branch information
jberthold committed Apr 17, 2024
1 parent af8e6e3 commit f31d984
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/serialized-definition/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,33 @@ include $(CURDIR)/../include.mk

KORE_FILES=$(wildcard [a-z]*definition.kore)

ifeq "$(shell uname)" "Darwin"
.PHONY: test
test:
@echo "Skipping serialization test on Mac OS"
else
test: $(addprefix test-,$(basename $(KORE_FILES)))
endif

MODULE=UNDEFINED-MODULE

# lame solution: specify the --module $MODULE individually instead of grep|tail|sed
test-a-to-f-definition: MODULE=TEST
test-test-smoke-definition: MODULE=C
test-test-totalSupply-definition: MODULE=VERIFICATION

test-%: %.kore
@echo "Serializing definition $<"
time -f "%esec" $(KORE_EXEC) $< --output serialized.bin --module $(MODULE) --serialize
$(KORE_EXEC) $< --output serialized.bin --module $(MODULE) --serialize
@echo "Loading serialized definition (to hit an error afterwards)"
time -f "%esec" sh -c "$(KORE_EXEC) serialized.bin \
sh -c "$(KORE_EXEC) serialized.bin \
--module $(MODULE) \
--pattern serialized.bin \
--debug-rewrite FAIL-ME-PLEASE 2>&1 | \
grep FAIL-ME-PLEASE"
@rm serialized.bin

.PHONY: clean
clean:
rm -f serialized.bin

golden:

0 comments on commit f31d984

Please sign in to comment.