aboutsummaryrefslogtreecommitdiff
path: root/tests/run_tests.py
diff options
context:
space:
mode:
authorGerald Schaefer <gerald.schaefer@de.ibm.com>2012-11-08 12:46:54 +0100
committerEric B Munson <emunson@mgebm.net>2012-11-08 08:16:11 -0500
commit5be36294eabcb289111686530396424e13e5e057 (patch)
tree21233a5c30c15af54cc87fee9bbd274d11289bae /tests/run_tests.py
parent5c683bbc8578eb140852702494f63401380a3e00 (diff)
downloadlibhugetlbfs-5be36294eabcb289111686530396424e13e5e057.tar.gz
Make custom linker scripts configurable
This patch introduces a CUSTOM_LDSCRIPTS variable in the Makefile as preparation for enabling libhugetlbfs linking on architectures w/o providing (deprecated) custom linker scripts. Setting it to "no" will prevent building and running the test cases requiring custom linker scripts, and issue an error message in ld.hugetlbfs when option --hugetlbfs-link is being used. It is set to "yes" by default for all architectures, which means no change to the current behaviour as far as "make" is concerned. A new option -l is added to run_tests.py, enabling the old-style linking tests. This means that the default for running run_tests.py directly is now changed to skip the old-style linking tests. Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
Diffstat (limited to 'tests/run_tests.py')
-rwxr-xr-xtests/run_tests.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py
index c1564c7..c060699 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -377,6 +377,11 @@ def elflink_test(cmd, **env):
do_test(cmd, **env)
# Test we don't blow up if not linked for hugepage
do_test(cmd, LD_PRELOAD="libhugetlbfs.so", **env)
+
+ # Only run custom ldscript tests when -l option is set
+ if not custom_ldscripts:
+ return
+
do_elflink_test("xB." + cmd, **env)
do_elflink_test("xBDT." + cmd, **env)
# Test we don't blow up if HUGETLB_MINIMAL_COPY is diabled
@@ -578,9 +583,11 @@ def functional_tests():
elflink_test("linkhuge_nofd", HUGETLB_VERBOSE="0")
elflink_test("linkhuge")
- # Original elflink sharing tests
- elfshare_test("linkshare")
- elflink_and_share_test("linkhuge")
+ # Only run custom ldscript tests when -l option is set
+ if custom_ldscripts:
+ # Original elflink sharing tests
+ elfshare_test("linkshare")
+ elflink_and_share_test("linkhuge")
# elflink_rw tests
elflink_rw_test("linkhuge_rw")
@@ -645,15 +652,17 @@ def stress_tests():
def main():
global wordsizes, pagesizes, dangerous, paranoid_pool_check, system_default_hpage_size
+ global custom_ldscripts
testsets = set()
env_override = {"QUIET_TEST": "1", "HUGETLBFS_MOUNTS": "",
"HUGETLB_ELFMAP": None, "HUGETLB_MORECORE": None}
env_defaults = {"HUGETLB_VERBOSE": "0"}
dangerous = 0
paranoid_pool_check = False
+ custom_ldscripts = False
try:
- opts, args = getopt.getopt(sys.argv[1:], "vVfdt:b:p:c")
+ opts, args = getopt.getopt(sys.argv[1:], "vVfdt:b:p:c:l")
except getopt.GetoptError, err:
print str(err)
sys.exit(1)
@@ -673,6 +682,8 @@ def main():
for p in arg.split(): pagesizes.add(int(p))
elif opt == '-c':
paranoid_pool_check = True
+ elif opt == '-l':
+ custom_ldscripts = True
else:
assert False, "unhandled option"
if len(testsets) == 0: testsets = set(["func", "stress"])