aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2018-05-18 20:27:06 +0200
committerFabian Groffen <grobian@gentoo.org>2018-05-18 20:27:06 +0200
commitc73ba1a6e8713f267be8c5083541619753993515 (patch)
tree02ef814134ba1e806b942561c642658b78336b30
parentatom_explode: find the last version-like component (diff)
downloadportage-utils-c73ba1a6e8713f267be8c5083541619753993515.tar.gz
portage-utils-c73ba1a6e8713f267be8c5083541619753993515.tar.bz2
portage-utils-c73ba1a6e8713f267be8c5083541619753993515.zip
tests/atom_explode: use pre-build files to allow running
Make this test run on platforms with a different portdir, or without Portage (such as Travis). This should avoid regressions like bug #567336
-rwxr-xr-xtests/atom_explode/atom-explode.py2
-rwxr-xr-xtests/atom_explode/dotest30
-rw-r--r--tests/atom_explode/ebuildlist.xzbin0 -> 298948 bytes
-rw-r--r--tests/atom_explode/portageatoms.xzbin0 -> 728208 bytes
4 files changed, 18 insertions, 14 deletions
diff --git a/tests/atom_explode/atom-explode.py b/tests/atom_explode/atom-explode.py
index 972bac7..3168c7e 100755
--- a/tests/atom_explode/atom-explode.py
+++ b/tests/atom_explode/atom-explode.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
import sys,portage
diff --git a/tests/atom_explode/dotest b/tests/atom_explode/dotest
index 3fe7086..e911ab5 100755
--- a/tests/atom_explode/dotest
+++ b/tests/atom_explode/dotest
@@ -3,26 +3,30 @@
. ../init.sh || exit 1
PORTDIR=$(DEBUG=: q -Ch 2>&1 | grep ^PORTDIR | awk '{print $NF}')
-pushd "${PORTDIR}"/metadata/md5-cache >/dev/null || { echo SKIPPED; exit 0 ; }
-
-if [[ $1 == -v ]] ; then
- find . -mindepth 2 -type f -printf '%P\n%f\n' | while read line ; do
- echo "TESTING $line: "
- "$b"/e "${line}"
- done
- exit 0
+if [[ -d "${PORTDIR}"/metadata/md5-cache ]] ; then
+ pushd "${PORTDIR}"/metadata/md5-cache >/dev/null || exit $?
+
+ if [[ $1 == -v ]] ; then
+ find . -mindepth 2 -type f -printf '%P\n%f\n' | while read line ; do
+ echo "TESTING $line: "
+ "$b"/e "${line}"
+ done
+ exit 0
+ fi
+
+ # split the disk i/o out so both tests are CPU bound only
+ files=$(find . -mindepth 2 -type f ! -name "Manifest.*" -printf '%P\n%f\n')
+ popd >/dev/null
+else
+ files=$(xzcat ebuildlist.xz)
fi
-# split the disk i/o out so both tests are CPU bound only
-files=$(find . -mindepth 2 -type f ! -name "Manifest.*" -printf '%P\n%f\n')
-popd >/dev/null
-
printf "atom_explode():"
time echo "${files}" | "$b"/e > "$b"/me || exit $?
echo
printf "portage:"
-time echo "${files}" | "$s"/atom-explode.py > "$b"/py || exit $?
+time echo "${files}" | "$s"/atom-explode.py > "$b"/py || xzcat portageatoms.xz > "$b"/py
echo
diff -U 0 "$b"/me "$b"/py
diff --git a/tests/atom_explode/ebuildlist.xz b/tests/atom_explode/ebuildlist.xz
new file mode 100644
index 0000000..6c7148f
--- /dev/null
+++ b/tests/atom_explode/ebuildlist.xz
Binary files differ
diff --git a/tests/atom_explode/portageatoms.xz b/tests/atom_explode/portageatoms.xz
new file mode 100644
index 0000000..e7b062a
--- /dev/null
+++ b/tests/atom_explode/portageatoms.xz
Binary files differ