Index: head/etc/mtree/BSD.tests.dist =================================================================== --- head/etc/mtree/BSD.tests.dist (revision 282337) +++ head/etc/mtree/BSD.tests.dist (revision 282338) @@ -1,582 +1,584 @@ # $FreeBSD$ # # Please see the file src/etc/mtree/README before making changes to this file. # /set type=dir uname=root gname=wheel mode=0755 . bin cat .. chown .. date .. expr .. mv .. pax .. pkill .. sh builtins .. errors .. execution .. expansion .. parameters .. parser .. set-e .. .. sleep .. test .. .. cddl lib .. sbin .. usr.bin .. usr.sbin dtrace common aggs .. arithmetic .. arrays .. assocs .. begin .. bitfields .. buffering .. builtinvar .. cg .. clauses .. cpc .. decls .. drops .. dtraceUtil .. end .. enum .. error .. exit .. fbtprovider .. funcs .. grammar .. include .. inline .. io .. ip .. java_api .. json .. lexer .. llquantize .. mdb .. mib .. misc .. multiaggs .. offsetof .. operators .. pid .. plockstat .. pointers .. pragma .. predicates .. preprocessor .. print .. printa .. printf .. privs .. probes .. proc .. profile-n .. providers .. raise .. rates .. safety .. scalars .. sched .. scripting .. sdt .. sizeof .. speculation .. stability .. stack .. stackdepth .. stop .. strlen .. strtoll .. struct .. syscall .. sysevent .. tick-n .. trace .. tracemem .. translators .. typedef .. types .. uctf .. union .. usdt .. ustack .. vars .. version .. .. .. .. .. etc rc.d .. .. games .. gnu lib .. usr.bin diff .. .. .. lib atf libatf-c detail .. .. libatf-c++ detail .. .. test-programs .. .. libc c063 .. db .. gen execve .. posix_spawn .. .. hash data .. .. inet .. locale .. net getaddrinfo data .. .. .. regex data .. .. ssp .. stdio .. stdlib .. string .. sys .. time .. tls dso .. .. termios .. ttyio .. .. libcrypt .. libmp .. libnv .. libpam .. libproc .. librt .. libthr dlopen .. .. libutil .. msun .. .. libexec atf atf-check .. atf-sh .. .. rtld-elf .. .. sbin dhclient .. devd .. growfs .. ifconfig .. mdconfig .. .. secure lib .. libexec .. usr.bin .. usr.sbin .. .. share examples tests atf .. plain .. .. .. .. sys aio .. fifo .. file .. kern execve .. .. kqueue .. mqueue .. netinet .. opencrypto .. pjdfstest chflags .. chmod .. chown .. ftruncate .. granular .. link .. mkdir .. mkfifo .. mknod .. open .. rename .. rmdir .. symlink .. truncate .. unlink .. .. vm .. .. usr.bin apply .. basename .. bmake archives fmt_44bsd .. fmt_44bsd_mod .. fmt_oldbsd .. .. basic t0 .. t1 .. t2 .. t3 .. .. execution ellipsis .. empty .. joberr .. plus .. .. shell builtin .. meta .. path .. path_select .. replace .. select .. .. suffixes basic .. src_wild1 .. src_wild2 .. .. syntax directive-t0 .. enl .. funny-targets .. semi .. .. sysmk t0 2 1 .. .. mk .. .. t1 2 1 .. .. mk .. .. t2 2 1 .. .. mk .. .. .. variables modifier_M .. modifier_t .. opt_V .. t0 .. .. .. calendar .. cmp .. comm .. cut .. dirname .. file2c .. grep .. gzip .. join .. jot .. lastcomm .. m4 .. mkimg .. ncal .. opensm .. printf .. sed regress.multitest.out .. .. + soelim + .. timeout .. tr .. truncate .. units .. uudecode .. uuencode .. xargs .. yacc yacc .. .. .. usr.sbin etcupdate .. newsyslog .. nmtree .. pw .. sa .. .. .. # vim: set expandtab ts=4 sw=4: Index: head/usr.bin/soelim/Makefile =================================================================== --- head/usr.bin/soelim/Makefile (revision 282337) +++ head/usr.bin/soelim/Makefile (revision 282338) @@ -1,5 +1,11 @@ # $FreeBSD$ +.include + PROG= soelim + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Index: head/usr.bin/soelim/tests/Makefile =================================================================== --- head/usr.bin/soelim/tests/Makefile (nonexistent) +++ head/usr.bin/soelim/tests/Makefile (revision 282338) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/soelim + +ATF_TESTS_SH= soelim + +FILES= nonexisting.in \ + basic.in \ + basic \ + basic.out +FILESDIR= ${TESTSDIR} + +.include Property changes on: head/usr.bin/soelim/tests/Makefile ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/usr.bin/soelim/tests/basic =================================================================== --- head/usr.bin/soelim/tests/basic (nonexistent) +++ head/usr.bin/soelim/tests/basic (revision 282338) @@ -0,0 +1 @@ +basic has been included Property changes on: head/usr.bin/soelim/tests/basic ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/usr.bin/soelim/tests/basic.in =================================================================== --- head/usr.bin/soelim/tests/basic.in (nonexistent) +++ head/usr.bin/soelim/tests/basic.in (revision 282338) @@ -0,0 +1,3 @@ +This is a test +.so basic +end Property changes on: head/usr.bin/soelim/tests/basic.in ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/usr.bin/soelim/tests/basic.out =================================================================== --- head/usr.bin/soelim/tests/basic.out (nonexistent) +++ head/usr.bin/soelim/tests/basic.out (revision 282338) @@ -0,0 +1,3 @@ +This is a test +basic has been included +end Property changes on: head/usr.bin/soelim/tests/basic.out ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/usr.bin/soelim/tests/nonexisting.in =================================================================== --- head/usr.bin/soelim/tests/nonexisting.in (nonexistent) +++ head/usr.bin/soelim/tests/nonexisting.in (revision 282338) @@ -0,0 +1,3 @@ +This is a test +.so nonexistingfile +This is next Property changes on: head/usr.bin/soelim/tests/nonexisting.in ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/usr.bin/soelim/tests/soelim.sh =================================================================== --- head/usr.bin/soelim/tests/soelim.sh (nonexistent) +++ head/usr.bin/soelim/tests/soelim.sh (revision 282338) @@ -0,0 +1,96 @@ +# $FreeBSD$ + +atf_test_case stdin +stdin_head() +{ + atf_set "descr" "stdin functionality" +} + +stdin_body() +{ + # no file after .so + atf_check \ + -o inline:".so\n" \ + -e empty \ + -s exit:0 \ + soelim <<-EOF +.so +EOF + + # only space after .so + atf_check \ + -o inline:".so \n" \ + -e empty \ + -s exit:0 \ + soelim <<-EOF +.so +EOF + + # explicit stdin + atf_check \ + -o inline:".so\n" \ + -e empty \ + -s exit:0 \ + soelim - <<-EOF +.so +EOF + + atf_check \ + -o empty \ + -e inline:"soelim: can't open 'afile': No such file or directory\n" \ + -s exit:1 \ + soelim <<-EOF +.so afile +EOF + + atf_check \ + -o inline:".soafile\n" \ + -e empty \ + -s exit:0 \ + soelim <<-EOF +.soafile +EOF + + atf_check \ + -o empty \ + -e inline:"soelim: can't open 'afile': No such file or directory\n" \ + -s exit:1 \ + soelim -C <<-EOF +.soafile +EOF +} + +atf_test_case files +files_head() +{ + atf_set "descr" "testing files" +} + +files_body() +{ + atf_check \ + -o inline:"This is a test\n" \ + -e inline:"soelim: can't open 'nonexistingfile': No such file or directory\n" \ + -s exit:1 \ + soelim $(atf_get_srcdir)/nonexisting.in + + cp $(atf_get_srcdir)/basic . + atf_check \ + -o file:$(atf_get_srcdir)/basic.out \ + -e empty \ + -s exit:0 \ + soelim $(atf_get_srcdir)/basic.in + + rm -f basic + atf_check \ + -o file:$(atf_get_srcdir)/basic.out \ + -e empty \ + -s exit:0 \ + soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic.in +} + +atf_init_test_cases() +{ + atf_add_test_case stdin + atf_add_test_case files +} Property changes on: head/usr.bin/soelim/tests/soelim.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property