~ubuntu-branches/ubuntu/raring/findutils/raring

« back to all changes in this revision

Viewing changes to find/testsuite/config/unix.exp

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2005-07-04 11:37:37 UTC
  • mto: (11.1.1 lenny) (1.1.10 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20050704113737-oxfumqxsqgfz5gay
Tags: upstream-4.2.22
ImportĀ upstreamĀ versionĀ 4.2.22

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
15
15
# You should have received a copy of the GNU General Public License
16
16
# along with this program; if not, write to the Free Software
17
 
# Foundation, Inc., 9 Temple Place - Suite 330, Boston, MA 02111-1307,
 
17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18
18
# USA.
19
19
 
20
20
# Modified by Kevin Dalley <kevind@rahul.net> from the xargs files.
72
72
    set testbase [file rootname $scriptname]
73
73
    set testname [file tail $testbase]
74
74
 
 
75
    # set compareprog "cmp"
 
76
    set compareprog "diff -u"
 
77
 
75
78
    set outfile "$testbase.xo"
76
79
    if {$infile != ""} then {
77
80
        set infile "[file dirname [file dirname $testbase]]/inputs/$infile"
79
82
        set infile /dev/null
80
83
    }
81
84
 
82
 
    set cmd "$FIND $FINDFLAGS $options < $infile > find.out"
 
85
    set cmd "$FIND $FINDFLAGS $options < $infile | sort > find.out"
83
86
    send_log "$cmd\n"
84
87
    if $verbose>1 then {
85
88
        send_user "Spawning \"$cmd\"\n"
100
103
    }
101
104
 
102
105
    if [file exists $outfile] then {
103
 
        set cmp_cmd "cmp find.out $outfile"
 
106
        # We use the 'sort' above to sort the output of find to ensure
 
107
        # that the directory entries appear in a predictable order.
 
108
        # Because in the general case the person compiling and running
 
109
        # "make check" will have a different collating order to the
 
110
        # maintainer, we can't guarantee that our "correct" answer
 
111
        # is already sorted in the correct order.  To avoid trying 
 
112
        # to figure out how to select a POSIX environment on a 
 
113
        # random system, we just sort the data again here, using 
 
114
        # the local user's environment.
 
115
        exec sort < $outfile > cmp.out
 
116
        set cmp_cmd "$compareprog find.out cmp.out"
 
117
 
104
118
        send_log "$cmp_cmd\n"
105
119
        catch "exec $cmp_cmd" cmpout
106
120
        if {$cmpout != ""} then {
119
133
# Called by runtest.
120
134
# Clean up (remove temporary files) before runtest exits.
121
135
proc find_exit {} {
122
 
    catch "exec rm -f find.out"
123
 
    exec echo hello
 
136
    catch "exec rm -f find.out cmp.out"
124
137
}