-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
23 lines (20 loc) · 978 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
MOLC := moleculec
MOLC_VERSION := 0.7.5
MOLC_TEST_DIR = ./test/molecule-test
ci:
cargo fmt --all -- --check
RUSTFLAGS='-D warnings' cargo clippy --all
cargo install moleculec --vers ${MOLC_VERSION}
cargo install --path .
$(shell mkdir -p ${MOLC_TEST_DIR})
moleculec --language go --schema-file ./test/schema/types.mol | gofmt > ./test/molecule-test/types.go
make gen-test
cd ./test/molecule-test/ && go test -count=1 -v
rm ./test/molecule-test/types.go && touch test/molecule-test/types.go
rm ./test/molecule-test/default_test.go && rm test/molecule-test/simple_test.go
check-moleculec-version:
test "$$(${MOLC} --version | awk '{ print $$2 }' | tr -d ' ')" = ${MOLC_VERSION}
gen-test:
cargo build --all
./target/debug/test-codegen ./test/schema/types.mol ./test/testset/default.yaml | gofmt > ./test/molecule-test/default_test.go
./target/debug/test-codegen ./test/schema/types.mol ./test/testset/simple.yaml | gofmt > ./test/molecule-test/simple_test.go