Commit 82df050e authored by Douglas's avatar Douglas Committed by Ivan Tyagov

wendelin: custom test runner to load our own libstdc++

@Tyagov, please review.

Now the test runners use the LD_PRELOAD environment variable to load
the correct libstdc++ built by slapos and restart themselves.

The restart is necessary because LD_PRELOAD is only taken into account
at the time the process is started. Changing this environment variable
in runtime has no effects.

Tests results are available at Nexedi's ERP5 and are 100% ok: https://nexedi.erp5.net/test_result_module/20160927-3FA05624.

/reviewed-on nexedi/slapos!99
parent 5ff0a4e0
......@@ -12,6 +12,8 @@ parts +=
ipython
wendelin.core
ipython-notebook
wendelin_test_suite_runner
wendelin_testrunner
[eggs]
initialization =
......@@ -24,7 +26,35 @@ eggs +=
${msgpack-python:egg}
${wendelin.core:egg}
${ipython:egg}
[generic_testrunner_init]
initialization =
# The 4 lines below will replace the process with another one, with the proper
# LD_PRELOAD environment variable. This is necessary because LD_PRELOAD is only
# taken into account when the process starts. Modifying it in runtime doesn't
# work.
import struct, os
arch = 8 * struct.calcsize("P")
rerun = not os.getenv('LD_PRELOAD')
if rerun: os.environ['LD_PRELOAD'] = '''${gcc-fortran:location}/lib%s/libstdc++.so''' % arch
if rerun: os.execve(os.path.realpath(__file__), sys.argv, os.environ)
[wendelin_test_suite_runner]
<= test_suite_runner
# we need to override the test suite runner to add our custom libstdc++ dynamic
# library to the path
initialization =
${generic_testrunner_init:initialization}
${test_suite_runner:initialization}
[wendelin_testrunner]
<= testrunner
# we need to override the test suite runner to add our custom libstdc++ dynamic
# library to the path
initialization =
${generic_testrunner_init:initialization}
${testrunner:initialization}
[erp5_repository_list]
repository_id_list += wendelin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment