From 126a3af1a68303b335383a304dab33d0175af79f Mon Sep 17 00:00:00 2001 From: Bryan Bugyi Date: Thu, 29 Nov 2018 01:47:10 -0500 Subject: [PATCH] Meta: removed tests/Makefile and shared.mk --- .funky | 2 +- Makefile | 19 +++++++++++++++---- shared.mk | 12 ------------ tests/Makefile | 12 ------------ tests/README.md | 4 ++-- 5 files changed, 18 insertions(+), 31 deletions(-) delete mode 100644 shared.mk delete mode 100644 tests/Makefile diff --git a/.funky b/.funky index 454f845..a580703 100644 --- a/.funky +++ b/.funky @@ -1 +1 @@ -{"a": "source ~/projects/funky/venv/bin/activate \"$@\"", "SS": "find ./scripts -type f \\( -name \"*.py\" -not -name \"*__.py\" \\) -o -name \"*.sh\" \"$@\"", "C": "echo \"./setup.py ./setup.cfg ./.travis.yml ./MANIFEST.in ./.coveragerc ./.codecov.yaml\" \"$@\"", "D": "echo \"./README.md ./tests/README.md ./CHANGELOG.md ./CONTRIBUTING.md\" \"$@\"", "0": "cd /home/bryan/projects/funky/ || return 1", "I": "get funky \"$@\"", "LL": "ls -a && task project:Dev.funky -BLOCKED next \"$@\"", "M": "echo \"Makefile ./tests/Makefile ./shared.mk\"", "T": "find ./tests -type f -name \"*.py\" -not -name \"*__.py\" \"$@\"", "p": "d && eval \"$@\"; a", "S": "find ./funky -type f -name \"*.py\" -not -name \"*__.py\" \"$@\"", "r": "python -m funky \"$@\"", "t": "make check pytest_opts=\"$*\"", "d": "deactivate \"$@\"", "LLL": "ls -a && echo && ghi --no-pager \"$@\""} \ No newline at end of file +{"a": "source ~/projects/funky/venv/bin/activate \"$@\"", "SS": "find ./scripts -type f \\( -name \"*.py\" -not -name \"*__.py\" \\) -o -name \"*.sh\" \"$@\"", "C": "echo \"./Makefile ./setup.py ./setup.cfg ./.travis.yml ./MANIFEST.in ./.coveragerc ./.codecov.yaml\" \"$@\"", "D": "echo \"./README.md ./tests/README.md ./CHANGELOG.md ./CONTRIBUTING.md\" \"$@\"", "0": "cd /home/bryan/projects/funky/ || return 1", "I": "get funky \"$@\"", "LL": "ls -a && task project:Dev.funky -BLOCKED next \"$@\"", "T": "find ./tests -type f -name \"*.py\" -not -name \"*__.py\" \"$@\"", "p": "d && eval \"$@\"; a", "S": "find ./funky -type f -name \"*.py\" -not -name \"*__.py\" \"$@\"", "r": "python -m funky \"$@\"", "t": "make check pytest_opts=\"$*\"", "d": "deactivate \"$@\"", "LLL": "ls -a && echo && ghi --no-pager \"$@\""} \ No newline at end of file diff --git a/Makefile b/Makefile index 85d0791..640f445 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ -include shared.mk - +.PHONY: help +help: ## Print this message. + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort .PHONY: clean clean: clean-build clean-pyc clean-test ## Remove all build, test, coverage and Python artifacts. @@ -26,8 +27,18 @@ clean-test: ## Remove test and coverage artifacts. rm -fr htmlcov/ rm -fr .pytest_cache -check check-python check-shell: - @$(MAKE) --no-print-directory -C tests $@ +.PHONY: check +check: check-python check-shell ## Run all tests. + +.PHONY: check-python +check-python: ## Run Python tests. + @printf "\n%s\n" "---------- Running Python Tests ----------" + ./tests/runtests $(pytest_opts) + +.PHONY: check-shell +check-shell: ## Run Shell tests. + @printf "\n%s\n" "---------- Running Shell Tests ----------" + ./tests/scripts/shell/test_funky.sh .PHONY: release release: dist ## Package and upload a release. diff --git a/shared.mk b/shared.mk deleted file mode 100644 index 5ff5508..0000000 --- a/shared.mk +++ /dev/null @@ -1,12 +0,0 @@ -.DEFAULT_GOAL := help - - -.PHONY: help -help: ## Print this message. - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort - -.PHONY: test check check-python check-shell -test: check -check: ## Run all tests. -check-python: ## Run Python tests. -check-shell: ## Run Shell tests. diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 9f26198..0000000 --- a/tests/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -include ../shared.mk - - -check: check-python check-shell - -check-python: - @printf "\n%s\n" "---------- Running Python Tests ----------" - ./runtests $(pytest_opts) - -check-shell: - @printf "\n%s\n" "---------- Running Shell Tests ----------" - ./scripts/shell/test_funky.sh diff --git a/tests/README.md b/tests/README.md index c89e233..dadf9e3 100644 --- a/tests/README.md +++ b/tests/README.md @@ -2,8 +2,8 @@ Funky uses two different types of tests: -* Python tests, which test funky's core codebase. These tests use the [pytest] framework and can be run using the `make check-python` command. You may specify `pytest` command-line options by setting the `pytest_opts` variable (e.g. `make check-python pytest_opts=-v`). -* Shell tests, which test the shell integration script. These tests use the [shunit2] framework and can be run using the `make check-shell` command. +* **Python tests**, which test funky's core codebase. These tests use the [pytest] framework and can be run using the `make check-python` command. You may specify `pytest` command-line options by setting the `pytest_opts` variable (e.g. `make check-python pytest_opts=-v`). +* **Shell tests**, which test the shell integration script. These tests use the [shunit2] framework and can be run using the `make check-shell` command. You can **run all the tests** using the `make check` command.