"Fossies" - the Fresh Open Source Software Archive

Member "beautysh-6.0.1/tests/test_beautysh_scripts.sh" (10 Mar 2020, 567 Bytes) of package /linux/privat/beautysh-6.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test_beautysh_scripts.sh": 5.0.2_vs_6.0.1.

    1 #!/usr/bin/env bash
    2 
    3 # This is not a script loaded by Beautysh unit tests, rather this verifies
    4 # that all existing unit test scripts are valid Bash sources
    5 
    6 THIS_SCRIPT_NAME="$(basename $0)"
    7 THIS_SCRIPT_LOCATION="$(dirname $0)"
    8 ALL_UNIT_TEST_FILES="$(ls -1 $THIS_SCRIPT_LOCATION/*.sh | grep -v $THIS_SCRIPT_NAME)"
    9 for file in $ALL_UNIT_TEST_FILES; do
   10     echo "Verifying $file ..."
   11     /usr/bin/env bash $file </dev/null >/dev/null 2>&1
   12     if [ $? -ne 0 ]; then
   13         echo "Please fix unit test script $file. Bash refuses to load it!"
   14         exit 2 # fail
   15     fi
   16 done
   17 
   18 exit 0 # success