[Midnightbsd-cvs] src [11348] trunk/bin/echo/tests: add tests

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Jul 6 08:01:09 EDT 2018


Revision: 11348
          http://svnweb.midnightbsd.org/src/?rev=11348
Author:   laffer1
Date:     2018-07-06 08:01:08 -0400 (Fri, 06 Jul 2018)
Log Message:
-----------
add tests

Modified Paths:
--------------
    trunk/bin/echo/Makefile
    trunk/bin/echo/echo.1

Added Paths:
-----------
    trunk/bin/echo/tests/
    trunk/bin/echo/tests/Makefile
    trunk/bin/echo/tests/echo_test.sh

Property Changed:
----------------
    trunk/bin/echo/echo.1

Modified: trunk/bin/echo/Makefile
===================================================================
--- trunk/bin/echo/Makefile	2018-07-06 12:00:20 UTC (rev 11347)
+++ trunk/bin/echo/Makefile	2018-07-06 12:01:08 UTC (rev 11348)
@@ -1,7 +1,13 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
-# $FreeBSD: src/bin/echo/Makefile,v 1.8 2001/12/04 01:57:40 obrien Exp $
-# $MidnightBSD$
+# $FreeBSD: stable/10/bin/echo/Makefile 320712 2017-07-06 05:28:35Z ngie $
 
+.include <bsd.own.mk>
+
 PROG=	echo
 
+.if ${MK_TESTS} != "no"
+SUBDIR+= 	tests
+.endif
+
 .include <bsd.prog.mk>

Modified: trunk/bin/echo/echo.1
===================================================================
--- trunk/bin/echo/echo.1	2018-07-06 12:00:20 UTC (rev 11347)
+++ trunk/bin/echo/echo.1	2018-07-06 12:01:08 UTC (rev 11348)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\"-
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -30,10 +31,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	@(#)echo.1	8.1 (Berkeley) 7/22/93
-.\" $FreeBSD: src/bin/echo/echo.1,v 1.19 2005/01/16 16:41:56 ru Exp $
-.\" $MidnightBSD: src/bin/echo/echo.1,v 1.2 2006/07/07 15:51:44 laffer1 Exp $
+.\" $FreeBSD: stable/10/bin/echo/echo.1 307415 2016-10-16 23:09:04Z sevan $
 .\"
-.Dd November 12, 2010
+.Dd October 5, 2016
 .Dt ECHO 1
 .Os
 .Sh NAME
@@ -104,3 +104,8 @@
 utility conforms to
 .St -p1003.1-2001
 as amended by Cor.\& 1-2002.
+.Sh HISTORY
+The
+.Nm
+command appeared in
+.At v2 .


Property changes on: trunk/bin/echo/echo.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: trunk/bin/echo/tests/Makefile
===================================================================
--- trunk/bin/echo/tests/Makefile	                        (rev 0)
+++ trunk/bin/echo/tests/Makefile	2018-07-06 12:01:08 UTC (rev 11348)
@@ -0,0 +1,6 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/bin/echo/tests/Makefile 319626 2017-06-06 16:04:27Z ngie $
+
+ATF_TESTS_SH+=  echo_test
+
+.include <bsd.test.mk>


Property changes on: trunk/bin/echo/tests/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/bin/echo/tests/echo_test.sh
===================================================================
--- trunk/bin/echo/tests/echo_test.sh	                        (rev 0)
+++ trunk/bin/echo/tests/echo_test.sh	2018-07-06 12:01:08 UTC (rev 11348)
@@ -0,0 +1,59 @@
+#
+# Copyright 2017 Shivansh Rai
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD: stable/10/bin/echo/tests/echo_test.sh 321830 2017-07-31 23:03:10Z asomers $
+# $MidnightBSD$
+
+atf_test_case n_output
+n_output_head()
+{
+	atf_set "descr" "Verify that echo(1) does not print the trailing " \
+			"newline character with option '-n'"
+}
+
+n_output_body()
+{
+	atf_check -s ignore -o inline:"Hello world" \
+		/bin/echo -n "Hello world"
+}
+
+atf_test_case append_c_output
+append_c_output_head()
+{
+	atf_set "descr" "Verify that echo(1) does not print the trailing newline " \
+			"character when '\c' is appended to the end of the string"
+}
+
+append_c_output_body()
+{
+	atf_check -s ignore -o inline:"Hello world" \
+		/bin/echo "Hello world\c"
+}
+
+atf_init_test_cases()
+{
+	atf_add_test_case n_output
+	atf_add_test_case append_c_output
+}


Property changes on: trunk/bin/echo/tests/echo_test.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list