Project

General

Profile

Bug #11550

Want tests for nawk(1)

Added by Cody Mello 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

In preparation for updating nawk, it would be good to have a test suite to show that things don't break. Brian Kernighan has a set of tests that we can use, and some of the GNU AWK tests are also applicable.

Not all of the tests pass with the nawk that is currently in master, so I'm only going to import the ones that are currently passing, and will add the rest later with the commits that fix them.

These changes are based on work done in OS-7046.

History

#1

Updated by Cody Mello 11 months ago

Running the initial import of this test suite against the current /usr/bin/nawk succeeds:

cpm@utu ~/ws/illumos-gate : master % git rebase -i origin/master
Stopped at b6b133c02d...  11550 Want tests for nawk(1) Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
You can amend the commit now, with

  git commit --amend

Once you are satisfied with your changes, run

  git rebase --continue
cpm@utu ~/ws/illumos-gate : (no branch, rebasing master) % cd usr/src/test/util-tests/tests/awk
cpm@utu ...util-tests/tests/awk : (no branch, rebasing master) % pwd
/home/cpm/ws/illumos-gate/usr/src/test/util-tests/tests/awk
cpm@utu ...util-tests/tests/awk : (no branch, rebasing master) % /usr/bin/nawk --version
/usr/bin/nawk: unknown option --version ignored
/usr/bin/nawk: no program given
cpm@utu ...util-tests/tests/awk : (no branch, rebasing master) (2) % ./runtests.sh -o /usr/bin/nawk
Running AWK tests ($AWK="/usr/bin/nawk")

# Examples from "The AWK Programming Environment" 

examples/awk/p.1... ok
examples/awk/p.10... ok
examples/awk/p.11... ok
examples/awk/p.12... ok
examples/awk/p.13... ok
examples/awk/p.14... ok
examples/awk/p.15... ok
examples/awk/p.16... ok
examples/awk/p.17... ok
examples/awk/p.18... ok
examples/awk/p.19... ok
examples/awk/p.2... ok
examples/awk/p.20... ok
examples/awk/p.21... ok
examples/awk/p.21a... ok
examples/awk/p.22... ok
examples/awk/p.23... ok
examples/awk/p.24... ok
examples/awk/p.25... ok
examples/awk/p.26... ok
examples/awk/p.26a... ok
examples/awk/p.27... ok
examples/awk/p.28... ok
examples/awk/p.29... ok
examples/awk/p.3... ok
examples/awk/p.30... ok
examples/awk/p.31... ok
examples/awk/p.32... ok
examples/awk/p.33... ok
examples/awk/p.34... ok
examples/awk/p.35... ok
examples/awk/p.36... ok
examples/awk/p.37... ok
examples/awk/p.38... ok
examples/awk/p.39... ok
examples/awk/p.4... ok
examples/awk/p.40... ok
examples/awk/p.41... ok
examples/awk/p.42... ok
examples/awk/p.43... ok
examples/awk/p.44... ok
examples/awk/p.45... ok
examples/awk/p.46... ok
examples/awk/p.47... ok
examples/awk/p.48... ok
examples/awk/p.48a... ok
examples/awk/p.48b... ok
examples/awk/p.49... ok
examples/awk/p.5... ok
examples/awk/p.50... ok
examples/awk/p.51... ok
examples/awk/p.52... ok
examples/awk/p.5a... ok
examples/awk/p.6... ok
examples/awk/p.7... ok
examples/awk/p.8... ok
examples/awk/p.9... ok
examples/awk/p.table... ok

# One True AWK Example Programs

