diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-06-15 13:30:12 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-06-15 13:31:20 +0000 |
commit | 83d859286db8a184054a5e05f707953634c82604 (patch) | |
tree | d7224227db27abba7a9d21e1c2f074c0d7541f9a /test/Makefile | |
parent | ec6359732dec5651567f593d07871b5b7997c91d (diff) | |
download | apk-tools-83d859286db8a184054a5e05f707953634c82604.tar.gz apk-tools-83d859286db8a184054a5e05f707953634c82604.tar.bz2 apk-tools-83d859286db8a184054a5e05f707953634c82604.tar.xz apk-tools-83d859286db8a184054a5e05f707953634c82604.zip |
test: initial testsuite
Diffstat (limited to 'test/Makefile')
-rw-r--r-- | test/Makefile | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..23f3183 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,59 @@ + +repos := repo1 repo2 + +tmproot := /tmp/apk-test +testroot = $(tmproot)/$(basename $@) + +SUDO := sudo +APK := ../src/apk --keys-dir /etc/apk/keys +#SYSREPO ?= http://alpinelinux.org/cgi-bin/dl.cgi/edge/main +SYSREPO ?= http://192.168.8.4/main + +LD_LIBRARY_PATH = ../src +export LD_LIBRARY_PATH SYSREPO + +all: tests + +$(repos): + @echo "Building $@" + @rm -f repos.out + @cd $@ &&\ + for i in */APKBUILD; do\ + ( cd $${i%/*} && \ + PKGDEST="$$PWD/.." abuild -R ) >> ../repos.out 2>&1 || exit 1;\ + done + @cd $@ &&\ + ( apk index -o APKINDEX.tar.gz *.apk &&\ + abuild-sign APKINDEX.tar.gz ) >> ../repos.out 2>&1 + + +clean: + $(SUDO) rm -rf $(addsuffix /*.apk,$(repos)) $(tmproot) *.ok *.out *.stamp + + +repos: repos.stamp + +repos.stamp: $(repos) + @touch $@ + + +%.ok: %.sh + @echo -n "$<"; \ + rm -rf "$(testroot)" ;\ + mkdir -p "$(testroot)"; \ + if ! APK="$(APK)" ROOT="$(testroot)" SYSREPO="$(SYSREPO)" sh -e $< > $(basename $@).out 2>&1; then\ + echo " FAIL";\ + exit 1;\ + fi ;\ + echo " OK" ;\ + $(SUDO) rm -rf $(testroot); \ + touch $@ + +tests: repos.stamp + @echo "== Testing `$(APK) --version` ==" + @for i in test*.sh; do \ + rm -f $${i%.sh}.ok ;\ + $(SUDO) $(MAKE) --no-print-directory $${i%.sh}.ok SYSREPO=$(SYSREPO); \ + done + +.PHONY: $(repos) |