summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests/common-test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/tests/common-test.pl')
-rw-r--r--Build/source/texk/web2c/tests/common-test.pl24
1 files changed, 24 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/tests/common-test.pl b/Build/source/texk/web2c/tests/common-test.pl
new file mode 100644
index 00000000000..725ba55b624
--- /dev/null
+++ b/Build/source/texk/web2c/tests/common-test.pl
@@ -0,0 +1,24 @@
+# $Id$
+# Copyright 2010 Karl Berry <tex-live@tug.org>.
+# You may freely use, modify and/or distribute this file.
+# Common definitions for Perl tests in TeX Live.
+
+$ENV{"TEXMFCNF"} = "$srcdir/../kpathsea";
+$ENV{"BIBINPUTS"} = "$srcdir/tests";
+$ENV{"BSTINPUTS"} = "$srcdir/tests";
+$ENV{"TEXINPUTS"} = "$srcdir/tests";
+
+# Run PROG with ARGS. Return the exit status.
+# Die if PROG is not executable.
+#
+sub test_run
+{
+ my ($prog, @args) = @_;
+
+ # Possibly we should check that $prog starts with ./, since we always
+ # want to run out of the build dir. I think.
+ die "$0: no program $prog in " . `pwd` if ! -x $prog;
+
+ my $ret = system ($prog, @args);
+ return $ret;
+}