11 from __future__
import print_function
13 from TestBuildMTTStage
import *
33 TestBuildMTTStage.__init__(self)
35 self.
options[
'middleware'] = (
None,
"Middleware stage that these tests are to be built against")
36 self.
options[
'build_in_place'] = (
True,
"Build tests in current location (no prefix or install)")
37 self.
options[
'merge_stdout_stderr'] = (
False,
"Merge stdout and stderr into one output stream")
38 self.
options[
'stdout_save_lines'] = (
None,
"Number of lines of stdout to save")
39 self.
options[
'stderr_save_lines'] = (
None,
"Number of lines of stderr to save")
40 self.
options[
'autogen_cmd'] = (
None,
"Command to be executed to setup the configure script, usually called autogen.sh or autogen.pl")
41 self.
options[
'configure_options'] = (
None,
"Options to be passed to configure. Note that the prefix will be automatically set and need not be provided here")
42 self.
options[
'make_options'] = (
None,
"Options to be passed to the make command")
46 IPlugin.activate(self)
51 IPlugin.deactivate(self)
55 return "DefaultTestBuild"
58 lines = testDef.printOptions(self.
options)
64 testDef.logger.verbose_print(
"DefaultTestBuild")
67 testDef.parseOptions(log, self.
options, keyvals, cmds)
70 cmds[
'section'] = keyvals[
'section']
79 if cmds[
'middleware']
is not None:
81 log[
'middleware'] = cmds[
'middleware']
83 midlog = testDef.logger.getLog(cmds[
'middleware'])
84 if midlog
is not None:
87 if midlog[
'location']
is not None:
90 oldbinpath = os.environ[
'PATH']
91 pieces = oldbinpath.split(
':')
95 bindir = os.path.join(midlog[
'location'],
"bin")
96 pieces.insert(0, bindir)
97 newpath =
":".join(pieces)
98 os.environ[
'PATH'] = newpath
101 oldldlibpath = os.environ[
'LD_LIBRARY_PATH']
102 pieces = oldldlibpath.split(
':')
106 bindir = os.path.join(midlog[
'location'],
"lib")
107 pieces.insert(0, bindir)
108 newpath =
":".join(pieces)
109 os.environ[
'LD_LIBRARY_PATH'] = newpath
116 if midlog[
'parameters']
is not None:
117 for md
in midlog[
'parameters']:
118 if "modules" == md[0]:
120 if cmds[
'modules']
is not None:
122 mods = md[1].split(
',')
123 newmods = modules.split(
',')
126 cmds[
'modules'] =
','.join(mods)
128 cmds[
'modules'] = md[1]
136 for pluginInfo
in testDef.tools.getPluginsOfCategory(
"Build"):
137 if "Autotools" == pluginInfo.plugin_object.print_name():
138 plugin = pluginInfo.plugin_object
142 log[
'stderr'] =
"Autotools plugin not found"
144 plugin.execute(log, cmds, testDef)
147 os.environ[
'PATH'] = oldbinpath
148 os.environ[
'LD_LIBRARY_PATH'] = oldldlibpath