From: Ian Jackson Date: Tue, 4 May 2021 18:11:01 +0000 (+0100) Subject: bundles: Make the test bundle be an actual zipfile X-Git-Tag: otter-0.6.0~387 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5a7420e299028970c783f45037481122d8d767d3;p=otter.git bundles: Make the test bundle be an actual zipfile Signed-off-by: Ian Jackson --- diff --git a/.gitignore b/.gitignore index 42ccca77..8a347757 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Makefile b/Makefile index 6435ca69..e0afd69b 100644 --- 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)) \ diff --git a/docs/build.rst b/docs/build.rst index fd2f7f41..66e3e298 100644 --- a/docs/build.rst +++ b/docs/build.rst @@ -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 index d7616f71..00000000 --- a/examples/test-bundle.zip +++ /dev/null @@ -1 +0,0 @@ -todo! diff --git a/examples/test-bundle/otter.toml b/examples/test-bundle/otter.toml new file mode 100644 index 00000000..c67079f7 --- /dev/null +++ b/examples/test-bundle/otter.toml @@ -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"