examples/awk/t.0... ok
examples/awk/t.0a... ok
examples/awk/t.1... ok
examples/awk/t.1.x... ok
examples/awk/t.2... ok
examples/awk/t.2.x... ok
examples/awk/t.3... ok
examples/awk/t.3.x... ok
examples/awk/t.4... ok
examples/awk/t.4.x... ok
examples/awk/t.5.x... ok
examples/awk/t.6... ok
examples/awk/t.6.x... ok
examples/awk/t.6a... ok
examples/awk/t.6b... ok
examples/awk/t.8.x... ok
examples/awk/t.8.y... ok
examples/awk/t.addops... ok
examples/awk/t.aeiou... ok
examples/awk/t.aeiouy... ok
examples/awk/t.arith... ok
examples/awk/t.array... ok
examples/awk/t.array1... ok
examples/awk/t.array2... ok
examples/awk/t.assert... ok
examples/awk/t.avg... ok
examples/awk/t.b.x... ok
examples/awk/t.be... ok
examples/awk/t.beginexit... ok
examples/awk/t.beginnext... ok
examples/awk/t.break... ok
examples/awk/t.break1... ok
examples/awk/t.break2... ok
examples/awk/t.break3... ok
examples/awk/t.bug1... ok
examples/awk/t.builtins... ok
examples/awk/t.cat... ok
examples/awk/t.cat1... ok
examples/awk/t.cat2... ok
examples/awk/t.cmp... ok
examples/awk/t.coerce... ok
examples/awk/t.coerce2... ok
examples/awk/t.comment... ok
examples/awk/t.comment1... ok
examples/awk/t.concat... ok
examples/awk/t.cond... ok
examples/awk/t.contin... ok
examples/awk/t.count... ok
examples/awk/t.cum... ok
examples/awk/t.d.x... ok
examples/awk/t.delete... ok
examples/awk/t.delete1... ok
examples/awk/t.delete2... ok
examples/awk/t.delete3... ok
examples/awk/t.do... ok
examples/awk/t.e... ok
examples/awk/t.else... ok
examples/awk/t.exit... ok
examples/awk/t.exit1... ok
examples/awk/t.f... ok
examples/awk/t.f.x... ok
examples/awk/t.f0... ok
examples/awk/t.f1... ok
examples/awk/t.f2... ok
examples/awk/t.f3... ok
examples/awk/t.f4... ok
examples/awk/t.for... ok
examples/awk/t.for1... ok
examples/awk/t.for2... ok
examples/awk/t.format4... ok
examples/awk/t.fun... ok
examples/awk/t.fun0... ok
examples/awk/t.fun1... ok
examples/awk/t.fun2... ok
examples/awk/t.fun3... ok
examples/awk/t.fun4... ok
examples/awk/t.fun5... ok
examples/awk/t.getline... ok
examples/awk/t.getval... ok
examples/awk/t.gsub... ok
examples/awk/t.gsub1... ok
examples/awk/t.gsub3... ok
examples/awk/t.gsub4... ok
examples/awk/t.i.x... ok
examples/awk/t.if... ok
examples/awk/t.in... ok
examples/awk/t.in1... ok
examples/awk/t.in2... ok
examples/awk/t.in3... ok
examples/awk/t.incr... ok
examples/awk/t.incr2... ok
examples/awk/t.incr3... ok
examples/awk/t.index... ok
examples/awk/t.intest... ok
examples/awk/t.intest2... ok
examples/awk/t.j.x... ok
examples/awk/t.longstr... ok
examples/awk/t.makef... ok
examples/awk/t.match... ok
examples/awk/t.match1... ok
examples/awk/t.max... ok
examples/awk/t.mod... ok
examples/awk/t.monotone... ok
examples/awk/t.nameval... ok
examples/awk/t.next... ok
examples/awk/t.NF... ok
examples/awk/t.not... ok
examples/awk/t.null0... ok
examples/awk/t.ofmt... ok
examples/awk/t.ofs... Warning: missing newline at end of file /tmp/dNPaiUb
Warning: missing newline at end of file examples/out/t.ofs
ok
examples/awk/t.ors... Warning: missing newline at end of file /tmp/dQPayUb
Warning: missing newline at end of file examples/out/t.ors
ok
examples/awk/t.pat... ok
examples/awk/t.pipe... ok
examples/awk/t.pp... ok
examples/awk/t.pp1... ok
examples/awk/t.pp2... ok
examples/awk/t.printf... ok
examples/awk/t.printf2... ok
examples/awk/t.quote... ok
examples/awk/t.randk... ok
examples/awk/t.re1... ok
examples/awk/t.re1a... ok
examples/awk/t.re2... ok
examples/awk/t.re3... ok
examples/awk/t.re4... ok
examples/awk/t.re5... ok
examples/awk/t.re7... ok
examples/awk/t.rec... ok
examples/awk/t.redir... ok
examples/awk/t.reFS... ok
examples/awk/t.reg... ok
examples/awk/t.roff... ok
examples/awk/t.sep... ok
examples/awk/t.seqno... ok
examples/awk/t.set0... ok
examples/awk/t.set0a... ok
examples/awk/t.set0b... ok
examples/awk/t.set1... ok
examples/awk/t.set2... ok
examples/awk/t.set3... ok
examples/awk/t.split... ok
examples/awk/t.split2... ok
examples/awk/t.split3... ok
examples/awk/t.split4... ok
examples/awk/t.split9... ok
examples/awk/t.split9a... ok
examples/awk/t.stately... ok
examples/awk/t.strcmp... ok
examples/awk/t.strcmp1... ok
examples/awk/t.strnum... ok
examples/awk/t.sub... ok
examples/awk/t.sub1... ok
examples/awk/t.sub2... ok
examples/awk/t.sub3... ok
examples/awk/t.substr... ok
examples/awk/t.substr1... ok
examples/awk/t.time... ok
examples/awk/t.vf... ok
examples/awk/t.vf1... ok
examples/awk/t.vf2... ok
examples/awk/t.vf3... ok
examples/awk/t.x... ok

