Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-12-18 21:42:54 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-12-18 21:46:18 -0500
commit73f6b77771a5ae58ef710e2256123bc86d0fc3a2 (patch)
treec9c42a11b2bd8a179a382850e111bea105a96163 /build-aux
parent32e3b16ec9eacbe7b2899cd922e11dcec19a3f44 (diff)
downloadtame-73f6b77771a5ae58ef710e2256123bc86d0fc3a2.tar.gz
tame-73f6b77771a5ae58ef710e2256123bc86d0fc3a2.tar.bz2
tame-73f6b77771a5ae58ef710e2256123bc86d0fc3a2.zip
[BC BREAK] check target supplier customization
This allows customizing from the command-line what suppliers should be checked. This motivation for this is both to run as part of a distributed pipeline (where each supplier may be built individually), and for during development of a single supplier. BC BREAK: Note that this will now check for `package' in the test path for UI tests. To keep the old directory around, a symlink of `packages' to `ui' would suffice. * build-aux/Makefile (SUPPLIERS, suppliers_strip): New variables. (check-am): BC-BREAK: Build and check only requested suppliers. * build-aux/progtest-runner: BC-BREAK: First argument is now test directory and all remaining arguments specify the supplier XML files to check.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/Makefile.am13
-rwxr-xr-xbuild-aux/progtest-runner24
2 files changed, 20 insertions, 17 deletions
diff --git a/build-aux/Makefile.am b/build-aux/Makefile.am
index 1508da6..94398b6 100644
--- a/build-aux/Makefile.am
+++ b/build-aux/Makefile.am
@@ -40,6 +40,10 @@ src_c1map := $(wildcard $(path_c1map)/*.xml)
src_common := $(shell find $(path_common) -name '*.xml')
xmlo_common := $(patsubst %.xml, %.xmlo, $(src_common))
+# Intended to be (optionally) overridden from the command line
+SUPPLIERS=$(src_suppliers) $(path_ui)/package.xml
+suppliers_strip=$(patsubst %.xml, %.strip.js, $(SUPPLIERS))
+
dest_summary_html := $(patsubst \
$(path_suppliers)/%.xml, \
$(path_suppliers)/%.html, \
@@ -281,10 +285,13 @@ intralov-root: summary-html
ln -fL $(path_dsl)/scripts/*.js "$(path_intralov_root)/rater/scripts/"
ln -fL $(path_suppliers)/*.{html,js} "$(path_intralov_root)/suppliers"
+# Suppliers to check may be overridden using SUPPLIERS. Multiple suppliers
+# should be space-delimited. Note that the UI is considered to be a special
+# type of supplier (ui/package.xml) and is included by default in the value
+# of SUPPLIERS.
+check-am: $(suppliers_strip)
+ $(path_dsl)/build-aux/progtest-runner $(path_tests) $(SUPPLIERS)
test: check
-check-am: strip
- @$(path_dsl)/build-aux/progtest-runner $(path_suppliers) $(path_tests)
- @$(path_dsl)/build-aux/progtest-runner ui/package.xml $(path_tests)/ui
kill-tamed: tamed-die
tamed-die:
diff --git a/build-aux/progtest-runner b/build-aux/progtest-runner
index 5fb8a27..5fe6fcd 100755
--- a/build-aux/progtest-runner
+++ b/build-aux/progtest-runner
@@ -15,27 +15,23 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# This program is intended to be called directly by make; it's API is
+# subject to change. Please use `make check` as appropriate.
##
-declare path_suppliers="${1?Missing supplier path}"
-declare path_tests="${2?Missing supplier test path}"
-
declare -i result=0
declare suppliers
-# if a file was provided, use it as the sole supplier; otherwise,
-# treat it as a directory of suppliers
-if [ -f "$path_suppliers" ]; then
- suppliers=( "$path_suppliers" )
- path_suppliers=$( dirname "$path_suppliers" )
-else
- suppliers=( "$path_suppliers"/*.xml )
-fi
-
-# run tests for each supplier individually
-for supplier in "${suppliers[@]}"; do
+# The first argument indicates the test directory.
+declare -r path_tests=${1?Missing test path}
+shift
+
+# All remaining arguments are taken to be a list of suppliers to test.
+for supplier in "$@"; do
base=$( basename "$supplier" .xml )
+ path_suppliers=$( dirname "$supplier" )
tests=$( find -L "$path_tests"/"$base"/ -name '*.yml' )
echo