Skip to content

Commit

Permalink
Inline testlib.sh file
Browse files Browse the repository at this point in the history
This was used only on one place so there is no need to have a separate
library file.
  • Loading branch information
jkonecny12 committed Jun 27, 2023
1 parent 6c8c607 commit 33508dd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 40 deletions.
1 change: 0 additions & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ PEP8_TARGETS ?= ""
dist_check_SCRIPTS = \
$(srcdir)/glade_tests/*.py \
$(srcdir)/lib/*.py \
$(srcdir)/lib/*.sh \
unit_tests/unit_tests.sh \
rpm_tests/rpm_tests.sh \
pylint/runpylint.py \
Expand Down
22 changes: 20 additions & 2 deletions tests/cppcheck/runcppcheck.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
#!/bin/sh

# Print a list of files to test on stdout
# Takes filter arguments identical to the find utility, for example
# findtestfiles -name '*.py'. Note that pruning directories will not
# work since find is passed a list of filenames as the path arguments.
findtestfiles()
{
# If the test is being run from a git work tree, use a list of all files
# known to git
# shellcheck disable=SC2154
if [ -d "${top_srcdir}/.git" ]; then
findpath=$(git ls-files -c "${top_srcdir}")
# Otherwise list everything under $top_srcdir
else
findpath="${top_srcdir} -type f"
fi

# shellcheck disable=SC2086
find $findpath "$@"
}

# If $top_srcdir has not been set by automake, import the test environment
if [ -z "$top_srcdir" ]; then
top_srcdir="$(dirname "$0")/../.."
. "${top_srcdir}/tests/testenv.sh"
fi

. "${top_srcdir}/tests/lib/testlib.sh"

if ! type cppcheck > /dev/null 2>&1 ; then
echo "SKIP - cppcheck must be installed to run it."
exit 77
Expand Down
37 changes: 0 additions & 37 deletions tests/lib/testlib.sh

This file was deleted.

0 comments on commit 33508dd

Please sign in to comment.