path: root/tests/run_tests.py
diff options
authorDavid Gibson <dwg@au1.ibm.com>2009-08-24 15:27:46 +1000
committerEric B Munson <ebmunson@us.ibm.com>2009-08-24 13:56:05 +0100
commita4b3004e3de458321387fc39448ee6512e791a98 (patch)
tree4f8ff6dc41b93f46c2f6be1e72550e3a27a3d046 /tests/run_tests.py
parent637db55c57379f6e4c69d320ca16f9b05c873e3f (diff)
Make tests for SPECIAL in linker scripts safe against cross-compiles
Currently, run_tests.py invokes gcc to obtain the standard linker script, in order to tell if the old-style linker-script based relink testcases can work. But this a) assumes that a compiler and linker is available and b) assumes that it has the same linker script as when the testsuite was compiled. If the testsuite is compiled on one machine, then copied to another for execution, either of these could be false. This is a useful common case if the machine we're testing on is highly constrained (e.g. an embedded machine, or a simulator). What we really want is the linker script of the toolchain which was used to build the testsuite. Therefore this patch removes the test-time invocation of gcc. Instead, gcc is invoked to dump the linker script to a file when the testsuite is built, then run_tests.py reads this file back in and checks it for the appropriate linker magic. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
Diffstat (limited to 'tests/run_tests.py')
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py
index a7d750b..ac87703 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -253,13 +253,13 @@ def check_linkhuge_tests():
which word sizes can be tested with linkhuge. The others will be skipped.
NOTE: The linhuge_rw tests are always safe to run and will not be skipped.
- okbits = []
+ okbits = set()
for bits in wordsizes:
- cmd = "gcc -m%i -Wl,--verbose 2> /dev/null | grep -q SPECIAL" % bits
- (rc, out) = bash(cmd)
- if rc != 0: okbits.append(bits)
- return set(okbits)
+ script = open('obj%d/dummy.ldscript' % bits, 'r').read()
+ if script.count('SPECIAL') == 0:
+ okbits.add(bits)
+ return okbits
def print_cmd(pagesize, bits, cmd, env):
if env: