summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2010-02-20 11:23:17 -0800
committerDan Nicholson <dbn.lists@gmail.com>2010-02-20 11:23:17 -0800
commitf7ea1a704c9d2f5ff382b22b9590577e485beda8 (patch)
tree0ab3b11bcae2a2ce7bce8c8997cec51997c04bda
parent1925e39e749a31fe14ffb97fae85936fc04de941 (diff)
xts5: Use package version in xts utilities
Use the package version for reporting the version of xts-run and xts-report.
-rw-r--r--xts5/Makefile.am3
-rw-r--r--xts5/bin/xts-run.in6
-rw-r--r--xts5/src/bin/reports/xts-report.c8
3 files changed, 15 insertions, 2 deletions
diff --git a/xts5/Makefile.am b/xts5/Makefile.am
index 8c6af478..5aaf01a9 100644
--- a/xts5/Makefile.am
+++ b/xts5/Makefile.am
@@ -19,7 +19,8 @@ dist_xts5doc_DATA = doc/release_notes doc/VSW_RELEASE doc/VSW_SPEC
# Script substitutions
EDIT = $(SED) -e 's,%bindir%,$(bindir),g' \
-e 's,%libexecdir%,$(libexecdir),g' \
- -e 's,%DEFAULT_TET_ROOT%,$(DEFAULT_TET_ROOT),g'
+ -e 's,%DEFAULT_TET_ROOT%,$(DEFAULT_TET_ROOT),g' \
+ -e 's,%PACKAGE_VERSION%,$(PACKAGE_VERSION),g'
bin/xts-config: bin/xts-config.in
$(AM_V_GEN)$(EDIT) < $< > $@
bin/xts-run: bin/xts-run.in
diff --git a/xts5/bin/xts-run.in b/xts5/bin/xts-run.in
index 53730ddf..93d3eb05 100644
--- a/xts5/bin/xts-run.in
+++ b/xts5/bin/xts-run.in
@@ -2,6 +2,7 @@
bindir="%bindir%"
DEFAULT_TET_ROOT="%DEFAULT_TET_ROOT%"
+PACKAGE_VERSION="%PACKAGE_VERSION%"
TCC="${TCC-${bindir}/tcc}"
PERL=${PERL-perl}
@@ -22,6 +23,7 @@ Execute the XTS tests in SCENARIO (all by default).
-c, --config CONFIG use the tet config file CONFIG
-h, --help display this help text and exit
-o, --output DIRECTORY write log files to DIRECTORY
+ -V, --version display the version and exit
EOF
}
@@ -39,6 +41,10 @@ while [ -n "$1" ]; do
help
exit 0
;;
+ -V|--version)
+ echo $PACKAGE_VERSION
+ exit 0
+ ;;
-*)
echo "error: unrecognized option \"$1\"" >&2
echo "See \"$prog --help\" for more information" >&2
diff --git a/xts5/src/bin/reports/xts-report.c b/xts5/src/bin/reports/xts-report.c
index 385b5ce9..49a831e1 100644
--- a/xts5/src/bin/reports/xts-report.c
+++ b/xts5/src/bin/reports/xts-report.c
@@ -291,6 +291,11 @@ char *tet_root;
#define DEFAULT_TET_ROOT "."
#endif
+/* version */
+#ifndef PACKAGE_VERSION
+#define PACKAGE_VERSION ""
+#endif
+
static void whatj(void)
{
int jfileno = 0;
@@ -1828,7 +1833,8 @@ int main(int argc, char * const argv[])
fuser++;
break;
case 'v':
- fprintf(stderr, "%s Report Generator V%s\n", test_name, verbuf);
+ fprintf(stderr, "%s Report Generator %s\n",
+ test_name, PACKAGE_VERSION);
exit(0);
case ':':
fprintf(stderr, "Option -%c requires an operand\n", optopt);