aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@redhat.com>2024-06-17 23:28:20 +0100
committerMaciej W. Rozycki <macro@redhat.com>2024-06-17 23:28:20 +0100
commit4c817355a01dce1909ea4f860741dc2080251603 (patch)
tree92b967f43c26f6effcaa6ce597e88f612976ae15
parent38362a0c634162e22ee3817ac344ac4cfa07f437 (diff)
downloadbinutils-4c817355a01dce1909ea4f860741dc2080251603.zip
binutils-4c817355a01dce1909ea4f860741dc2080251603.tar.gz
binutils-4c817355a01dce1909ea4f860741dc2080251603.tar.bz2
GAS/testsuite: Add a helper for paths outside the source dir
Implement a helper to construct a relative path from $srcdir/$subdir, where `gas_run' operates, to an arbitrary place in the filesystem, for example a file in the test object directory.
-rw-r--r--gas/testsuite/lib/gas-defs.exp13
1 files changed, 13 insertions, 0 deletions
diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp
index 60f2b42..bf08fcb 100644
--- a/gas/testsuite/lib/gas-defs.exp
+++ b/gas/testsuite/lib/gas-defs.exp
@@ -104,6 +104,19 @@ proc gas_host_run { cmd redir } {
return [list [lindex $status 0] "$to_return"]
}
+# gas_srcdir_path FILENAME
+#
+# Return a path to FILENAME relative to the directory we normally get
+# sources from in the current script. For use when the actual source
+# is for example in the test output directory.
+
+proc gas_srcdir_path { filename } {
+ global srcdir
+ global subdir
+
+ return [get_relative_path $srcdir/$subdir $filename]
+}
+
proc gas_run { prog as_opts redir } {
global AS
global ASFLAGS