# One True AWK Test Programs

./T.-f-f... ok
./T.argv... ok
./T.builtin... ok
./T.chem... ok
./T.close... ok
./T.clv... ok
./T.errmsg... ok
./T.expr... ok
./T.exprconv... ok
./T.flags... ok
./T.func... ok
./T.gawk... ok
./T.getline... ok
./T.latin1... ok
./T.main... ok
./T.misc... ok
./T.overflow... ok
./T.re... ok
./T.redir... ok
./T.split... ok
./T.sub... ok
./T.system... ok

# Imported GAWK Test Programs

anchgsub.awk... ok
anchor.awk... ok
arrayind3.awk... ok
arrayprm2.awk... ok
arrayprm3.awk... ok
arrayref.awk... ok
arrymem1.awk... ok
arynasty.awk... ok
aryprm9.awk... ok
arysubnm.awk... ok
aryunasgn.awk... ok
asgext.awk... ok
childin.awk... ok
clobber.awk... ok
compare2.awk... ok
concat1.awk... ok
concat2.awk... ok
concat4.awk... ok
concat5.awk... ok
dfastress.awk... ok
dynlj.awk... ok
eofsplit.awk... ok
exit2.awk... ok
exitval2.awk... ok
exitval3.awk... ok
fcall_exit.awk... ok
fcall_exit2.awk... ok
fldchg.awk... ok
fldchgnf.awk... ok
fldterm.awk... ok
forsimp.awk... ok
fsbs.awk... ok
fsrs.awk... ok
fsspcoln.awk... ok
fstabplus.awk... ok
funsemnl.awk... ok
funstack.awk... ok
getline3.awk... ok
getlnbuf.awk... ok
getlnhd.awk... ok
getnr2tb.awk... ok
getnr2tm.awk... ok
gsubtest.awk... ok
gsubtst2.awk... ok
gsubtst7.awk... ok
gsubtst8.awk... ok
hex.awk... ok
hex2.awk... ok
inpref.awk... ok
inputred.awk... ok
intest.awk... ok
intprec.awk... ok
iobug1.awk... ok
leadnl.awk... ok
longsub.awk... ok
manglprm.awk... ok
math.awk... ok
membug1.awk... ok
minusstr.awk... ok
mtchi18n.awk... ok
nasty.awk... ok
nasty2.awk... ok
negexp.awk... ok
negrange.awk... ok
nested.awk... ok
nfldstr.awk... ok
nfloop.awk... ok
nlfldsep.awk... ok
nlinstr.awk... ok
nlstrina.awk... ok
noloop1.awk... ok
noloop2.awk... ok
nulrsend.awk... ok
numindex.awk... ok
numstr1.awk... ok
numsubstr.awk... ok
octsub.awk... ok
ofmt.awk... ok
ofmtfidl.awk... ok
ofmts.awk... ok
ofmtstrnum.awk... ok
onlynl.awk... ok
opasnidx.awk... ok
opasnslf.awk... ok
paramtyp.awk... ok
paramuninitglobal.awk... ok
parse1.awk... ok
pcntplus.awk... ok
pipeio1.awk... ok
posix2008sub.awk... ok
prdupval.awk... ok
prec.awk... ok
printf0.awk... ok
printf1.awk... ok
printfchar.awk... ok
prmreuse.awk... ok
prt1eval.awk... ok
range1.awk... ok
rebt8b1.awk... ok
rebuild.awk... ok
redfilnm.awk... ok
regexpbrack2.awk... ok
reparse.awk... ok
resplit.awk... ok
rri1.awk... ok
rs.awk... ok
rscompat.awk... ok
rsnul1nl.awk... ok
rstest2.awk... ok
rstest3.awk... ok
rstest4.awk... ok
rstest5.awk... ok
rstest6.awk... ok
rswhite.awk... ok
setrec0.awk... ok
setrec1.awk... ok
sigpipe1.awk... ok
splitargv.awk... ok
splitdef.awk... ok
splitvar.awk... ok
splitwht.awk... ok
strcat1.awk... ok
strnum1.awk... ok
strnum2.awk... ok
strtod.awk... ok
subamp.awk... ok
subi18n.awk... ok
subslash.awk... ok
substr.awk... ok
swaplns.awk... ok
tweakfld.awk... ok
uninit2.awk... ok
uninit5.awk... ok
uparrfs.awk... ok
wideidx.awk... ok
wideidx2.awk... ok
widesub.awk... ok
widesub2.awk... ok
widesub3.awk... ok
wjposer1.awk... ok
zero2.awk... ok
zeroe0.awk... ok
zeroflag.awk... ok
./compare.sh... ok
./getline2.sh... ok
./leaddig.sh... ok
./localenl.sh... ok
./messages.sh... ok
./nors.sh... ok
./poundbang.sh... ok
./randtest.sh... ok
./rsnulbig.sh... ok
./rsnulbig2.sh... ok

