1282338Sbapt# $FreeBSD: releng/11.0/usr.bin/soelim/tests/soelim.sh 282425 2015-05-04 18:20:31Z bapt $ 2282338Sbapt 3282338Sbaptatf_test_case stdin 4282338Sbaptstdin_head() 5282338Sbapt{ 6282338Sbapt atf_set "descr" "stdin functionality" 7282338Sbapt} 8282338Sbapt 9282338Sbaptstdin_body() 10282338Sbapt{ 11282338Sbapt # no file after .so 12282338Sbapt atf_check \ 13282338Sbapt -o inline:".so\n" \ 14282338Sbapt -e empty \ 15282338Sbapt -s exit:0 \ 16282338Sbapt soelim <<-EOF 17282338Sbapt.so 18282338SbaptEOF 19282338Sbapt 20282338Sbapt # only space after .so 21282338Sbapt atf_check \ 22282338Sbapt -o inline:".so \n" \ 23282338Sbapt -e empty \ 24282338Sbapt -s exit:0 \ 25282338Sbapt soelim <<-EOF 26282338Sbapt.so 27282338SbaptEOF 28282338Sbapt 29282338Sbapt # explicit stdin 30282338Sbapt atf_check \ 31282338Sbapt -o inline:".so\n" \ 32282338Sbapt -e empty \ 33282338Sbapt -s exit:0 \ 34282338Sbapt soelim - <<-EOF 35282338Sbapt.so 36282338SbaptEOF 37282338Sbapt 38282338Sbapt atf_check \ 39282338Sbapt -o empty \ 40282338Sbapt -e inline:"soelim: can't open 'afile': No such file or directory\n" \ 41282338Sbapt -s exit:1 \ 42282338Sbapt soelim <<-EOF 43282338Sbapt.so afile 44282338SbaptEOF 45282338Sbapt 46282338Sbapt atf_check \ 47282338Sbapt -o inline:".soafile\n" \ 48282338Sbapt -e empty \ 49282338Sbapt -s exit:0 \ 50282338Sbapt soelim <<-EOF 51282338Sbapt.soafile 52282338SbaptEOF 53282338Sbapt 54282338Sbapt atf_check \ 55282338Sbapt -o empty \ 56282338Sbapt -e inline:"soelim: can't open 'afile': No such file or directory\n" \ 57282338Sbapt -s exit:1 \ 58282338Sbapt soelim -C <<-EOF 59282338Sbapt.soafile 60282338SbaptEOF 61282338Sbapt} 62282338Sbapt 63282338Sbaptatf_test_case files 64282338Sbaptfiles_head() 65282338Sbapt{ 66282338Sbapt atf_set "descr" "testing files" 67282338Sbapt} 68282338Sbapt 69282338Sbaptfiles_body() 70282338Sbapt{ 71282338Sbapt atf_check \ 72282338Sbapt -o inline:"This is a test\n" \ 73282338Sbapt -e inline:"soelim: can't open 'nonexistingfile': No such file or directory\n" \ 74282338Sbapt -s exit:1 \ 75282338Sbapt soelim $(atf_get_srcdir)/nonexisting.in 76282338Sbapt 77282338Sbapt cp $(atf_get_srcdir)/basic . 78282338Sbapt atf_check \ 79282338Sbapt -o file:$(atf_get_srcdir)/basic.out \ 80282338Sbapt -e empty \ 81282338Sbapt -s exit:0 \ 82282338Sbapt soelim $(atf_get_srcdir)/basic.in 83282338Sbapt 84282338Sbapt rm -f basic 85282338Sbapt atf_check \ 86282338Sbapt -o file:$(atf_get_srcdir)/basic.out \ 87282338Sbapt -e empty \ 88282338Sbapt -s exit:0 \ 89282338Sbapt soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic.in 90282425Sbapt 91282425Sbapt atf_check \ 92282425Sbapt -o file:$(atf_get_srcdir)/basic-with-space.out \ 93282425Sbapt -e empty \ 94282425Sbapt -s exit:0 \ 95282425Sbapt soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic-with-space.in 96282425Sbapt 97282338Sbapt} 98282338Sbapt 99282338Sbaptatf_init_test_cases() 100282338Sbapt{ 101282338Sbapt atf_add_test_case stdin 102282338Sbapt atf_add_test_case files 103282338Sbapt} 104