From ef901854cd4461d5de38a7decd2a8a628b209518 Mon Sep 17 00:00:00 2001 From: Adam Talbot Date: Wed, 24 Jan 2024 13:06:08 +0000 Subject: [PATCH] feat: add test module Signed-off-by: Adam Talbot --- modules/test/00_mod.mk | 17 +++++++++++++++++ modules/test/02_mod.mk | 27 +++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 modules/test/00_mod.mk create mode 100644 modules/test/02_mod.mk diff --git a/modules/test/00_mod.mk b/modules/test/00_mod.mk new file mode 100644 index 0000000..545074a --- /dev/null +++ b/modules/test/00_mod.mk @@ -0,0 +1,17 @@ +# Copyright 2023 The cert-manager Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +shared_test_targets ?= +go_test_targets ?= +junitfile ?= \ No newline at end of file diff --git a/modules/test/02_mod.mk b/modules/test/02_mod.mk new file mode 100644 index 0000000..c9c3002 --- /dev/null +++ b/modules/test/02_mod.mk @@ -0,0 +1,27 @@ +# Copyright 2023 The cert-manager Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +## Run golang tests +## @category [shared] Test +.PHONY: test-go +test-go: | $(NEEDS_GOTESTSUM) + $(if $(go_test_targets),$(GOTESTSUM) $(addprefix --junitfile=, $(junitfile)) -- $(go_test_targets)) + +shared_test_targets += test-go + +.PHONY: test +## Run all test targets +## @category [shared] Test +test: $(shared_test_targets) +