diff options
author | rillig <rillig@pkgsrc.org> | 2006-12-09 12:42:43 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-12-09 12:42:43 +0000 |
commit | c0db9bdc6f326c698ca9ca0dc6602bd01c1d3ba3 (patch) | |
tree | 76b1372392351d7b783c5647effd916f35b3dedf /mk | |
parent | 43e2a97aad35656a0d0f7c51e79e3b56bad768ae (diff) | |
download | pkgsrc-c0db9bdc6f326c698ca9ca0dc6602bd01c1d3ba3.tar.gz |
Added a small program to test a single transformation plug-in.
Diffstat (limited to 'mk')
-rwxr-xr-x | mk/wrapper/test-transform.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mk/wrapper/test-transform.sh b/mk/wrapper/test-transform.sh new file mode 100755 index 00000000000..0e579956ea0 --- /dev/null +++ b/mk/wrapper/test-transform.sh @@ -0,0 +1,41 @@ +#! /bin/sh +# $NetBSD: test-transform.sh,v 1.1 2006/12/09 12:42:43 rillig Exp $ +# +# NAME +# test-transform - Test for a single-argument transformation plug-in +# +# SYNOPSIS +# test-transform.sh transform-file arg... +# +# DESCRIPTION +# test-transform builds up an environment like in the wrapper.sh +# script and feeds the remaining arguments to the transformation +# file. It prints the result of the transformation on stdout, +# suitable for manual checking. +# +# EXAMPLES +# sh test-transform.sh transform-xlc-cc -E -Wall -dynamiclib +# + +set -eu + +wrapperdir=`dirname "$0"` +. "${wrapperdir}/../scripts/shell-lib" +. "${wrapperdir}/wrapper-subr.sh" + +msg_log() { + shift + echo "[msg_log] $*" +} + +debug_log="msg_log" +wrapperlog="stderr" + +transformation_file="$1"; shift + +for arg in "$@"; do + split_arg=no + addtocache=no + . "./$transformation_file" + echo "=> arg=$arg, split_arg=$split_arg, addtocache=$addtocache" +done |