chiark / gitweb /
bundles: Make the test bundle be an actual zipfile
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 May 2021 18:11:01 +0000 (19:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 May 2021 20:07:00 +0000 (21:07 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
Makefile
docs/build.rst
examples/test-bundle.zip [deleted file]
examples/test-bundle/otter.toml [new file with mode: 0644]

index 42ccca770f2432cc8b884b0c231efe526c9f95eb..8a34775784f684a6ddd94852b1f3fa8d8be0ae96 100644 (file)
@@ -8,6 +8,7 @@ templates/CC-BY-SA-4.0
 templates/otter_wasm.ns.d.ts
 templates/shapelib.html
 save/lock
+/examples/test-bundle.zip
 /library/*/files.make
 /library/*/*.usvg
 /library/*/*.coloured.svg
index 6435ca69c9fec6918bd9bab1447550005a3f3483..e0afd69b52ce764cdb19d23d6a98e80837d5c5e0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -146,7 +146,7 @@ full-check: stamp/cargo.release-miri stamp/cargo.debug-miri
 full-check:
        @echo 'Full tests passed.'
 
-doc: cargo-doc doc-sphinx
+doc: cargo-doc doc-sphinx examples
 
 debug release:: %: stamp/cargo.% assets libraries extra-%
 
@@ -156,6 +156,9 @@ cargo-debug cargo-release cargo-check cargo-doc \
 cargo-wasm-debug cargo-wasm-release:: \
 cargo-%: stamp/cargo.%
 
+examples: examples/test-bundle.zip
+.PHONY: examples
+
 cargo-wasm: cargo-wasm-release
 
 wasm: stamp/wasm-bindgen
@@ -316,6 +319,17 @@ templates/shapelib.html: $(TARGET_DIR)/debug/otterlib $(LIBRARY_FILES)
        --libs '$(addprefix $(PWD)/, $(addsuffix .toml, $(LIBRARIES)))' \
                preview >$@.tmp && mv -f $@.tmp $@
 
+#---------- examples ----------
+
+EXAMPLE_BUNDLE_INPUT_DEPS := $(shell                                   \
+       cd examples && find test-bundle \! \( -name '*~' -o -name '.*' \) \
+)
+
+examples/test-bundle.zip: $(addprefix examples/,$(EXAMPLE_BUNDLE_INPUT_DEPS))
+       set -e; rm -f $@.tmp; cd examples; zip -DXy $(notdir $@).tmp \
+               $(EXAMPLE_BUNDLE_INPUT_DEPS)
+       mv -f $@.tmp $@
+
 #---------- webdriver tests (wdt) ----------
 
 AT_TESTS := $(basename $(notdir $(wildcard apitest/at-*.rs)))
@@ -329,7 +343,7 @@ wdt:        $(foreach f, $(WDT_TESTS), stamp/$f.check) \
        $(foreach f, $(WDT_LANDSCAPE_TESTS), stamp/$f.lcheck) \
 
 RUNTEST_DEPS = apitest/run1 stamp/cargo.debug $(FILEASSETS) \
-               $(wildcard specs/*.toml) \
+               $(wildcard specs/*.toml) examples/test-bundle.zip \
                $(wildcard libraries/*.toml) $(LIBRARY_FILES)
 
 AT_DEPS =      $(filter-out templates/script.js, $(RUNTEST_DEPS)) \
index fd2f7f41977a030fc59c9fdd40d11cdbe00ee5f1..66e3e298c03028c723eeac44cc3990a947ff38e5 100644 (file)
@@ -18,7 +18,7 @@ Setup
 
 1. Install the packaged build dependencies::
 
-     sudo apt install build-essential cpio git curl            \
+     sudo apt install build-essential cpio git curl zip        \
                       pkg-config libssl-dev                    \
                       node-typescript inkscape                 \
                       netpbm imagemagick libtoml-parser-perl   \
diff --git a/examples/test-bundle.zip b/examples/test-bundle.zip
deleted file mode 100644 (file)
index d7616f7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-todo!
diff --git a/examples/test-bundle/otter.toml b/examples/test-bundle/otter.toml
new file mode 100644 (file)
index 0000000..c67079f
--- /dev/null
@@ -0,0 +1,5 @@
+# Copyright 2020-2021 Ian Jackson and contributors to Otter
+# SPDX-License-Identifier: AGPL-3.0-or-later
+# There is NO WARRANTY.
+
+title = "Example bundle"