Commit 8598be12 by Mariusz Kupidura Committed by GitHub

Remove unnecessary `run_tests.sh` and `run_linter.sh` scripts, and move logic…

 Remove unnecessary `run_tests.sh` and `run_linter.sh` scripts, and move logic directly to Makefile. (#327)
parent b95b8d05
......@@ -10,5 +10,4 @@ if [[ "$(uname -s)" == "Darwin" ]]; then
source ~/.venv/bin/activate
fi
source run_tests.sh
source run_linter.sh
make tests lint
\ No newline at end of file
.PHONY: build run test lint lint-modules clean prune help
MODULE=''
MODULES=routersploit
RSF_IMAGE=routersploit
FLAKE8_IGNORED_RULES=E501,W503
build:
docker build -t $(RSF_IMAGE) .
......@@ -10,13 +11,14 @@ run:
docker run -it --rm $(RSF_IMAGE)
lint:
./run_linter.sh
lint-modules:
./run_linter.sh modules
test: clean
./run_tests.sh $(MODULE)
flake8 --exclude=__init__.py --ignore=$(FLAKE8_IGNORED_RULES) $(MODULES)
tests: clean
ifeq ($(MODULES), routersploit)
python -m unittest discover
else
python -m unittest $(MODULES)
endif
clean:
find . -name '*.pyc' -exec rm -f {} +
......
#!/usr/bin/env bash
IFS=' '
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
MODULES_PATH=./routersploit
FAILURE=0
if [ "$1" ]; then
MODULES_PATH="$MODULES_PATH/$1"
fi
FLAKE8_IGNORED_RULES='E501,W503'
FLAKE8=$(flake8 --exclude=__init__.py --ignore=$FLAKE8_IGNORED_RULES $MODULES_PATH)
if [ "$FLAKE8" ]; then
echo -e "\n${RED}- flake8 violations:${NC}"
echo -e $FLAKE8
echo ""
FAILURE=1
else
echo -e "${GREEN}+ flake8${NC}"
fi
exit $FAILURE
#!/usr/bin/env bash
TEST_PATH="routersploit.test"
if [ -z $1 ] ; then
python -m unittest discover
else
for param in "$@" ; do
PARAMS="$PARAMS $TEST_PATH.$param"
done
python -m unittest $PARAMS
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment