From b3a480b203a25d8943128ef8447d14d5ae4bf931 Mon Sep 17 00:00:00 2001 From: Jingfang Liu Date: Fri, 16 Mar 2018 15:03:59 -0700 Subject: [PATCH] Update directories in test script --- cmd/kinflate/test/main.sh | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/cmd/kinflate/test/main.sh b/cmd/kinflate/test/main.sh index 0f966097c..2e4981106 100755 --- a/cmd/kinflate/test/main.sh +++ b/cmd/kinflate/test/main.sh @@ -33,23 +33,17 @@ export PATH=$GOPATH/bin:$PATH home=`pwd` example_dir="some/default/dir/for/examples" if [ $# -eq 1 ]; then - example_dir=$1 + example_dir=$1 fi if [ ! -d ${example_dir} ]; then - exit_with "directory ${example_dir} doesn't exist" + exit_with "directory ${example_dir} doesn't exist" fi -test_targets=$(ls ${example_dir}) - -for t in ${test_targets}; do - cd ${example_dir}/${t} - if [ -x "tests/test.sh" ]; then - tests/test.sh . - if [ $? -eq 0 ]; then - echo "testing ${t} passed." - else - exit_with "testing ${t} failed." - fi - fi - cd ${home} -done \ No newline at end of file +if [ -x "${example_dir}/tests/test.sh" ]; then + ${example_dir}/tests/test.sh ${example_dir} + if [ $? -eq 0 ]; then + echo "testing ${example_dir} passed." + else + exit_with "testing ${example_dir} failed." + fi +fi \ No newline at end of file