Skip to content

Commit 46e5b05

Browse files
committed
feat: Update test targets
Signed-off-by: Saalim Quadri <danascape@gmail.com>
1 parent 45c7d45 commit 46e5b05

3 files changed

Lines changed: 23 additions & 14 deletions

File tree

Makefile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,11 @@ _uninstall-user:
100100

101101
# Development targets
102102

103-
check-scripts:
104-
while read -r script; do shellcheck --exclude=SC1090,SC1091 $$script; done < tests/files
105-
106-
execute-shfmt:
103+
format:
107104
while read -r script; do shfmt -ln=bash -fn -ci -sr -w $$script; done < tests/files
108105

109-
test: check-scripts
110-
@echo "All tests passed"
106+
tests:
107+
@./tests/run_tests.sh
111108

112109
docs:
113110
$(MAKE) -C docs html
@@ -139,9 +136,8 @@ help:
139136
@echo " sudo make uninstall Remove system installation"
140137
@echo ""
141138
@echo "Development:"
142-
@echo " make check-scripts Run shellcheck on all scripts"
143-
@echo " make execute-shfmt Format scripts with shfmt"
144-
@echo " make test Run all tests"
139+
@echo " make tests Run all tests"
140+
@echo " make format Format scripts with shfmt"
145141
@echo " make docs Build documentation"
146142
@echo " make docs-clean Clean documentation build"
147143
@echo ""
@@ -152,5 +148,5 @@ help:
152148
.PHONY: install uninstall
153149
.PHONY: _install-system _install-system-bin _install-system-src _install-system-utils _install-system-configs _install-system-man
154150
.PHONY: _uninstall-system _install-user _uninstall-user
155-
.PHONY: check-scripts execute-shfmt test docs docs-clean
151+
.PHONY: format tests docs docs-clean
156152
.PHONY: dist clean help

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,8 @@ The package will be created in the parent directory.
149149
## Development
150150

151151
```bash
152-
make check-scripts # Run shellcheck
153-
make execute-shfmt # Format scripts
154-
make test # Run all tests
152+
make tests # Run all tests
153+
make format # Format scripts
155154
make docs # Build documentation
156155
make docs-clean # Clean documentation build
157156
make help # Show all targets

tests/run_tests.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
#!/usr/bin/env bash
22

33
#
4-
# Copyright (C) 2019 Saalim Quadri <danascape@gmail.com>
4+
# SPDX-FileCopyrightText: 2019 Saalim Quadri <danascape@gmail.com>
55
# SPDX-License-Identifier: GPL-3.0-or-later
66
#
7+
8+
set -e
9+
10+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11+
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
12+
13+
echo "Running ShellCheck"
14+
while read -r script; do
15+
echo "Checking: $script"
16+
shellcheck --exclude=SC1090,SC1091 "$PROJECT_ROOT/$script"
17+
done < "$SCRIPT_DIR/files"
18+
19+
echo ""
20+
echo "All tests passed"

0 commit comments

Comments
 (0)