From d9ef44eb6dbf8d924f8c118623b8deca23cfdaf1 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Fri, 16 Oct 2020 20:18:42 +0200 Subject: [PATCH] test: rename mpp-*.json to *.mpp.json This simplifies the `test-data` rules in `Makefile` considerably. Also, it allows adding `*.mpp.json` files in other directories without needing to copy rules. (make's pattern-based rules only allow a single `%`). Adjust test/data/README.md accordingly. --- Makefile | 6 +++--- test/data/README.md | 8 ++++---- .../manifests/{mpp-f32-base.json => f32-base.mpp.json} | 0 .../manifests/{mpp-f32-build.json => f32-build.mpp.json} | 0 .../{mpp-fedora-boot.json => fedora-boot.mpp.json} | 0 ...a-ostree-commit.json => fedora-ostree-commit.mpp.json} | 0 .../{mpp-filesystem.json => filesystem.mpp.json} | 0 7 files changed, 7 insertions(+), 7 deletions(-) rename test/data/manifests/{mpp-f32-base.json => f32-base.mpp.json} (100%) rename test/data/manifests/{mpp-f32-build.json => f32-build.mpp.json} (100%) rename test/data/manifests/{mpp-fedora-boot.json => fedora-boot.mpp.json} (100%) rename test/data/manifests/{mpp-fedora-ostree-commit.json => fedora-ostree-commit.mpp.json} (100%) rename test/data/manifests/{mpp-filesystem.json => filesystem.mpp.json} (100%) diff --git a/Makefile b/Makefile index 24622a4e..9a363986 100644 --- a/Makefile +++ b/Makefile @@ -205,10 +205,10 @@ coverity-clean-all: coverity-clean # for linters and other tests on the source code. # -TEST_MANIFESTS_MPP = $(wildcard $(SRCDIR)/test/data/manifests/mpp-*.json) -TEST_MANIFESTS_GEN = $(patsubst $(SRCDIR)/test/data/manifests/mpp-%.json,$(SRCDIR)/test/data/manifests/%.json,$(TEST_MANIFESTS_MPP)) +TEST_MANIFESTS_MPP = $(wildcard $(SRCDIR)/test/data/manifests/*.mpp.json) +TEST_MANIFESTS_GEN = $(TEST_MANIFESTS_MPP:%.mpp.json=%.json) -$(TEST_MANIFESTS_GEN): $(SRCDIR)/test/data/manifests/%.json: $(SRCDIR)/test/data/manifests/mpp-%.json +$(TEST_MANIFESTS_GEN): %.json: %.mpp.json $(SRCDIR)/tools/mpp-depsolve.py <"$<" \ | $(SRCDIR)/tools/mpp-import-pipeline.py >"$@" \ "--cwd=$(SRCDIR)/test/data/manifests" diff --git a/test/data/README.md b/test/data/README.md index 0c7b98f1..c88d7ddc 100644 --- a/test/data/README.md +++ b/test/data/README.md @@ -32,10 +32,10 @@ do not allow comments, this file shortly describes their purpose. this manifest's tree is constructed just from the filesystem package and is marked using the selinux stage. - Manifests prefixed with `mpp-*` are fed through the ManifestPreProcessors and - then stored in the same directory with the `mpp-*` prefix dropped. The - generated files are committed to the repository. Nevertheless, if you need to - regenerate them, use `make test-data`. + Manifests ending on `.mpp.json` are fed through the ManifestPreProcessors + and then stored in the same directory with an `.json` extension (replacing + `.mpp.json`). generated files are committed to the repository. Nevertheless, + if you need to regenerate them, use `make test-data`. * `./sources/`: This directory contains test-data for runtime tests of the source-engines. It diff --git a/test/data/manifests/mpp-f32-base.json b/test/data/manifests/f32-base.mpp.json similarity index 100% rename from test/data/manifests/mpp-f32-base.json rename to test/data/manifests/f32-base.mpp.json diff --git a/test/data/manifests/mpp-f32-build.json b/test/data/manifests/f32-build.mpp.json similarity index 100% rename from test/data/manifests/mpp-f32-build.json rename to test/data/manifests/f32-build.mpp.json diff --git a/test/data/manifests/mpp-fedora-boot.json b/test/data/manifests/fedora-boot.mpp.json similarity index 100% rename from test/data/manifests/mpp-fedora-boot.json rename to test/data/manifests/fedora-boot.mpp.json diff --git a/test/data/manifests/mpp-fedora-ostree-commit.json b/test/data/manifests/fedora-ostree-commit.mpp.json similarity index 100% rename from test/data/manifests/mpp-fedora-ostree-commit.json rename to test/data/manifests/fedora-ostree-commit.mpp.json diff --git a/test/data/manifests/mpp-filesystem.json b/test/data/manifests/filesystem.mpp.json similarity index 100% rename from test/data/manifests/mpp-filesystem.json rename to test/data/manifests/filesystem.mpp.json