Files
lattigo/Makefile
2020-09-24 17:01:57 +02:00

47 lines
1.0 KiB
Makefile

EXCLUDE_LINT = "_test.go"
test_fmt:
@echo Checking correct formatting of files
@{ \
files=$$( go fmt ./... ); \
if [ -n "$$files" ]; then \
echo "Files not properly formatted: $$files"; \
exit 1; \
fi; \
if ! go vet ./...; then \
exit 1; \
fi \
}
test_lint:
@echo Checking linting of files
@{ \
go install golang.org/x/lint/golint; \
el=$(EXCLUDE_LINT); \
lintfiles=$$( golint ./... | egrep -v "$$el" ); \
if [ -n "$$lintfiles" ]; then \
echo "Lint errors:"; \
echo "$$lintfiles"; \
exit 1; \
fi \
}
test_examples:
@echo Running the examples
go run ./examples/bfv > /dev/null
go run ./examples/ckks/euler > /dev/null
go run ./examples/ckks/sigmoid > /dev/null
go run ./examples/dbfv/pir &> /dev/null
go run ./examples/dbfv/psi &> /dev/null
@echo ok
@echo Building resources-heavy examples
go build -o /dev/null ./examples/ckks/bootstrapping
@echo ok
test_gotest:
go test -v -short -p=1 ./... -timeout=0
test: test_fmt test_gotest test_examples
local: test_fmt test_lint test_gotest test_examples