From 22929ce3a8503317a85c68b7b9bbbfe9c8234c31 Mon Sep 17 00:00:00 2001 From: gdr Date: Tue, 30 Sep 1997 05:09:26 +0000 Subject: [PATCH] initial checkin --- usr.bin/catrez/tests/dotests | 59 ++++++++++++++++++++++++++++++++ usr.bin/catrez/tests/fulltests | 29 ++++++++++++++++ usr.bin/catrez/tests/test.list | 33 ++++++++++++++++++ usr.bin/catrez/tests/testcr.rez | 5 +++ usr.bin/catrez/tests/version.out | 4 +++ 5 files changed, 130 insertions(+) create mode 100644 usr.bin/catrez/tests/dotests create mode 100644 usr.bin/catrez/tests/fulltests create mode 100644 usr.bin/catrez/tests/test.list create mode 100644 usr.bin/catrez/tests/testcr.rez create mode 100644 usr.bin/catrez/tests/version.out diff --git a/usr.bin/catrez/tests/dotests b/usr.bin/catrez/tests/dotests new file mode 100644 index 0000000..96d0bfb --- /dev/null +++ b/usr.bin/catrez/tests/dotests @@ -0,0 +1,59 @@ +# Tests for catrez command; invoked by command file "fulltests" +# Written by Dave Tribby (August 1997) +# $Id: dotests,v 1.1 1997/09/30 05:09:25 gdr Exp $ + +# Location of the catrez command to be tested +set testcmd="../catrez" + +# Record starting time +echo -n "Testing command $testcmd beginning at" +date + +# Name of test resource file +set testfile="testcr" + +# The following file is the source for testcr.rez: +# #include "types.rez" +# resource rPString (1,protected) +# {"This should be a protected Pascal string"}; +# resource rPString (2) +# {"This is an unprotected Pascal string"}; +# Create testcr.r with the following: +# occ testcr.rez + +echo "Creating copy of $testfile.r with $testcmd" +$testcmd -d /tmp/$testfile.r2 $testfile.r +echo " Completion status = $status" +echo "Creating listings of original and duplicated resources" +derez $testfile.r types.rez > /tmp/$testfile.l1 +derez /tmp/$testfile.r2 types.rez > /tmp/$testfile.l2 +echo "" +echo "Comparing listing of original and duplicate files" +cmp /tmp/$testfile.l1 /tmp/$testfile.l2 +echo " Completion status = $status" +echo "" + +echo "Getting version information" +set cmp="version.out" +set dest="/tmp/$cmp" +$testcmd > $dest +cmp $cmp $dest +echo " Completion status = $status" +echo "" + +echo "***** Error Messages *****" + +set dest="/tmp/err.cond" + +echo "" +echo "Expected errors: illegal option" +echo " option requires an argument" +echo " No destination filename provided" +$testcmd -x -d +echo " Error completion status = $status (expected: 1)" + +echo "" +set src="badname" +echo "Expected error opening resource fork of $src" +$testcmd -d $dest $src +echo " Error completion status = $status (expected: 1)" diff --git a/usr.bin/catrez/tests/fulltests b/usr.bin/catrez/tests/fulltests new file mode 100644 index 0000000..5d3a782 --- /dev/null +++ b/usr.bin/catrez/tests/fulltests @@ -0,0 +1,29 @@ +# gsh script to run tests and collect results +# Written by Dave Tribby * August 1997 +# $Id: fulltests,v 1.1 1997/09/30 05:09:26 gdr Exp $ + +# Name of gsh script containing test cases +set command="dotests" +# Sometimes the file type is modified by editing; make it executable +chtyp -l exec $command + +# Filenames for raw and modified results +set raw_file="/tmp/rawlist" +set result_file="test.list" + +# Location of tr command that knows how to handle classes +set trcmd="/src/gno/usr.bin/tr/tr" + +# --- Begin the tests --- + +echo -n "Executing test script \"$command\" from directory " +pwd + +# Create a new gsh invocation and record all I/O +echo "$command ; exit" | script $raw_file + +# Cleanup control chars using either of the following... +echo "Done with tests. Removing control characters from results file" +$trcmd -c -ds '[:print:]\r' '\r' < $raw_file > $result_file + +echo "Tests results have been saved as \"$result_file\"" diff --git a/usr.bin/catrez/tests/test.list b/usr.bin/catrez/tests/test.list new file mode 100644 index 0000000..695bf06 --- /dev/null +++ b/usr.bin/catrez/tests/test.list @@ -0,0 +1,33 @@ +Script started on: Sun Sep 28 23:36:45 1997 +[61] tests=> dotests ; exit +Testing command ../catrez beginning at Sun Sep 28 23:36:55 1997 +Creating copy of testcr.r with ../catrez + ==> 610 stack bytes used <== + Completion status = 0 +Creating listings of original and duplicated resources +--\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-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-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\-/| +Comparing listing of original and duplicate files + Completion status = 0 + +Getting version information + ==> 833 stack bytes used <== + Completion status = 0 + +***** Error Messages ***** + +Expected errors: illegal option + option requires an argument + No destination filename provided +catrez: illegal option -- x +catrez: option requires an argument -- d +Error: No destination filename provided +Usage: +catrez [-va] -d dest_file file1 [file2 ...] + ==> 706 stack bytes used <== + Error completion status = 1 (expected: 1) + +Expected error opening resource fork of badname +Error $0046 opening resource fork of badname + ==> 720 stack bytes used <== + Error completion status = 1 (expected: 1) +Script done on: Sun Sep 28 23:37:44 1997 diff --git a/usr.bin/catrez/tests/testcr.rez b/usr.bin/catrez/tests/testcr.rez new file mode 100644 index 0000000..ce4b595 --- /dev/null +++ b/usr.bin/catrez/tests/testcr.rez @@ -0,0 +1,5 @@ +#include "types.rez" +resource rPString (1,protected) + {"This should be a protected Pascal string"}; +resource rPString (2) + {"This is an unprotected Pascal string"}; diff --git a/usr.bin/catrez/tests/version.out b/usr.bin/catrez/tests/version.out new file mode 100644 index 0000000..219aef8 --- /dev/null +++ b/usr.bin/catrez/tests/version.out @@ -0,0 +1,4 @@ +Usage: + catrez [-va] -d dest_file file1 [file2 ...] + Copyright 1996-1997 by David M. Tribby + Version 1.0.2 (Sep 28 1997)