Skip to content

Commit

Permalink
Test/build on macos.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkyaraj-23 committed Oct 26, 2023
1 parent 99f7f49 commit 5f9543b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
- name: Generate
run: |
export PATH=/home/opam/.opam/4.14/bin:$PATH
cp ./app/src/parser/[!g]*.[ch] ./tests/unit
dune exec ./tests/generate/generate.exe micheline 500 \
nano tests/samples/micheline
dune exec ./tests/generate/generate.exe operations 500 \
Expand Down
49 changes: 26 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,34 @@ docker_ledger_app_integration_tests:
$(DOCKER) build -t ledger-app-tezos-integration-tests \
-f docker/Dockerfile.integration-tests docker

docker_images: docker_speculos \
docker_ledger_app_builder \
docker_ledger_app_ocaml \
docker_ledger_app_integration_tests
docker_images: docker_speculos \
docker_ledger_app_builder \
docker_ledger_app_ocaml \
docker_ledger_app_integration_tests

scan-build-%:
SDK=$(shell echo $@ | sed 's/scan-build-\(.*\)/\U\1/')_SDK; \
$(DOCKER_RUN_APP_BUILDER) bash -c \
SDK=$(shell echo $* | tr "[:lower:]" "[:upper:]")_SDK; \
$(DOCKER_RUN_APP_BUILDER) bash -c \
"BOLOS_SDK=\$$$$SDK make -C app scan-build"

scan-build: scan-build-nanos scan-build-nanosp \
scan-build-nanox scan-build-stax

app_%.tgz: app/src/*.[ch] \
app/src/parser/*.[ch] \
app/Makefile
SDK=$(shell echo $@ | sed 's/app_\(.*\).tgz/\U\1/')_SDK; \
$(DOCKER_RUN_APP_BUILDER) bash -c \
"BOLOS_SDK=\$$$$SDK make -C app"
scan-build-nanox scan-build-stax

app_%_dbg.tgz: app/src/*.[ch] \
app/src/parser/*.[ch] \
app/Makefile
SDK=$(shell echo $* | tr "[:lower:]" "[:upper:]")_SDK; \
$(DOCKER_RUN_APP_BUILDER) bash -c \
"BOLOS_SDK=\$$$$SDK make -C app DEBUG=1"
$(DOCKER_RUN_APP_BUILDER) bash -c "cd app/bin/ && tar cz ." > $@

app_%_dbg.tgz: app/src/*.[ch] \

app_%.tgz: app/src/*.[ch] \
app/src/parser/*.[ch] \
app/Makefile
SDK=$(shell echo $@ | sed 's/app_\(.*\)_dbg.tgz/\U\1/')_SDK; \
$(DOCKER_RUN_APP_BUILDER) bash -c \
"BOLOS_SDK=\$$$$SDK make -C app DEBUG=1"
SDK=$(shell echo $* | tr "[:lower:]" "[:upper:]")_SDK; \
$(DOCKER_RUN_APP_BUILDER) bash -c \
"BOLOS_SDK=\$$$$SDK make -C app"
$(DOCKER_RUN_APP_BUILDER) bash -c "cd app/bin/ && tar cz ." > $@

clean:
Expand All @@ -70,18 +71,20 @@ clean:
$(DOCKER_RUN_APP_OCAML) bash -c "make -C /app/tests/generate clean && cd /app && rm -rf _build"

unit_tests: test/samples/micheline/nano/samples.hex \
test/samples/operations/nano/samples.hex \
test/samples/operations/nano/samples.hex\
tests/unit/*.ml* \
tests/unit/*.[ch] \
tests/unit/dune \
tests/unit/Makefile
@cp app/src/parser/[!g]*.[ch] tests/unit

$(DOCKER_RUN_APP_OCAML) make -C /app/tests/unit

RUN_TEST_DOCKER = ./tests/integration/run_test_docker.sh

integration_tests_basic_stax: app_stax.tgz \
app_stax_dbg.tgz \
tests/integration/* \
integration_tests_basic_stax: app_stax.tgz \
app_stax_dbg.tgz \
tests/integration/* \
tests/integration/stax/*
$(RUN_TEST_DOCKER) stax tests/integration/stax

Expand All @@ -98,7 +101,7 @@ integration_tests_basic: integration_tests_basic_nanos \
integration_tests_basic_stax

integration_tests_%: integration_tests_basic_% \
test/samples/operations/nano/samples.hex \
test/samples/operations/nano/samples.hex\
test/samples/micheline/nano/samples.hex \
tests/integration/*.sh
$(RUN_TEST_DOCKER) $* \
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
compat.h
formatting.c
formatting.h
micheline_parser.c
micheline_parser.h
micheline_state.h
num_parser.c
num_parser.h
num_state.h
operation_parser.c
operation_parser.h
operation_state.h
parser_state.c
parser_state.h
2 changes: 0 additions & 2 deletions tests/unit/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
(language c)
(names formatting parser_state num_parser micheline_parser operation_parser micheline_cparse_stubs)
(flags :standard -std=gnu99 -Werror=int-to-pointer-cast -Wall -Wextra -Werror -Wmissing-field-initializers)))

(copy_files "../../app/src/parser/[!g]*.[ch]")

0 comments on commit 5f9543b

Please sign in to comment.