# Imported GAWK Syntax Tests

arrayparm.awk... ok
arryref3.awk... ok
arryref4.awk... ok
arryref5.awk... ok
aryprm1.awk... ok
aryprm2.awk... ok
aryprm3.awk... ok
aryprm4.awk... ok
aryprm5.awk... ok
aryprm6.awk... ok
badassign1.awk... ok
badbuild.awk... ok
callparam.awk... ok
delfunc.awk... ok
fnarray.awk... ok
fnaryscl.awk... ok
fnmisc.awk... ok
gsubasgn.awk... ok
nastyparm.awk... ok
noparms.awk... ok
nulinsrc.awk... ok
parseme.awk... ok
readbuf.awk... ok
scalar.awk... ok
sclforin.awk... ok
sclifin.awk... ok
synerr1.awk... ok
synerr2.awk... ok
tradanch1.awk... ok
unterm.awk... ok

TOTAL: 425/425
#2

Updated by Electric Monk 11 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit e6d6c189fa3a95d7aa27bbe0aeacf7c1a6b57c8c

commit  e6d6c189fa3a95d7aa27bbe0aeacf7c1a6b57c8c
Author: Cody Peter Mello <cody.mello@joyent.com>
Date:   2019-08-24T02:54:33.000Z

    11550 Want tests for nawk(1)
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF