public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-projects commit in portage-utils/tests/source: Makefile dotest
@ 2011-12-12 21:04 Mike Frysinger (vapier)
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2011-12-12 21:04 UTC (permalink / raw
  To: gentoo-commits

vapier      11/12/12 21:04:25

  Modified:             Makefile dotest
  Log:
  first pass at integrating the testsuite into autotools code

Revision  Changes    Path
1.2                  portage-utils/tests/source/Makefile

file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/source/Makefile?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/source/Makefile?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/source/Makefile?r1=1.1&r2=1.2

Index: Makefile
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/source/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile	14 May 2006 21:32:37 -0000	1.1
+++ Makefile	12 Dec 2011 21:04:24 -0000	1.2
@@ -1,6 +1,11 @@
+thisdir = source
+include ../subdir.mk
+
 all: check
 
 test check:
-	./dotest
+	$(s)/dotest
 
 clean:
+
+.PHONY: all check clean test



1.14                 portage-utils/tests/source/dotest

file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/source/dotest?rev=1.14&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/source/dotest?rev=1.14&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/tests/source/dotest?r1=1.13&r2=1.14

Index: dotest
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/tests/source/dotest,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- dotest	12 Dec 2011 18:53:13 -0000	1.13
+++ dotest	12 Dec 2011 21:04:24 -0000	1.14
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+. ../init.sh
+
 ret=0
 
 testit() {
@@ -15,21 +17,37 @@
 }
 
 prune=(
-	'(' -type d -a
+	'('
+		'('
 		'('
-			-name CVS -o
-			-name tests -o
-			-name autotools -o
-			-name autom4te.cache -o
-			-name '*~'
+			-type d -a
+			'('
+				-name CVS -o
+				-name tests -o
+				-name autotools -o
+				-name autom4te.cache -o
+				-name .deps
+			')'
+		')'
+		-o
+		'('
+			-type f -a
+			'('
+				-name '*~' -o
+				-name config.h -o
+				-name config.log -o
+				-name config.status
+			')'
+		')'
 		')'
-	-prune ')'
+		-prune
+	')'
 )
 all_files=(
 	"${prune[@]}" -o -type f
 )
 src_files=(
-	"${prune[@]}" -o -type f '(' -name '*.[ch]' -a '!' -name 'config.h' ')'
+	"${prune[@]}" -o -type f -name '*.[ch]'
 )
 
 
@@ -37,7 +55,7 @@
 #
 # check for misc common typos
 #
-find ../.. "${all_files[@]}" -print0 | xargs -0 \
+find ${ats} "${all_files[@]}" -print0 | xargs -0 \
 	grep -n -I \
 		-e '\<compatability\>' \
 		-e '\<compatable\>' \
@@ -64,7 +82,7 @@
 #
 # don't allow obsolete functions
 #
-find ../.. "${src_files[@]}" -print0 | xargs -0 \
+find ${ats} "${src_files[@]}" -print0 | xargs -0 \
 	grep -n -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utimes)\>[[:space:]]*\(' \
 	| sed -e "s:^\.\./\.\./::g" > src.obsolete.funcs
 testit src.obsolete.funcs
@@ -74,7 +92,7 @@
 #
 # make sure people use our constants
 #
-find ../.. "${src_files[@]}" -print0 | xargs -0 \
+find ${ats} "${src_files[@]}" -print0 | xargs -0 \
 	grep -n -E -e '\<PATH_MAX\>' | grep -v _Q_PATH_MAX \
 	| sed -e "s:^\.\./\.\./::g" > src.bad.constants
 testit src.bad.constants
@@ -84,7 +102,7 @@
 #
 # don't allow obsolete headers
 #
-find ../.. "${src_files[@]}" -print0 | xargs -0 \
+find ${ats} "${src_files[@]}" -print0 | xargs -0 \
 	grep -n -E -e '\<(malloc|memory|sys/(errno|fcntl|signal|stropts|termios|unistd))\.h\>' \
 	| sed -e "s:^\.\./\.\./::g" > src.obsolete.headers
 testit src.obsolete.headers
@@ -94,7 +112,7 @@
 #
 # make sure people use the x* helper funcs
 #
-find ../.. "${src_files[@]}" -print0 | xargs -0 \
+find ${ats} "${src_files[@]}" -print0 | xargs -0 \
 	grep -n -E -e '\<(malloc|strdup)[[:space:]]*\(' \
 	| grep -v libq/x \
 	| sed -e "s:^\.\./\.\./::g" > src.use.xfuncs
@@ -104,7 +122,7 @@
 #
 # check for style
 #
-find ../.. "${src_files[@]}" -print0 | xargs -0 \
+find ${ats} "${src_files[@]}" -print0 | xargs -0 \
 	grep -n -E \
 		-e '\<(for|if|switch|while)\(' \
 		-e '\<(for|if|switch|while) \( ' \
@@ -119,8 +137,10 @@
 #
 # Auto clean up the space issues
 #
-for x in $(find ../.. "${src_files[@]}" -print); do
-	./space "$x" > "$x~"
+for x in $(find ${ats} "${src_files[@]}" -print); do
+	# skip paths we don't have write access to
+	touch "$x~" 2>/dev/null || continue
+	${s}/space "$x" > "$x~"
 	if ! diff -u "$x" "$x~" ; then
 		echo "New file: $x~"
 	else






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-12 21:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12 21:04 [gentoo-commits] gentoo-projects commit in portage-utils/tests/source: Makefile dotest Mike Frysinger (vapier)

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