Skip to content

Commit 3af7f39

Browse files
committed
32bit architecture test environment
1 parent ceb71ce commit 3af7f39

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

Diff for: Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ help:
77
@echo - make docs ------- Make docs
88
@echo - make lint ------- Run lint
99
@echo - make test ------- Run test
10+
@echo - make test-32bit - Run test on 32bit architecture
1011
@echo - make typecheck -- Typecheck
1112
@echo - make venv ------- Create virtual environment
1213

@@ -32,6 +33,9 @@ lint:
3233
test:
3334
pytest
3435

36+
test-32bit:
37+
@make -C docker/i386 test
38+
3539
typecheck:
3640
mypy --strict --no-warn-unused-ignores cstruct
3741

Diff for: docker/i386/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM i386/ubuntu
2+
3+
RUN apt-get update && \
4+
apt-get -y install \
5+
python3.6 \
6+
python3.6-dev \
7+
python3.6-distutils \
8+
curl \
9+
make && \
10+
rm -rf /var/lib/apt/lists/*
11+
RUN curl -sSL https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip.py && \
12+
python3.6 get-pip.py
13+
RUN pip install pytest
14+
WORKDIR /app

Diff for: docker/i386/Makefile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
PROJECT=cstruct
2+
BASENAME=test-i386
3+
IMAGE_NAME=${PROJECT}-${BASENAME}
4+
5+
.PHONY: help build push all
6+
7+
help:
8+
@echo "- make build Build docker image"
9+
@echo "- make test Build and run tests"
10+
@echo "- make shell Run interactive shell"
11+
12+
.DEFAULT_GOAL := help
13+
14+
build:
15+
@DOCKER_BUILDKIT=1 docker build --tag ${IMAGE_NAME}:latest .
16+
17+
test: build
18+
@docker run --rm -it \
19+
--mount type=bind,source=$$PWD/../..,target=/app \
20+
--hostname=$(BASENAME) \
21+
${IMAGE_NAME} \
22+
pytest
23+
24+
shell:
25+
@docker run --rm -it \
26+
--mount type=bind,source=$$PWD/../..,target=/app \
27+
--hostname=$(BASENAME) \
28+
${IMAGE_NAME} \
29+
bash -i
30+
31+
all: build

0 commit comments

Comments
 (0)