public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage-utils:master commit in: tests/source/
@ 2019-05-21 14:11 Fabian Groffen
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Groffen @ 2019-05-21 14:11 UTC (permalink / raw
  To: gentoo-commits

commit:     1c2468786a305db5e0462e0baa15c7ec46046dcd
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon May 20 17:04:28 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon May 20 17:04:28 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1c246878

test/source: utime is obsolete, utimes is POSIX.1.2001

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

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

diff --git a/tests/source/dotest b/tests/source/dotest
index f39addf..426a6cf 100755
--- a/tests/source/dotest
+++ b/tests/source/dotest
@@ -79,7 +79,7 @@ testit src.typos
 # don't allow obsolete functions
 #
 find ${ats} "${src_files[@]}" -print0 | xargs -0 \
-	grep -n -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utimes)\>[[:space:]]*\(' \
+	grep -n -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utime)\>[[:space:]]*\(' \
 	| sed -e "s:^\.\./\.\./::g" > src.obsolete.funcs
 testit src.obsolete.funcs
 


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

* [gentoo-commits] proj/portage-utils:master commit in: tests/source/
@ 2021-12-16 19:29 Fabian Groffen
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Groffen @ 2021-12-16 19:29 UTC (permalink / raw
  To: gentoo-commits

commit:     9c52b98ab84ba81daa915806ac5884076df81090
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 16 19:21:30 2021 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Dec 16 19:21:30 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9c52b98a

tests/source: remove some checks

these tests are somewhat expensive, so reduce them

- style is kind of personal
- noone should really have the need to use PATH_MAX any more (wrapped)
- combine obsolete funcs and headers

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

 tests/source/dotest | 74 +++++------------------------------------------------
 1 file changed, 6 insertions(+), 68 deletions(-)

diff --git a/tests/source/dotest b/tests/source/dotest
index 426a6cf..51215ba 100755
--- a/tests/source/dotest
+++ b/tests/source/dotest
@@ -76,73 +76,11 @@ testit src.typos
 
 
 #
-# don't allow obsolete functions
+# don't allow obsolete functions or headers (portability)
 #
+funcs='\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utime)\>[[:space:]]*\('
+hdrs='\<(malloc|memory|sys/(errno|fcntl|signal|stropts|termios|unistd))\.h\>'
 find ${ats} "${src_files[@]}" -print0 | xargs -0 \
-	grep -n -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utime)\>[[:space:]]*\(' \
-	| sed -e "s:^\.\./\.\./::g" > src.obsolete.funcs
-testit src.obsolete.funcs
-
-
-
-#
-# make sure people use our constants
-#
-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
-
-
-
-#
-# don't allow obsolete headers
-#
-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
-
-
-
-#
-# make sure people use the x* helper funcs
-#
-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
-testit src.use.xfuncs
-
-
-#
-# check for style
-#
-find ${ats} "${src_files[@]}" -print0 | xargs -0 \
-	grep -n -E \
-		-e '\<(for|if|switch|while)\(' \
-		-e '\<(for|if|switch|while) \( ' \
-		-e ' ;' \
-		-e '[[:space:]]$' \
-		-e '\){' \
-		-e '(^|[^:])//' \
-	| sed -e "s:^\.\./\.\./::g" > src.style
-testit src.style
-
-
-#
-# Auto clean up the space issues
-#
-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
-		rm -f "$x~"
-	fi
-done > src.space
-testit src.space
-
-end
+	grep -n -E -e "(${funcs}|${hdrs})" \
+	| sed -e "s:^\.\./\.\./::g" > src.obsolete.funcs.hdrs
+testit src.obsolete.funcs.hdrs


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

end of thread, other threads:[~2021-12-16 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-21 14:11 [gentoo-commits] proj/portage-utils:master commit in: tests/source/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2021-12-16 19:29 Fabian Groffen

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