public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/
@ 2015-02-21  0:00 Mike Frysinger
  0 siblings, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2015-02-21  0:00 UTC (permalink / raw
  To: gentoo-commits

commit:     4ec8b2852f194709aca48be26888fd52c0f09c2f
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 20 22:38:35 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Feb 20 22:38:35 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=4ec8b285

tests: atom_explode: update cache location

---
 tests/atom_explode/dotest | 4 ++--
 tests/atom_explode/test.c | 9 ++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/atom_explode/dotest b/tests/atom_explode/dotest
index 3b134e2..c4dc913 100755
--- a/tests/atom_explode/dotest
+++ b/tests/atom_explode/dotest
@@ -2,8 +2,8 @@
 
 . ../init.sh
 
-[[ $PORTDIR == "" ]] && PORTDIR=$(portageq envvar PORTDIR)
-pushd ${PORTDIR}/metadata/cache >/dev/null || { echo SKIPPED; exit 0 ; }
+: ${PORTDIR:=$(portageq envvar PORTDIR)}
+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

diff --git a/tests/atom_explode/test.c b/tests/atom_explode/test.c
index d9e80e7..ef05a69 100644
--- a/tests/atom_explode/test.c
+++ b/tests/atom_explode/test.c
@@ -29,12 +29,15 @@ int main(int argc, char *argv[])
 		atom_implode(a);
 	}
 	if (argc == 1) {
-		char buf[1024], *p;
-		while (fgets(buf, sizeof(buf), stdin) != NULL) {
+		size_t buflen;
+		char *buf, *p;
+
+		buf = NULL;
+		while (getline(&buf, &buflen, stdin) != -1) {
 			if ((p = strchr(buf, '\n')) != NULL)
 				*p = '\0';
 			a = atom_explode(buf);
-			boom(a,buf);
+			boom(a, buf);
 			atom_implode(a);
 		}
 	}


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/
@ 2015-11-26  8:59 Mike Frysinger
  0 siblings, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2015-11-26  8:59 UTC (permalink / raw
  To: gentoo-commits

commit:     615d86f90d76ab482f8c1661a7e6bba88453c4b5
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 08:59:07 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 08:59:07 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=615d86f9

tests: atom_explode: update baselines after PVR change

This should have been part of commit 153e9ff8bec2ec4cd1e777ee4b24e477.

 tests/atom_explode/basic.good | 96 +++++++++++++++++++++----------------------
 1 file changed, 48 insertions(+), 48 deletions(-)

diff --git a/tests/atom_explode/basic.good b/tests/atom_explode/basic.good
index e05e71f..b2ed879 100644
--- a/tests/atom_explode/basic.good
+++ b/tests/atom_explode/basic.good
@@ -1,60 +1,60 @@
 pkg -> null / [pkg] pkg - (null) [(null)] [r0]
 pkg:slot -> null / [pkg] pkg - (null) [(null)] [r0]
-pkg-1 -> null / [pkg-1] pkg - pkg-1-r0 [1] [r0]
-pkg-1:slot -> null / [pkg-1] pkg - pkg-1-r0 [1] [r0]
-pkg-1_beta -> null / [pkg-1_beta] pkg - pkg-1_beta-r0 [1_beta] [r0]
-pkg-1_beta:slot -> null / [pkg-1_beta] pkg - pkg-1_beta-r0 [1_beta] [r0]
-pkg-1-r123 -> null / [pkg-1] pkg - pkg-1-r123 [1] [r123]
-pkg-1-r123:slot -> null / [pkg-1] pkg - pkg-1-r123 [1] [r123]
-pkg-1_alpha_rc50_p1-r5 -> null / [pkg-1_alpha_rc50_p1] pkg - pkg-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
-pkg-1_alpha_rc50_p1-r5:slot -> null / [pkg-1_alpha_rc50_p1] pkg - pkg-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+pkg-1 -> null / [pkg-1] pkg - 1-r0 [1] [r0]
+pkg-1:slot -> null / [pkg-1] pkg - 1-r0 [1] [r0]
+pkg-1_beta -> null / [pkg-1_beta] pkg - 1_beta-r0 [1_beta] [r0]
+pkg-1_beta:slot -> null / [pkg-1_beta] pkg - 1_beta-r0 [1_beta] [r0]
+pkg-1-r123 -> null / [pkg-1] pkg - 1-r123 [1] [r123]
+pkg-1-r123:slot -> null / [pkg-1] pkg - 1-r123 [1] [r123]
+pkg-1_alpha_rc50_p1-r5 -> null / [pkg-1_alpha_rc50_p1] pkg - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+pkg-1_alpha_rc50_p1-r5:slot -> null / [pkg-1_alpha_rc50_p1] pkg - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
 cat/pkg -> cat / [pkg] pkg - (null) [(null)] [r0]
 cat/pkg:slot -> cat / [pkg] pkg - (null) [(null)] [r0]
-cat/pkg-1 -> cat / [pkg-1] pkg - pkg-1-r0 [1] [r0]
-cat/pkg-1:slot -> cat / [pkg-1] pkg - pkg-1-r0 [1] [r0]
-cat/pkg-1_beta -> cat / [pkg-1_beta] pkg - pkg-1_beta-r0 [1_beta] [r0]
-cat/pkg-1_beta:slot -> cat / [pkg-1_beta] pkg - pkg-1_beta-r0 [1_beta] [r0]
-cat/pkg-1-r123 -> cat / [pkg-1] pkg - pkg-1-r123 [1] [r123]
-cat/pkg-1-r123:slot -> cat / [pkg-1] pkg - pkg-1-r123 [1] [r123]
-cat/pkg-1_alpha_rc50_p1-r5 -> cat / [pkg-1_alpha_rc50_p1] pkg - pkg-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
-cat/pkg-1_alpha_rc50_p1-r5:slot -> cat / [pkg-1_alpha_rc50_p1] pkg - pkg-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+cat/pkg-1 -> cat / [pkg-1] pkg - 1-r0 [1] [r0]
+cat/pkg-1:slot -> cat / [pkg-1] pkg - 1-r0 [1] [r0]
+cat/pkg-1_beta -> cat / [pkg-1_beta] pkg - 1_beta-r0 [1_beta] [r0]
+cat/pkg-1_beta:slot -> cat / [pkg-1_beta] pkg - 1_beta-r0 [1_beta] [r0]
+cat/pkg-1-r123 -> cat / [pkg-1] pkg - 1-r123 [1] [r123]
+cat/pkg-1-r123:slot -> cat / [pkg-1] pkg - 1-r123 [1] [r123]
+cat/pkg-1_alpha_rc50_p1-r5 -> cat / [pkg-1_alpha_rc50_p1] pkg - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+cat/pkg-1_alpha_rc50_p1-r5:slot -> cat / [pkg-1_alpha_rc50_p1] pkg - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
 pkg8 -> null / [pkg8] pkg8 - (null) [(null)] [r0]
 pkg8:slot -> null / [pkg8] pkg8 - (null) [(null)] [r0]
-pkg8-1 -> null / [pkg8-1] pkg8 - pkg8-1-r0 [1] [r0]
-pkg8-1:slot -> null / [pkg8-1] pkg8 - pkg8-1-r0 [1] [r0]
-pkg8-1_beta -> null / [pkg8-1_beta] pkg8 - pkg8-1_beta-r0 [1_beta] [r0]
-pkg8-1_beta:slot -> null / [pkg8-1_beta] pkg8 - pkg8-1_beta-r0 [1_beta] [r0]
-pkg8-1-r123 -> null / [pkg8-1] pkg8 - pkg8-1-r123 [1] [r123]
-pkg8-1-r123:slot -> null / [pkg8-1] pkg8 - pkg8-1-r123 [1] [r123]
-pkg8-1_alpha_rc50_p1-r5 -> null / [pkg8-1_alpha_rc50_p1] pkg8 - pkg8-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
-pkg8-1_alpha_rc50_p1-r5:slot -> null / [pkg8-1_alpha_rc50_p1] pkg8 - pkg8-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+pkg8-1 -> null / [pkg8-1] pkg8 - 1-r0 [1] [r0]
+pkg8-1:slot -> null / [pkg8-1] pkg8 - 1-r0 [1] [r0]
+pkg8-1_beta -> null / [pkg8-1_beta] pkg8 - 1_beta-r0 [1_beta] [r0]
+pkg8-1_beta:slot -> null / [pkg8-1_beta] pkg8 - 1_beta-r0 [1_beta] [r0]
+pkg8-1-r123 -> null / [pkg8-1] pkg8 - 1-r123 [1] [r123]
+pkg8-1-r123:slot -> null / [pkg8-1] pkg8 - 1-r123 [1] [r123]
+pkg8-1_alpha_rc50_p1-r5 -> null / [pkg8-1_alpha_rc50_p1] pkg8 - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+pkg8-1_alpha_rc50_p1-r5:slot -> null / [pkg8-1_alpha_rc50_p1] pkg8 - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
 cat/pkg8 -> cat / [pkg8] pkg8 - (null) [(null)] [r0]
 cat/pkg8:slot -> cat / [pkg8] pkg8 - (null) [(null)] [r0]
-cat/pkg8-1 -> cat / [pkg8-1] pkg8 - pkg8-1-r0 [1] [r0]
-cat/pkg8-1:slot -> cat / [pkg8-1] pkg8 - pkg8-1-r0 [1] [r0]
-cat/pkg8-1_beta -> cat / [pkg8-1_beta] pkg8 - pkg8-1_beta-r0 [1_beta] [r0]
-cat/pkg8-1_beta:slot -> cat / [pkg8-1_beta] pkg8 - pkg8-1_beta-r0 [1_beta] [r0]
-cat/pkg8-1-r123 -> cat / [pkg8-1] pkg8 - pkg8-1-r123 [1] [r123]
-cat/pkg8-1-r123:slot -> cat / [pkg8-1] pkg8 - pkg8-1-r123 [1] [r123]
-cat/pkg8-1_alpha_rc50_p1-r5 -> cat / [pkg8-1_alpha_rc50_p1] pkg8 - pkg8-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
-cat/pkg8-1_alpha_rc50_p1-r5:slot -> cat / [pkg8-1_alpha_rc50_p1] pkg8 - pkg8-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+cat/pkg8-1 -> cat / [pkg8-1] pkg8 - 1-r0 [1] [r0]
+cat/pkg8-1:slot -> cat / [pkg8-1] pkg8 - 1-r0 [1] [r0]
+cat/pkg8-1_beta -> cat / [pkg8-1_beta] pkg8 - 1_beta-r0 [1_beta] [r0]
+cat/pkg8-1_beta:slot -> cat / [pkg8-1_beta] pkg8 - 1_beta-r0 [1_beta] [r0]
+cat/pkg8-1-r123 -> cat / [pkg8-1] pkg8 - 1-r123 [1] [r123]
+cat/pkg8-1-r123:slot -> cat / [pkg8-1] pkg8 - 1-r123 [1] [r123]
+cat/pkg8-1_alpha_rc50_p1-r5 -> cat / [pkg8-1_alpha_rc50_p1] pkg8 - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+cat/pkg8-1_alpha_rc50_p1-r5:slot -> cat / [pkg8-1_alpha_rc50_p1] pkg8 - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
 pkg8x -> null / [pkg8x] pkg8x - (null) [(null)] [r0]
 pkg8x:slot -> null / [pkg8x] pkg8x - (null) [(null)] [r0]
-pkg8x-1 -> null / [pkg8x-1] pkg8x - pkg8x-1-r0 [1] [r0]
-pkg8x-1:slot -> null / [pkg8x-1] pkg8x - pkg8x-1-r0 [1] [r0]
-pkg8x-1_beta -> null / [pkg8x-1_beta] pkg8x - pkg8x-1_beta-r0 [1_beta] [r0]
-pkg8x-1_beta:slot -> null / [pkg8x-1_beta] pkg8x - pkg8x-1_beta-r0 [1_beta] [r0]
-pkg8x-1-r123 -> null / [pkg8x-1] pkg8x - pkg8x-1-r123 [1] [r123]
-pkg8x-1-r123:slot -> null / [pkg8x-1] pkg8x - pkg8x-1-r123 [1] [r123]
-pkg8x-1_alpha_rc50_p1-r5 -> null / [pkg8x-1_alpha_rc50_p1] pkg8x - pkg8x-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
-pkg8x-1_alpha_rc50_p1-r5:slot -> null / [pkg8x-1_alpha_rc50_p1] pkg8x - pkg8x-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+pkg8x-1 -> null / [pkg8x-1] pkg8x - 1-r0 [1] [r0]
+pkg8x-1:slot -> null / [pkg8x-1] pkg8x - 1-r0 [1] [r0]
+pkg8x-1_beta -> null / [pkg8x-1_beta] pkg8x - 1_beta-r0 [1_beta] [r0]
+pkg8x-1_beta:slot -> null / [pkg8x-1_beta] pkg8x - 1_beta-r0 [1_beta] [r0]
+pkg8x-1-r123 -> null / [pkg8x-1] pkg8x - 1-r123 [1] [r123]
+pkg8x-1-r123:slot -> null / [pkg8x-1] pkg8x - 1-r123 [1] [r123]
+pkg8x-1_alpha_rc50_p1-r5 -> null / [pkg8x-1_alpha_rc50_p1] pkg8x - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+pkg8x-1_alpha_rc50_p1-r5:slot -> null / [pkg8x-1_alpha_rc50_p1] pkg8x - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
 cat/pkg8x -> cat / [pkg8x] pkg8x - (null) [(null)] [r0]
 cat/pkg8x:slot -> cat / [pkg8x] pkg8x - (null) [(null)] [r0]
-cat/pkg8x-1 -> cat / [pkg8x-1] pkg8x - pkg8x-1-r0 [1] [r0]
-cat/pkg8x-1:slot -> cat / [pkg8x-1] pkg8x - pkg8x-1-r0 [1] [r0]
-cat/pkg8x-1_beta -> cat / [pkg8x-1_beta] pkg8x - pkg8x-1_beta-r0 [1_beta] [r0]
-cat/pkg8x-1_beta:slot -> cat / [pkg8x-1_beta] pkg8x - pkg8x-1_beta-r0 [1_beta] [r0]
-cat/pkg8x-1-r123 -> cat / [pkg8x-1] pkg8x - pkg8x-1-r123 [1] [r123]
-cat/pkg8x-1-r123:slot -> cat / [pkg8x-1] pkg8x - pkg8x-1-r123 [1] [r123]
-cat/pkg8x-1_alpha_rc50_p1-r5 -> cat / [pkg8x-1_alpha_rc50_p1] pkg8x - pkg8x-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
-cat/pkg8x-1_alpha_rc50_p1-r5:slot -> cat / [pkg8x-1_alpha_rc50_p1] pkg8x - pkg8x-1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+cat/pkg8x-1 -> cat / [pkg8x-1] pkg8x - 1-r0 [1] [r0]
+cat/pkg8x-1:slot -> cat / [pkg8x-1] pkg8x - 1-r0 [1] [r0]
+cat/pkg8x-1_beta -> cat / [pkg8x-1_beta] pkg8x - 1_beta-r0 [1_beta] [r0]
+cat/pkg8x-1_beta:slot -> cat / [pkg8x-1_beta] pkg8x - 1_beta-r0 [1_beta] [r0]
+cat/pkg8x-1-r123 -> cat / [pkg8x-1] pkg8x - 1-r123 [1] [r123]
+cat/pkg8x-1-r123:slot -> cat / [pkg8x-1] pkg8x - 1-r123 [1] [r123]
+cat/pkg8x-1_alpha_rc50_p1-r5 -> cat / [pkg8x-1_alpha_rc50_p1] pkg8x - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]
+cat/pkg8x-1_alpha_rc50_p1-r5:slot -> cat / [pkg8x-1_alpha_rc50_p1] pkg8x - 1_alpha_rc50_p1-r5 [1_alpha_rc50_p1] [r5]


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/
@ 2016-02-14  1:26 Mike Frysinger
  0 siblings, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2016-02-14  1:26 UTC (permalink / raw
  To: gentoo-commits

commit:     d858df8a53df7e43bc6c2ece945cff7104ae762b
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 14 01:02:43 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Feb 14 01:02:43 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d858df8a

tests: atom_explode: get tests running again

Change to extracting PORTDIR from q itself rather than portageq.
This is just putting off the full fix (walking all repos), but it
gets things running/passing again.

After some recent changes, we also need to update the python code
so its output matches the q code.  Otherwise all the tests fail as
none of the lines match.

URL: https://bugs.gentoo.org/567336
Reported-by: tka <AT> kamph.org

 tests/atom_explode/atom-explode.py | 2 +-
 tests/atom_explode/dotest          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/atom_explode/atom-explode.py b/tests/atom_explode/atom-explode.py
index 03ea0bf..d28aaed 100755
--- a/tests/atom_explode/atom-explode.py
+++ b/tests/atom_explode/atom-explode.py
@@ -11,7 +11,7 @@ def doit(a):
 	PV = cpv[2]
 	PR_int = cpv[3]
 	P = PN + "-" + PV
-	PVR = P + "-" + cpv[3]
+	PVR = PV + "-" + cpv[3]
 	print(a+" -> "+CATEGORY+" / ["+P+"] "+PN+" - "+PVR+" ["+PV+"] ["+PR_int+"]")
 
 for a in sys.argv[1:]:

diff --git a/tests/atom_explode/dotest b/tests/atom_explode/dotest
index 41d282a..e852bc0 100755
--- a/tests/atom_explode/dotest
+++ b/tests/atom_explode/dotest
@@ -2,7 +2,7 @@
 
 . ../init.sh || exit 1
 
-: ${PORTDIR:=$(portageq envvar PORTDIR)}
+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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/
@ 2018-03-30 18:27 Fabian Groffen
  0 siblings, 0 replies; 9+ messages in thread
From: Fabian Groffen @ 2018-03-30 18:27 UTC (permalink / raw
  To: gentoo-commits

commit:     2a25ec6e1470446e80f12d2c51118c35e57024b3
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 30 18:22:39 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 18:22:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=2a25ec6e

tests/atom_explode: deal with Manifest.gz files, bug #638970

There is two parts in here:
a) atom-explode.py: don't crash when Portage couldn't map an atom, just
   print a descriptive message instead
b) dotest: filter out Manifest.* files to not feed in non-atoms

thanks tka for testing

Bug: https://bugs.gentoo.org/638970

 tests/atom_explode/atom-explode.py | 3 +++
 tests/atom_explode/dotest          | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/atom_explode/atom-explode.py b/tests/atom_explode/atom-explode.py
index d28aaed..972bac7 100755
--- a/tests/atom_explode/atom-explode.py
+++ b/tests/atom_explode/atom-explode.py
@@ -5,6 +5,9 @@ import sys,portage
 def doit(a):
 	# ['x11-terms', 'wterm', '6.2.9', 'r2']
 	cpv = portage.catpkgsplit(a)
+	if not cpv:
+		print("Portage could not match " + a + " to a package")
+		return
 	# input -> CATEGORY / [P] PN - PVR [PV] [PR_int]
 	CATEGORY = cpv[0]
 	PN = cpv[1]

diff --git a/tests/atom_explode/dotest b/tests/atom_explode/dotest
index e852bc0..3fe7086 100755
--- a/tests/atom_explode/dotest
+++ b/tests/atom_explode/dotest
@@ -14,7 +14,7 @@ if [[ $1 == -v ]] ; then
 fi
 
 # split the disk i/o out so both tests are CPU bound only
-files=$(find . -mindepth 2 -type f -printf '%P\n%f\n')
+files=$(find . -mindepth 2 -type f ! -name "Manifest.*" -printf '%P\n%f\n')
 popd >/dev/null
 
 printf "atom_explode():"


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/
@ 2018-05-18 18:30 Fabian Groffen
  0 siblings, 0 replies; 9+ messages in thread
From: Fabian Groffen @ 2018-05-18 18:30 UTC (permalink / raw
  To: gentoo-commits

commit:     c73ba1a6e8713f267be8c5083541619753993515
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri May 18 18:27:06 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri May 18 18:27:06 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c73ba1a6

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

 tests/atom_explode/atom-explode.py |   2 +-
 tests/atom_explode/dotest          |  30 +++++++++++++++++-------------
 tests/atom_explode/ebuildlist.xz   | Bin 0 -> 298948 bytes
 tests/atom_explode/portageatoms.xz | Bin 0 -> 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
Binary files /dev/null and b/tests/atom_explode/ebuildlist.xz differ

diff --git a/tests/atom_explode/portageatoms.xz b/tests/atom_explode/portageatoms.xz
new file mode 100644
index 0000000..e7b062a
Binary files /dev/null and b/tests/atom_explode/portageatoms.xz differ


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/
@ 2018-08-01 12:18 Fabian Groffen
  0 siblings, 0 replies; 9+ messages in thread
From: Fabian Groffen @ 2018-08-01 12:18 UTC (permalink / raw
  To: gentoo-commits

commit:     c27b5750eeb793a9c5d7d98a6021e9c9056a3ec6
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  1 12:15:55 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Aug  1 12:15:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c27b5750

tests/atom_explode: deal with Python not finding portage, bug #661762

Check if the python atom check is going to work, if not, fall back to
full pre-cooked files.  If we just check for a portage tree in the
filesystem, it may be that we end up without python support for portage,
which would then obviously mismatch.

Bug: https://bugs.gentoo.org/661762

 tests/atom_explode/dotest | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/atom_explode/dotest b/tests/atom_explode/dotest
index e911ab5..3a45fc1 100755
--- a/tests/atom_explode/dotest
+++ b/tests/atom_explode/dotest
@@ -3,7 +3,9 @@
 . ../init.sh || exit 1
 
 PORTDIR=$(DEBUG=: q -Ch 2>&1 | grep ^PORTDIR | awk '{print $NF}')
-if [[ -d "${PORTDIR}"/metadata/md5-cache ]] ; then
+if [[ -d "${PORTDIR}"/metadata/md5-cache ]] &&
+	"$s"/atom-explode.py < /dev/null >& /dev/null ;
+then
 	pushd "${PORTDIR}"/metadata/md5-cache >/dev/null || exit $?
 
 	if [[ $1 == -v ]] ; then


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/
@ 2019-03-20  7:57 Fabian Groffen
  0 siblings, 0 replies; 9+ messages in thread
From: Fabian Groffen @ 2019-03-20  7:57 UTC (permalink / raw
  To: gentoo-commits

commit:     11ac8188bfdee030fa233fd4480f35c2d8e3df69
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 20 07:53:46 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 07:53:46 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=11ac8188

tests: ensure repeatable results on any host when TRAVIS_OS_NAME is set

Always use the static "cache" of ebuilds provided in the tree, even if
we find a tree when we're testing in Travis mode.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 tests/atom_explode/dotest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/atom_explode/dotest b/tests/atom_explode/dotest
index 3a45fc1..f47d44f 100755
--- a/tests/atom_explode/dotest
+++ b/tests/atom_explode/dotest
@@ -3,7 +3,7 @@
 . ../init.sh || exit 1
 
 PORTDIR=$(DEBUG=: q -Ch 2>&1 | grep ^PORTDIR | awk '{print $NF}')
-if [[ -d "${PORTDIR}"/metadata/md5-cache ]] &&
+if [[ -z ${TRAVIS_OS_NAME} && -d "${PORTDIR}"/metadata/md5-cache ]] &&
 	"$s"/atom-explode.py < /dev/null >& /dev/null ;
 then
 	pushd "${PORTDIR}"/metadata/md5-cache >/dev/null || exit $?


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/
@ 2019-06-10 10:09 Fabian Groffen
  0 siblings, 0 replies; 9+ messages in thread
From: Fabian Groffen @ 2019-06-10 10:09 UTC (permalink / raw
  To: gentoo-commits

commit:     555eff4c66aad27a02fbf8edffa0820d2bdbdfb6
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  9 18:20:20 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Jun  9 18:20:20 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=555eff4c

tests/atom_explode: don't use Portage install

relying on actual data can reveal all kinds of problems which may be
unrelated to atom parsing

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 tests/atom_explode/dotest | 31 ++++++++-----------------------
 1 file changed, 8 insertions(+), 23 deletions(-)

diff --git a/tests/atom_explode/dotest b/tests/atom_explode/dotest
index f47d44f..8302529 100755
--- a/tests/atom_explode/dotest
+++ b/tests/atom_explode/dotest
@@ -2,34 +2,19 @@
 
 . ../init.sh || exit 1
 
-PORTDIR=$(DEBUG=: q -Ch 2>&1 | grep ^PORTDIR | awk '{print $NF}')
-if [[ -z ${TRAVIS_OS_NAME} && -d "${PORTDIR}"/metadata/md5-cache ]] &&
-	"$s"/atom-explode.py < /dev/null >& /dev/null ;
-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
+files=$(xzcat ebuildlist.xz)
 
 printf "atom_explode():"
 time echo "${files}" | "$b"/e > "$b"/me || exit $?
 echo
 
-printf "portage:"
-time echo "${files}" | "$s"/atom-explode.py > "$b"/py || xzcat portageatoms.xz > "$b"/py
-echo
+if [[ -n ${QATOM_COMPARE_TO_PORTAGE} ]] ; then
+	printf "portage:"
+	time echo "${files}" | "$s"/atom-explode.py > "$b"/py
+	echo
+else
+	xzcat portageatoms.xz > "$b"/py
+fi
 
 diff -U 0 "$b"/me "$b"/py
 tend $? "portage-utils vs portage atom parsing"


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/
@ 2024-03-29 10:58 Fabian Groffen
  0 siblings, 0 replies; 9+ messages in thread
From: Fabian Groffen @ 2024-03-29 10:58 UTC (permalink / raw
  To: gentoo-commits

commit:     06d9fb823e99cce2c66c5c4888b91538e66d166e
Author:     Boris Staletic <boris.staletic <AT> protonmail <DOT> com>
AuthorDate: Thu Mar 28 20:30:40 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 10:58:25 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=06d9fb82

tests: avoid leaking buf after exiting the loop in atom_explode

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 tests/atom_explode/test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/atom_explode/test.c b/tests/atom_explode/test.c
index b794d3b..ff1c58d 100644
--- a/tests/atom_explode/test.c
+++ b/tests/atom_explode/test.c
@@ -64,6 +64,7 @@ int main(int argc, char *argv[])
 			boom(a, buf);
 			atom_implode(a);
 		}
+		free(buf);
 	}
 
 	return EXIT_SUCCESS;


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-29 10:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-29 10:58 [gentoo-commits] proj/portage-utils:master commit in: tests/atom_explode/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2019-06-10 10:09 Fabian Groffen
2019-03-20  7:57 Fabian Groffen
2018-08-01 12:18 Fabian Groffen
2018-05-18 18:30 Fabian Groffen
2018-03-30 18:27 Fabian Groffen
2016-02-14  1:26 Mike Frysinger
2015-11-26  8:59 Mike Frysinger
2015-02-21  0:00 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox