Skip to content

Commit a899202

Browse files
committed
Add trivial self check
Fixes #20
1 parent fdf2489 commit a899202

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ help:
3535
@echo "Available targets:"
3636
@echo " install - Install the script to $(LIBEXECDIR), and systemd files"
3737
@echo " uninstall - Remove installed files"
38+
@echo " check - Check for syntax errors in $(SCRIPT_SRC)"
3839
@echo " package - Build both RPM and DEB packages"
3940
@echo " rpm - Build RPM package"
4041
@echo " deb - Build DEB package"
@@ -67,6 +68,10 @@ uninstall:
6768
rm -rf $(DESTDIR)$(DOCDIR)
6869
@echo "Uninstall complete"
6970

71+
check:
72+
@echo "Running syntax test for $(SCRIPT_SRC)"
73+
bash -n $(SCRIPT_SRC)
74+
7075
# Package building targets
7176
package: rpm deb deb-source
7277

debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ override_dh_auto_build:
1313
# Nothing to build - this is a shell script package
1414

1515
override_dh_auto_test:
16-
# Skip tests for now
16+
$(MAKE) check
1717

1818
override_dh_install:
1919
dh_install

prometheus-cvmfs-exporter.spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ make install-systemd DESTDIR=%{buildroot}
5151
# Remove duplicate LICENSE file from doc directory since %license handles it
5252
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
5353

54+
%check
55+
make check
56+
5457
%post
5558
%systemd_post [email protected]
5659
%systemd_post cvmfs-client-prometheus.socket

0 commit comments

Comments
 (0)