From owner-svn-src-user@freebsd.org Sun Oct 4 10:26:59 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B6A2A0ED39 for ; Sun, 4 Oct 2015 10:26:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E717B1EEB; Sun, 4 Oct 2015 10:26:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t94AQw17052633; Sun, 4 Oct 2015 10:26:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t94AQwf7052632; Sun, 4 Oct 2015 10:26:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510041026.t94AQwf7052632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 4 Oct 2015 10:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r288663 - user/ngie/more-tests/bin/ls/tests X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2015 10:26:59 -0000 Author: ngie Date: Sun Oct 4 10:26:58 2015 New Revision: 288663 URL: https://svnweb.freebsd.org/changeset/base/288663 Log: Add a ls -R testcase; remove some debugging in the ls -S testcase Modified: user/ngie/more-tests/bin/ls/tests/ls_tests.sh Modified: user/ngie/more-tests/bin/ls/tests/ls_tests.sh ============================================================================== --- user/ngie/more-tests/bin/ls/tests/ls_tests.sh Sun Oct 4 09:39:40 2015 (r288662) +++ user/ngie/more-tests/bin/ls/tests/ls_tests.sh Sun Oct 4 10:26:58 2015 (r288663) @@ -301,6 +301,37 @@ L_flag_body() atf_check -e empty -o not-match:target1/target2 -s exit:0 ls -L } +atf_test_case R_flag +R_flag_head() +{ + atf_set "descr" "Verify that the output from ls -R prints out the directory contents recursively" +} + +R_flag_body() +{ + create_test_inputs + + WITH_R=$PWD/../with_R.out + WITH_R_expected_output=$PWD/../with_R_expected.out + + atf_check -e empty -o save:$WITH_R -s exit:0 ls -R + + set -- . $(find -s . \! -name '.*' -type d) + while [ $# -gt 0 ]; do + dir=$1; shift + [ "$dir" != "." ] && echo "$dir:" + (cd $dir && ls -1A | sed -e '/^\./d') + [ $# -ne 0 ] && echo + done > $WITH_R_expected_output + + echo "-R usage" + cat $WITH_R + echo "-R expected output" + cat $WITH_R_expected_output + + atf_check_equal "$(cat $WITH_R)" "$(cat $WITH_R_expected_output)" +} + atf_test_case S_flag S_flag_head() { @@ -324,11 +355,6 @@ S_flag_body() atf_check -e empty -o save:$WITH_S ls -D '%s' -lS atf_check -e empty -o save:$WITHOUT_S ls -D '%s' -l - #echo "-lS usage" - #cat $WITH_S - #echo "-l usage" - #cat $WITHOUT_S - WITH_S_parsed=$(awk '! /^total/ { print $7 }' $WITH_S) set -- $(awk '! /^total/ { print $5, $7 }' $WITHOUT_S) while [ $# -gt 0 ]; do @@ -834,7 +860,7 @@ atf_init_test_cases() atf_add_test_case I_flag_voids_implied_A_flag_when_root atf_add_test_case L_flag #atf_add_test_case P_flag - #atf_add_test_case R_flag + atf_add_test_case R_flag atf_add_test_case S_flag atf_add_test_case T_flag #atf_add_test_case U_flag