mirror of
https://github.com/ntop/n2n.git
synced 2024-09-20 00:51:10 +02:00
80b33cd1a9
* Factor build packages out into a more maintainable list * Create a location for scripts to live * Provide a make target to return the source dir as close as reasonable to the original distributed state * Add a code lint step, checking the coding style * Change test harness as recommended by shellcheck * Ensure we actually have the linter tool installed * Use the correct directory for cmake to run the tests * Adjust for the older uncrustify in the current github ubuntu-latest * Make one file pass the linter * Integrate the lint with the existing test workflow * Add files with minimal changes needed to the linter * Add more files with minimal changes needed to the linter * Dont build binaries if we fail the lint test * Update the phony targets with the lint steps * Ensure the flake8 package is installed in the new lint workflow job * Use the makefile to drive the packages needed to install for linting * No need to add dependancies on lint, just rely on the workflow status to show failure * Update the scripts dir README to reflect current assumptions * Rename and briefly document the indent.sh script * Fix the ignore to ignore the right Makefile * Rename the test_harness script to make it clear it is a shell script * Provide a master lint make target and add a shell script lint tool * Elminate stray tabs * Drop include/auth.h from linter - there are inconsistant results with function definitions when using the current uncrustify rules
40 lines
823 B
Bash
Executable File
40 lines
823 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# This expects to find the tests in the tools dir and the expected results
|
|
# in the tests dir.
|
|
|
|
TESTS="
|
|
tests-compress
|
|
tests-elliptic
|
|
tests-hashing
|
|
tests-transform
|
|
tests-wire
|
|
"
|
|
|
|
TOOLSDIR=tools
|
|
TESTDATA=tests
|
|
|
|
# Allow both dirs be overidden
|
|
[ -n "$1" ] && TOOLSDIR="$1"
|
|
[ -n "$2" ] && TESTDATA="$2"
|
|
|
|
# Confirm we have all the tools and data
|
|
for i in $TESTS; do
|
|
if [ ! -e "$TOOLSDIR/$i" ]; then
|
|
echo "Could not find test $TOOLSDIR/$i"
|
|
exit 1
|
|
fi
|
|
if [ ! -e "$TESTDATA/$i.expected" ]; then
|
|
echo "Could not find testdata $TESTDATA/$i.expected"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
# Actually run the tests
|
|
set -e
|
|
for i in $TESTS; do
|
|
echo "$TOOLSDIR/$i >$TESTDATA/$i.out"
|
|
"$TOOLSDIR/$i" >"$TESTDATA/$i.out"
|
|
cmp "$TESTDATA/$i.expected" "$TESTDATA/$i.out"
|
|
done
|