]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
add backup test run success
authorBastian Dehn <hhaalo@arcor.de>
Mon, 3 Aug 2026 14:44:53 +0000 (16:44 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 3 Aug 2026 14:44:53 +0000 (16:44 +0200)
Makefile
src/backup [new file with mode: 0755]
tests/backup_tests.bats [new file with mode: 0755]

index dc35d62a08a6a7d96a702925867c1422a5c6cffd..f6eeeec9cf13117884e1b6fe4e68efca5ba67124 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,9 +8,12 @@ BINDIR=$(BUILDDIR)/$(PACKAGENAME)/$(PREFIX)/bin
 SHAREDIR=$(BUILDDIR)/$(PACKAGENAME)/$(PREFIX)/share/doc/$(PACKAGE)
 MANDIR=$(BUILDDIR)/$(PACKAGENAME)/$(PREFIX)/share/man
 
-.PHONY: all build package clean
+.PHONY: all test build package clean
 
-all: package
+all: test package
+
+test:
+       ./tests/backup_tests.bats
 
 build: $(BINDIR)/backup \
        $(BINDIR)/backupmount \
diff --git a/src/backup b/src/backup
new file mode 100755 (executable)
index 0000000..ca1d861
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+main()
+{
+       :
+}
+
+main "$@"
\ No newline at end of file
diff --git a/tests/backup_tests.bats b/tests/backup_tests.bats
new file mode 100755 (executable)
index 0000000..2945184
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/bats
+
+setup() {
+       bats_load_library 'bats-support'
+       bats_load_library 'bats-assert' 
+}
+
+@test "backup run success" {
+       run src/backup
+
+       assert_success
+}