[Libsysio-commit] libsysio_tests: libsysio/tests Makefile.am README test_all.pl test_copy.pl test_ge
Brought to you by:
lward
|
From: Sonja T. <so...@us...> - 2003-07-09 15:22:19
|
Update of /cvsroot/libsysio/libsysio/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv10139/tests
Modified Files:
Tag: libsysio_tests
Makefile.am README test_all.pl test_copy.pl test_getcwd.pl
test_list.pl test_path.pl
Log Message:
Improving documentation
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -w -b -B -p -r1.9.2.1 -r1.9.2.2
--- Makefile.am 30 May 2003 18:12:02 -0000 1.9.2.1
+++ Makefile.am 9 Jul 2003 15:22:16 -0000 1.9.2.2
@@ -38,7 +38,8 @@ DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_D
CMNSRC=drv_init_all.c drv_data.c
BUILT_SOURCES=drv_data.c
-
+check_PROGRAMS=test_driver
+TESTS=test_all.pl
CFL=$(AM_CFLAGS) $(AM_CPPFLAGS) \
$(NATIVE_DRIVER_CFLAGS) $(INCORE_DRIVER_CFLAGS) \
$(STDFD_DEV_CFLAGS)
Index: README
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/Attic/README,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -w -b -B -p -r1.1.2.1 -r1.1.2.2
--- README 30 May 2003 18:14:15 -0000 1.1.2.1
+++ README 9 Jul 2003 15:22:16 -0000 1.1.2.2
@@ -1,5 +1,71 @@
To run the tests, just do ./test_all.pl (at some point I will
-integrate that into the build environment).
+integrate that into the build environment). This will run the 6
+basic functionality tests (explained below) and report the total
+number of passes and failures. This is not currently working on
+alpha/cplant architectures, however.
+
+-----------------------SCRIPTS---------------------------------
+
+There are a total of 8 scripts: test_copy.pl, test_list.pl,
+test_getcwd.pl, test_stats.pl, test_stdfd.pl, test_path.pl,
+populator.pl, and verifier.pl. All but the last two scripts
+are ran with the test_all.pl script. Here is an explanation
+of the scripts. All scripts take an optional "-alpha" arg
+for running the scripts in an alpha/cplant environment. The
+alpha arg makes certain assumptions about the running of the
+environment; for example, it does not initilization and it
+starts off the test driver with yod.
+
+test_copy.pl <src> <dest> : This copies a file from src to dest.
+ : It runs a system cmp to verify that
+ : the two files are equivalent
+
+test_list.pl [-p] <dir> : This comes in two forms.
+test_list.pl [-p] <fstype:mdir> <dir> : In the first form, it will
+ : parse through the getdirentries
+ : result in order to generate a
+ : a listing. If the -p option is
+ : given, it will print out the
+ : listing. In the second form, it
+ : mounts mdir into dir and then does
+ : the listing
+
+test_getcwd.pl <dir> : Tests getcwd by verifying that setting the current
+ : working directory to dir and then calling getcwd
+ : returns dir
+
+test_stats.pl <file> : Verifies that the set of stat calls (stat, fstat,
+ : fstatvfs, statvfs) return the same set of stats for file
+ : and that the calls return the same items as Perl's stat
+ : call (which would use a native library and not libsysio)
+
+test_stdfd.pl <file> : Verified that stdin, stdout, and stderr can be opened and
+ : either written to or read from
+
+test_path.pl <path1> <path2> ... : Print each path listed and its type.
+ : If no paths are given, paths are read
+ : from stdin until a "quit" is given
+
+populator.pl [-seed seed] : Create a file and populate with random numbers.
+ [-file filename] : Will use the given seed for the random number
+ [-bytes bytes] : generator if it is given, otherwise it uses the
+ : the current time as a seed. The seed used is
+ : returned. If no filename is given, the file
+ : will be named randfile.seed.procnum, where seed
+ : is the seed used and procnum is the process number
+ : of the script. If no bytes are given, 1024 bytes
+ : are written. All write commands use libsysio
+
+
+verifier.pl <-seed seed> <-file fname> : Verifies that all bytes in the file fname
+ : (which was created with populator) match the
+ : random numbers which would have been used with
+ : the populator, using the given seed.
+
+
+
+-----------------------------TEST DRIVER---------------------------------
+
There are 6 basic commands for the test driver, CALL, PRINT,
ALLOC, FREE, HELP, and exit (EXIT, quit, or QUIT will also work).
Index: test_all.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/Attic/test_all.pl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -b -B -p -r1.1.2.2 -r1.1.2.3
--- test_all.pl 8 Jul 2003 16:41:18 -0000 1.1.2.2
+++ test_all.pl 9 Jul 2003 15:22:16 -0000 1.1.2.3
@@ -90,3 +90,5 @@ print "$failures tests failed and $succe
# cleanup
system(`rm -rf tmp_dir`);
+
+exit $failures;
Index: test_copy.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/Attic/test_copy.pl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -b -B -p -r1.1.2.2 -r1.1.2.3
--- test_copy.pl 1 Jul 2003 16:04:12 -0000 1.1.2.2
+++ test_copy.pl 9 Jul 2003 15:22:16 -0000 1.1.2.3
@@ -1,10 +1,8 @@
#!/usr/bin/perl -w
#
-# getdirentries test: Tests the equivalent of a ls. Note that this is not
-# the most robust test in the world; it simply verifies
-# that libsysio returns all the entries in the directory
-#
+# copy test: Copy a file from src to dest and verify that the new file
+# : is the same as the old
#
use IPC::Open2;
@@ -14,7 +12,7 @@ use helper;
sub usage
{
- print "Usage: ./test_copy.pl <src> <dest>: Copy a file from src to dest\n";
+ print "Usage: ./test_copy.pl [-alpha] <src> <dest>: Copy a file from src to dest\n";
exit(-1);
}
Index: test_getcwd.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/Attic/test_getcwd.pl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -b -B -p -r1.1.2.2 -r1.1.2.3
--- test_getcwd.pl 1 Jul 2003 16:04:12 -0000 1.1.2.2
+++ test_getcwd.pl 9 Jul 2003 15:22:16 -0000 1.1.2.3
@@ -7,7 +7,7 @@ use helper;
sub usage
{
- print "Usage: ./test_getcwd.pl <dir> : Test getcwd by verifying that it \n";
+ print "Usage: ./test_getcwd.pl [-alpha] <dir> : Test getcwd by verifying that it \n";
print " : setting the directory to dir and \n";
print " : verifying that getcwd reflects \n";
print " : the change\n";
Index: test_list.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/Attic/test_list.pl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -b -B -p -r1.1.2.2 -r1.1.2.3
--- test_list.pl 1 Jul 2003 16:04:12 -0000 1.1.2.2
+++ test_list.pl 9 Jul 2003 15:22:16 -0000 1.1.2.3
@@ -14,7 +14,7 @@ use helper;
sub usage
{
- print "Usage: ./test_list.pl [-p|-ni] <dir> \n";
+ print "Usage: ./test_list.pl [-p|-alpha] <dir> \n";
print " ./test_list.pl -m [-p|-alpha] fstype:mdir dir\n";
print " In the first form, will attempt to verify libsysio's\n";
print " getdirentries. If no dir is given, will use the \n";
Index: test_path.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/Attic/test_path.pl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -b -B -p -r1.1.2.2 -r1.1.2.3
--- test_path.pl 1 Jul 2003 16:04:12 -0000 1.1.2.2
+++ test_path.pl 9 Jul 2003 15:22:16 -0000 1.1.2.3
@@ -130,8 +130,12 @@ sub process_cmd
process_path($cmdfh, $outfh, $path);
if ($usestdin) {
$path = <STDIN>;
+
if (defined($path)) {
chop($path);
+ }
+ if ($path eq "quit") {
+ helper::print_and_exit($cmdfh, $outfh, 0, "path test successful\n");
}
} else {
$path = $paths[$i++];
|