aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am11
-rw-r--r--test/Makefile.in11
-rw-r--r--test/readdir.awk7
-rw-r--r--test/readdir0.awk9
5 files changed, 41 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index b38cf279..a3fb627a 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (readdir): New test.
+ * readdir0.awk, readdir.awk: New files.
+
2012-07-16 Arnold D. Robbins <arnold@skeeve.com>
* fnmatch.awk, fnmatch.ok: Portability updates.
diff --git a/test/Makefile.am b/test/Makefile.am
index 78fd3117..5aa31b41 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -623,6 +623,8 @@ EXTRA_DIST = \
range1.awk \
range1.in \
range1.ok \
+ readdir0.awk \
+ readdir.awk \
rebt8b1.awk \
rebt8b1.ok \
rebt8b2.awk \
@@ -894,7 +896,7 @@ LOCALE_CHARSET_TESTS = \
SHLIB_TESTS = \
assignconst fnmatch filefuncs fork fork2 ordchr ordchr2 \
- readfile rwarray testext time
+ readdir readfile rwarray testext time
# List of the tests which should be run with --lint option:
NEED_LINT = \
@@ -1603,6 +1605,13 @@ assignconst:
done 2>&1 | grep -v at_exit > _$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+readdir:
+ @echo $@
+ @touch $@.out1 $@.out2 # create directory entries first
+ @ls -fli | sed 1d | $(AWK) -f $(srcdir)/readdir0.awk > $@.out1
+ @$(AWK) -f $(srcdir)/readdir.awk . > $@.out2
+ @-$(CMP) $@.out1 $@.out2 && rm -f $@.out[12]
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index 4868bdc6..5375aaee 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -836,6 +836,8 @@ EXTRA_DIST = \
range1.awk \
range1.in \
range1.ok \
+ readdir0.awk \
+ readdir.awk \
rebt8b1.awk \
rebt8b1.ok \
rebt8b2.awk \
@@ -1103,7 +1105,7 @@ LOCALE_CHARSET_TESTS = \
SHLIB_TESTS = \
assignconst fnmatch filefuncs fork fork2 ordchr ordchr2 \
- readfile rwarray testext time
+ readdir readfile rwarray testext time
# List of the tests which should be run with --lint option:
@@ -1985,6 +1987,13 @@ assignconst:
do $(AWK) -f $(srcdir)/$@.awk $$i ; \
done 2>&1 | grep -v at_exit > _$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+readdir:
+ @echo $@
+ @touch $@.out1 $@.out2 # create directory entries first
+ @ls -fli | sed 1d | $(AWK) -f $(srcdir)/readdir0.awk > $@.out1
+ @$(AWK) -f $(srcdir)/readdir.awk . > $@.out2
+ @-$(CMP) $@.out1 $@.out2 && rm -f $@.out[12]
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/readdir.awk b/test/readdir.awk
new file mode 100644
index 00000000..4d35be6a
--- /dev/null
+++ b/test/readdir.awk
@@ -0,0 +1,7 @@
+@load "readdir"
+
+BEGIN {
+ readdir_do_ftype(1)
+}
+
+{ print }
diff --git a/test/readdir0.awk b/test/readdir0.awk
new file mode 100644
index 00000000..54306f10
--- /dev/null
+++ b/test/readdir0.awk
@@ -0,0 +1,9 @@
+{
+ ino = $1
+ name = $NF
+ type = substr($2, 1, 1)
+ if (type == "-")
+ type = "f"
+
+ printf "%s/%s/%s\n", ino, name, type
+}