home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gawk-2.15.6-base.tgz / gawk-2.15.6-base.tar / fsf / gawk / test / Makefile < prev    next >
Makefile  |  1995-03-09  |  5KB  |  185 lines

  1. # Makefile for GNU Awk test suite.
  2. #
  3. # Copyright (C) 1988-1995 the Free Software Foundation, Inc.
  4. # This file is part of GAWK, the GNU implementation of the
  5. # AWK Progamming Language.
  6. # GAWK is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # GAWK is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with GAWK; see the file COPYING.  If not, write to
  16. # the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. SHELL = /bin/sh
  19.  
  20. bigtest:    basic poundbang gawk.extensions
  21.  
  22. basic:    msg swaplns messages argarray longwrds \
  23.     getline fstabplus compare arrayref rs fsrs rand \
  24.     fsbs negexp asgext anchgsub splitargv awkpath nfset reparse \
  25.     convfmt arrayparm paramdup nonl
  26.  
  27. gawk.extensions: fieldwdth ignrcase posix manyfiles igncfs argtest \
  28.         badargs
  29.  
  30. extra:    regtest inftest
  31.  
  32. poundbang::
  33.     cp ../gawk /tmp && chmod +x poundbang && ./poundbang poundbang >tmp
  34.     rm -f /tmp/gawk
  35.     cmp poundbang.good tmp && rm -f tmp
  36.  
  37. msg::
  38.     @echo 'Any output from "cmp" is bad news, although some differences'
  39.     @echo 'in floating point values are probably benign -- in particular,'
  40.     @echo 'some systems may omit a leading zero and the floating point'
  41.     @echo 'precision may lead to slightly different output in a few cases.'
  42.  
  43. swaplns::
  44.     @../gawk -f swaplns.awk data >tmp
  45.     cmp swaplns.good tmp && rm -f tmp
  46.  
  47. messages::
  48.     @../gawk -f messages.awk >out2 2>out3
  49.     { cmp out1.good out1 && cmp out2.good out2 && cmp out3.good out3 && rm -f out1 out2 out3; } || { test -d /dev/fd && echo IT IS OK THAT THIS TEST FAILED; }
  50.  
  51. argarray::
  52.     @TEST=test echo just a test | ../gawk -f argarray.awk argarray.awk - >tmp
  53.     cmp argarray.good tmp && rm -f tmp
  54.  
  55. fstabplus::
  56.     @echo '1        2' | ../gawk -f fstabplus >tmp
  57.     cmp fstabplus.good tmp && rm -f tmp
  58.  
  59. fsrs::
  60.     @../gawk -f fsrs.awk fsrs.in >tmp
  61.     cmp fsrs.good tmp && rm -f tmp
  62.  
  63. igncfs::
  64.     @../gawk -f igncfs.awk igncfs.in >tmp
  65.     cmp igncfs.good tmp && rm -f tmp
  66.  
  67. longwrds::
  68.     @../gawk -f longwrds.awk manpage | sort >tmp
  69.     cmp longwrds.good tmp && rm -f tmp
  70.  
  71. fieldwdth::
  72.     @echo '123456789' | ../gawk -v FIELDWIDTHS="2 3 4" '{ print $$2}' >tmp
  73.     cmp fieldwdth.good tmp && rm -f tmp
  74.  
  75. ignrcase::
  76.     @echo xYz | ../gawk -v IGNORECASE=1 '{ sub(/y/, ""); print}' >tmp
  77.     cmp ignrcase.good tmp && rm -f tmp
  78.  
  79. regtest::
  80.     @echo 'Some of the output from regtest is very system specific, do not'
  81.     @echo 'be distressed if your output differs from that distributed.'
  82.     @echo 'Manual inspection is called for.'
  83.     AWK=`pwd`/../gawk ./regtest
  84.  
  85. posix::
  86.     @echo '1:2,3 4' | ../gawk -f posix >tmp
  87.     cmp posix.good tmp && rm -f tmp
  88.  
  89. manyfiles::
  90.     @rm -rf junk
  91.     @mkdir junk
  92.     @../gawk 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >tmp
  93.     @../gawk -f manyfiles.awk tmp tmp
  94.     @echo "This number better be 1 ->" | tr -d '\012'
  95.     @wc -l junk/* | ../gawk '$$1 != 2' | wc -l
  96.     @rm -rf junk tmp
  97.  
  98. compare::
  99.     @../gawk -f compare.awk 0 1 compare.in >tmp
  100.     cmp compare.good tmp && rm -f tmp
  101.  
  102. arrayref::
  103.     @../gawk -f arrayref >tmp
  104.     cmp arrayref.good tmp && rm -f tmp
  105.  
  106. rs::
  107.     @../gawk -v RS="" '{ print $$1, $$2}' rs.data >tmp
  108.     cmp rs.good tmp && rm -f tmp
  109.  
  110. fsbs::
  111.     @../gawk -v FS='\' '{ print $$1, $$2 }' fsbs.in >tmp
  112.     cmp fsbs.good tmp && rm -f tmp
  113.  
  114. inftest::
  115.     @echo This test is very machine specific...
  116.     @../gawk -f inftest.awk >tmp
  117.     cmp inftest.good tmp && rm -f tmp
  118.  
  119. getline::
  120.     @../gawk -f getline.awk getline.awk getline.awk >tmp
  121.     cmp getline.good tmp && rm -f tmp
  122.  
  123. rand::
  124.     @echo The following line should just be 19 random numbers between 1 and 100
  125.     @../gawk -f rand.awk
  126.  
  127. negexp::
  128.     @../gawk 'BEGIN { a = -2; print 10^a }' >tmp
  129.     cmp negexp.good tmp && rm -f tmp
  130.  
  131. asgext::
  132.     @../gawk -f asgext.awk asgext.in >tmp
  133.     cmp asgext.good tmp && rm -f tmp
  134.  
  135. anchgsub::
  136.     @../gawk -f anchgsub.awk anchgsub.in >tmp
  137.     cmp anchgsub.good tmp && rm -f tmp
  138.  
  139. splitargv::
  140.     @../gawk -f splitargv.awk splitargv.in >tmp
  141.     cmp splitargv.good tmp && rm -f tmp
  142.  
  143. awkpath::
  144.     @AWKPATH=".:lib" ../gawk -f awkpath.awk >tmp
  145.     cmp awkpath.good tmp && rm -f tmp
  146.  
  147. nfset::
  148.     @../gawk -f nfset.awk nfset.in >tmp
  149.     cmp nfset.good tmp && rm -f tmp
  150.  
  151. reparse::
  152.     @../gawk -f reparse.awk reparse.in >tmp
  153.     cmp reparse.good tmp && rm -f tmp
  154.  
  155. argtest::
  156.     @../gawk -f argtest.awk -x -y abc >tmp
  157.     cmp argtest.good tmp && rm -f tmp
  158.  
  159. badargs::
  160.     @-../gawk -f 2>&1 | grep -v patchlevel >tmp
  161.     cmp badargs.good tmp && rm -f tmp
  162.  
  163. convfmt::
  164.     @../gawk -f convfmt.awk >tmp
  165.     cmp convfmt.good tmp && rm -f tmp
  166.  
  167. arrayparm::
  168.     @-../gawk -f arrayparm.awk >tmp 2>&1
  169.     cmp arrayparm.good tmp && rm -f tmp
  170.  
  171. paramdup::
  172.     @-../gawk -f paramdup.awk >tmp 2>&1
  173.     cmp paramdup.good tmp && rm -f tmp
  174.  
  175. nonl::
  176.     @-../gawk --lint -f nonl.awk /dev/null >tmp 2>&1
  177.     cmp nonl.good tmp && rm -f tmp
  178.  
  179. clean:
  180.     rm -fr tmp core junk
  181.