kopia lustrzana https://gitlab.com/gerbolyze/gerbonara
rodzic
6752dab125
commit
ee233317f1
|
@ -151,8 +151,12 @@ def svg_soup(filename):
|
||||||
f.write(str(soup))
|
f.write(str(soup))
|
||||||
|
|
||||||
def cleanup_gerbv_svg(soup):
|
def cleanup_gerbv_svg(soup):
|
||||||
soup.svg['width'] = f'{float(soup.svg["width"])/72*25.4:.4f}mm'
|
width = soup.svg["width"]
|
||||||
soup.svg['height'] = f'{float(soup.svg["height"])/72*25.4:.4f}mm'
|
height = soup.svg["height"]
|
||||||
|
width = width[:-2] if width.endswith('pt') else width
|
||||||
|
height = height[:-2] if height.endswith('pt') else height
|
||||||
|
soup.svg['width'] = f'{float(width)/72*25.4:.4f}mm'
|
||||||
|
soup.svg['height'] = f'{float(height)/72*25.4:.4f}mm'
|
||||||
for group in soup.find_all('g'):
|
for group in soup.find_all('g'):
|
||||||
# gerbv uses Cairo's SVG canvas. Cairo's SVG canvas is kind of broken. It has no support for unit
|
# gerbv uses Cairo's SVG canvas. Cairo's SVG canvas is kind of broken. It has no support for unit
|
||||||
# handling at all, which means the output files just end up being in pixels at 72 dpi. Further, it
|
# handling at all, which means the output files just end up being in pixels at 72 dpi. Further, it
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
FROM docker.io/archlinux:latest
|
FROM docker.io/archlinux:latest
|
||||||
MAINTAINER gerbolyze@jaseg.de
|
MAINTAINER gerbolyze@jaseg.de
|
||||||
RUN pacman --noconfirm -Syu
|
RUN pacman --noconfirm -Syu
|
||||||
RUN pacman --noconfirm -Sy git python python-pip base-devel python-numpy python-slugify python-lxml python-click python-pillow librsvg python-scipy python-sphinx python-pytest twine python-beautifulsoup4 gerbv rustup cargo
|
RUN pacman --noconfirm -Sy git python python-pip base-devel python-numpy python-slugify python-lxml python-click python-pillow librsvg python-scipy python-sphinx python-pytest twine python-beautifulsoup4 gerbv rustup cargo rsync
|
||||||
RUN python3 -m pip install pytest-parallel
|
RUN python3 -m pip install pytest-parallel
|
||||||
RUN rustup install stable
|
RUN rustup install stable
|
||||||
RUN rustup default stable
|
RUN rustup default stable
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
git
|
|
@ -1,12 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
git clone /data/git git
|
rsync -av /data/git git
|
||||||
cd git
|
cd git
|
||||||
|
|
||||||
if [ $# -ge 1 -a "$1" = "--parallel" ]; then
|
python3 -m pytest $@
|
||||||
python3 -m pytest --workers auto
|
|
||||||
else
|
|
||||||
python3 -m pytest -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
FROM docker.io/ubuntu:latest
|
FROM docker.io/ubuntu:latest
|
||||||
MAINTAINER gerbolyze@jaseg.de
|
MAINTAINER gerbolyze@jaseg.de
|
||||||
RUN env DEBIAN_FRONTEND=noninteractive apt update -y
|
RUN env DEBIAN_FRONTEND=noninteractive apt update -y
|
||||||
RUN env DEBIAN_FRONTEND=noninteractive apt install -y python3 git python3-wheel curl python3-pip python3-venv cargo
|
RUN env DEBIAN_FRONTEND=noninteractive apt install -y python3 git python3-wheel curl python3-pip python3-venv cargo gerbv
|
||||||
RUN cargo install usvg resvg
|
RUN cargo install usvg resvg
|
||||||
RUN python3 -m pip install numpy slugify lxml click pillow scipy sphinx pytest beautifulsoup4 pytest-parallel
|
RUN python3 -m pip install numpy slugify lxml click pillow scipy sphinx pytest beautifulsoup4 pytest-parallel
|
||||||
|
RUN env DEBIAN_FRONTEND=noninteractive apt install -y rsync
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[pytest]
|
||||||
|
testpaths = gerbonara/tests
|
||||||
|
norecursedirs=*
|
28
run-tests.sh
28
run-tests.sh
|
@ -1,14 +1,32 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
CONTAINER_ARGS="$@"
|
|
||||||
|
|
||||||
rm -rf podman/testdata/git
|
while [ $# -gt 0 ]; do
|
||||||
git clone --depth 1 . podman/testdata/git
|
case $1 in
|
||||||
|
--parallel)
|
||||||
|
CONTAINER_ARGS="--workers auto $CONTAINER_ARGS"
|
||||||
|
shift;;
|
||||||
|
-x)
|
||||||
|
CONTAINER_ARGS="-x $CONTAINER_ARGS"
|
||||||
|
shift;;
|
||||||
|
--no-cache)
|
||||||
|
NO_CACHE=--no-cache
|
||||||
|
shift;;
|
||||||
|
*)
|
||||||
|
echo "Unknown argument \"$1\""
|
||||||
|
exit 1
|
||||||
|
shift;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
for distro in arch ubuntu
|
mkdir -p podman/testdata/git
|
||||||
|
git ls-tree --full-tree -r HEAD --name-only | rsync -lptgoDv --delete . --files-from - podman/testdata/git/
|
||||||
|
#git clone --depth 1 . podman/testdata/git
|
||||||
|
|
||||||
|
for distro in ubuntu arch
|
||||||
do
|
do
|
||||||
podman build -t gerbonara-$distro-testenv -f podman/$distro-testenv
|
podman build $NO_CACHE -t gerbonara-$distro-testenv -f podman/$distro-testenv
|
||||||
mkdir -p /tmp/gerbonara-test-out
|
mkdir -p /tmp/gerbonara-test-out
|
||||||
podman run --mount type=bind,src=podman/testdata,dst=/data,ro --mount type=bind,src=/tmp/gerbonara-test-out,dst=/out gerbonara-$distro-testenv /data/testscript.sh $CONTAINER_ARGS
|
podman run --mount type=bind,src=podman/testdata,dst=/data,ro --mount type=bind,src=/tmp/gerbonara-test-out,dst=/out gerbonara-$distro-testenv /data/testscript.sh $CONTAINER_ARGS
|
||||||
done
|
done
|
||||||
|
|
Ładowanie…
Reference in New Issue