aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-11-07 22:25:44 +0200
committerArnold D. Robbins <arnold@skeeve.com>2013-11-07 22:25:44 +0200
commitee3d8ab30d9508aa6a626fa46959d6093b4f451c (patch)
tree4a873256234f20af3a4f73838b7fcdd4240dd0a6 /test
parent29fffed7a9937a77de42d4391c9d961c63e47bf7 (diff)
parentdb78c6a3ccd2bfde092124eca1d3174ac3902f55 (diff)
downloadegawk-ee3d8ab30d9508aa6a626fa46959d6093b4f451c.tar.gz
egawk-ee3d8ab30d9508aa6a626fa46959d6093b4f451c.tar.bz2
egawk-ee3d8ab30d9508aa6a626fa46959d6093b4f451c.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog10
-rw-r--r--test/Makefile.am8
-rw-r--r--test/Makefile.in8
-rw-r--r--test/readdir0.awk37
4 files changed, 50 insertions, 13 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index d85a026d..c5a82cfe 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,13 @@
+2013-11-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ Solaris fixes.
+
+ * readdir0.awk: Run ls -afi and ls -la separately since POSIX
+ says that -f turns off -l. Thanks to Dagobert Michelsen
+ <dam@opencsw.org> for the report.
+ * Makefile.am (diffout): Don't use POSIX or bash-isms so that
+ it will work on Solaris. Sigh.
+
2013-11-03 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (backsmalls2): New test.
diff --git a/test/Makefile.am b/test/Makefile.am
index 0023d934..dc495a6b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1925,15 +1925,17 @@ pass-fail:
fi
# This target for my convenience to look at all the results
+# Don't use POSIX or bash-isms so that it'll work on !@#$%^&*() Solaris.
diffout:
for i in _* ; \
do \
if [ "$$i" != "_*" ]; then \
echo ============== $$i ============= ; \
- if [ -r $${i#_}.ok ]; then \
- diff -c $${i#_}.ok $$i ; \
+ base=`echo $$i | sed 's/^_//'` ; \
+ if [ -r $${base}.ok ]; then \
+ diff -c $${base}.ok $$i ; \
else \
- diff -c "$(srcdir)"/$${i#_}.ok $$i ; \
+ diff -c "$(srcdir)"/$${base}.ok $$i ; \
fi ; \
fi ; \
done | more
diff --git a/test/Makefile.in b/test/Makefile.in
index fd21be38..89cebe73 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -3657,15 +3657,17 @@ pass-fail:
fi
# This target for my convenience to look at all the results
+# Don't use POSIX or bash-isms so that it'll work on !@#$%^&*() Solaris.
diffout:
for i in _* ; \
do \
if [ "$$i" != "_*" ]; then \
echo ============== $$i ============= ; \
- if [ -r $${i#_}.ok ]; then \
- diff -c $${i#_}.ok $$i ; \
+ base=`echo $$i | sed 's/^_//'` ; \
+ if [ -r $${base}.ok ]; then \
+ diff -c $${base}.ok $$i ; \
else \
- diff -c "$(srcdir)"/$${i#_}.ok $$i ; \
+ diff -c "$(srcdir)"/$${base}.ok $$i ; \
fi ; \
fi ; \
done | more
diff --git a/test/readdir0.awk b/test/readdir0.awk
index c98ac674..3a114fcd 100644
--- a/test/readdir0.awk
+++ b/test/readdir0.awk
@@ -11,12 +11,35 @@ BEGIN {
}
}
-{
- ino = $1
- name = $NF
- type = substr($2, 1, 1)
- if (type == "-")
- type = "f"
+BEGIN {
+ ls_afi = "ls -afi .."
+ ls_al = "ls -la .. | sed 1d"
+
+ for (i = 1; (ls_afi | getline) > 0; i++) {
+ # inode number is $1, filename is read of record
+ inode = $1
+ $1 = ""
+ $0 = $0
+ sub(/^ */, "")
+ names[i] = $0
+ ino[names[i]] = inode
+ }
+ close(ls_afi)
+
+ for (j = 1; (ls_al | getline) > 0; j++) {
+ type_let = substr($0, 1, 1)
+ if (type_let == "-")
+ type_let = "f"
+ $1 = $2 = $3 = $4 = $5 = $6 = $7 = $8 = ""
+ $0 = $0
+ sub(/^ */, "")
+ type[$0] = type_let
+ }
+ close(ls_al)
- printf "%s/%s/%s\n", ino, name, (ftype_unknown ? "u" : type)
+ if (i != j)
+ printf("mismatch: %d from `ls -afi' and %d from `ls -l'\n", i, j) > "/dev/stderr"
+
+ for (i = 1; i in names; i++)
+ printf("%s/%s/%s\n", ino[names[i]], names[i], type[names[i]])
}