diff options
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | Kyuafile | 5 | ||||
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | tests/Kyuafile | 6 | ||||
-rwxr-xr-x | tests/setup_keymap_test | 23 |
5 files changed, 43 insertions, 17 deletions
@@ -1,7 +1,8 @@ -*.tar.gz -lbu *.sh +*.tar.gz +Kyuafile copy-modloop +lbu setup-acf setup-ads setup-alpine @@ -26,6 +27,6 @@ setup-sshd setup-timezone setup-xen-dom0 setup-xorg-base +uniso update-conf update-kernel -uniso diff --git a/Kyuafile b/Kyuafile deleted file mode 100644 index bb1c24a..0000000 --- a/Kyuafile +++ /dev/null @@ -1,5 +0,0 @@ -syntax(2) - -test_suite('alpine-conf') - -include('tests/Kyuafile') @@ -62,7 +62,7 @@ SED_REPLACE := -e 's:@VERSION@:$(FULL_VERSION):g' \ ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@ && chmod +x $@ .PHONY: all apk clean install uninstall iso -all: $(SCRIPTS) $(BIN_FILES) +all: $(SCRIPTS) $(BIN_FILES) Kyuafile tests/Kyuafile uniso: uniso.c $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ @@ -94,7 +94,7 @@ uninstall: done clean: - rm -rf $(SCRIPTS) $(BIN_FILES) alpine-conf.iso + rm -rf $(SCRIPTS) $(BIN_FILES) alpine-conf.iso tests/Kyuafile Kyuafile alpine-conf.iso: $(SCRIPTS) $(BIN_FILES) $(MAKE) install PREFIX=/ DESTDIR=tmp/ @@ -102,5 +102,18 @@ alpine-conf.iso: $(SCRIPTS) $(BIN_FILES) iso: alpine-conf.iso -test: $(SCRIPTS) $(BIN_FILES) +tests/Kyuafile: $(wildcard tests/*_test) + echo "syntax(2)" > $@ + echo 'test_suite("alpine-conf")' >> $@ + for i in $(notdir $(wildcard tests/*_test)); do \ + echo "atf_test_program{name='$$i',timeout=1}" >> $@ ; \ + done + +Kyuafile: + echo "syntax(2)" > $@ + echo "test_suite('alpine-conf')" >> $@ + echo "include('tests/Kyuafile')" >> $@ + +test: $(SCRIPTS) $(BIN_FILES) tests/Kyuafile Kyuafile kyua test || (kyua report --verbose && exit 1) + diff --git a/tests/Kyuafile b/tests/Kyuafile deleted file mode 100644 index 784f1ab..0000000 --- a/tests/Kyuafile +++ /dev/null @@ -1,6 +0,0 @@ -syntax(2) - -test_suite('alpine-conf') - -atf_test_program{name='setup_sshd_test', timeout=1} -atf_test_program{name='setup_hostname_test', timeout=1} diff --git a/tests/setup_keymap_test b/tests/setup_keymap_test new file mode 100755 index 0000000..641baf2 --- /dev/null +++ b/tests/setup_keymap_test @@ -0,0 +1,23 @@ +#!/usr/bin/env atf-sh + +init_env() { + PATH=$(atf_get_srcdir)/..:$PATH + export ROOT=$PWD LIBDIR=$(atf_get_srcdir)/.. MOCK=echo +} + +# docs: +# - https://github.com/jmmv/kyua/wiki/Quickstart-atf-sh-test +# - https://manned.org/atf-sh-api + +atf_test_case setup_keymap_usage +setup_keymap_usage_body() { + init_env + atf_check -s exit:0 \ + -o match:'^usage: setup-keymap' \ + -e empty \ + setup-keymap -h +} + +atf_init_test_cases() { + atf_add_test_case setup_keymap_usage +} |