]> granicus.if.org Git - graphviz/commitdiff
Move test code from .gitlab-ci.yml to new ci/test.sh script
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 11 Apr 2020 09:36:02 +0000 (11:36 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 13 Apr 2020 06:35:37 +0000 (08:35 +0200)
.gitlab-ci.yml
ci/test.sh [new file with mode: 0755]

index 18c5997ca645f8bad23b90890b94b375026041f8..aef2507fb916c8095b295a49a5c78bcb55e85841 100644 (file)
@@ -48,21 +48,10 @@ portable-source:
     except:
         - tags
 
-.test_template: &deb_test_definition
+.test_template: &test_definition
     stage: test
     script:
-        - cat /etc/os-release
-        - GV_VERSION=$( cat VERSION )
-        - COLLECTION=$( cat COLLECTION )
-        - zcat graphviz-${GV_VERSION}.tar.gz | tar xf -
-        - . /etc/os-release
-        - DIR=Packages/${COLLECTION}/${ID}/${VERSION_ID}
-        - ARCH=$( uname -m )
-        - apt install ./${DIR}/os/${ARCH}/libgraphviz4_${GV_VERSION}-1_amd64.deb
-        - apt install ./${DIR}/os/${ARCH}/graphviz_${GV_VERSION}-1_amd64.deb
-        - cd graphviz-${GV_VERSION}
-        - ./configure
-        - make -C tests/regression_tests/shapes check
+        - ci/test.sh
 
 centos6-build:
     <<: *rpm_build_definition
@@ -149,19 +138,19 @@ ubuntu19-10-build:
     image: "graphviz/graphviz:ubuntu-19.10"
 
 ubuntu18-04-test:
-    <<: *deb_test_definition
+    <<: *test_definition
     tags:
         - linux
     image: "graphviz/graphviz:ubuntu-18.04"
 
 ubuntu19-04-test:
-    <<: *deb_test_definition
+    <<: *test_definition
     tags:
         - linux
     image: "graphviz/graphviz:ubuntu-19.04"
 
 ubuntu19-10-test:
-    <<: *deb_test_definition
+    <<: *test_definition
     tags:
         - linux
     image: "graphviz/graphviz:ubuntu-19.10"
diff --git a/ci/test.sh b/ci/test.sh
new file mode 100755 (executable)
index 0000000..bcce40c
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+
+set -x
+
+if test -f /etc/os-release; then
+    cat /etc/os-release
+    . /etc/os-release
+else
+    cat /etc/redhat-release
+    ID=$( cat /etc/redhat-release | cut -d' ' -f1 | tr 'A-Z' 'a-z' )
+    VERSION_ID=$( cat /etc/redhat-release | cut -d' ' -f3  | cut -d'.' -f1 )
+fi
+GV_VERSION=$( cat VERSION )
+COLLECTION=$( cat COLLECTION )
+tar xfz graphviz-${GV_VERSION}.tar.gz
+DIR=Packages/${COLLECTION}/${ID}/${VERSION_ID}
+ARCH=$( uname -m )
+if [ "${ID_LIKE}" = "debian" ]; then
+    apt install ./${DIR}/os/${ARCH}/libgraphviz4_${GV_VERSION}-1_amd64.deb
+    apt install ./${DIR}/os/${ARCH}/graphviz_${GV_VERSION}-1_amd64.deb
+else
+    rpm --install --force ${DIR}/os/${ARCH}/*.rpm
+fi
+cd graphviz-${GV_VERSION}
+./configure
+ln -s /usr/bin/dot cmd/dot/dot_builtins
+ln -s /usr/bin/diffimg contrib/diffimg/diffimg
+make -C tests/regression_tests/shapes check