Finalize moduleification so that full test suite runs.

pull/356/head
Jussi Pakkanen 9 years ago
parent 66c01401de
commit 4c31e7774d
  1. 12
      meson/interpreter.py
  2. 7
      meson/mesonmain.py
  3. 13
      meson/ninjabackend.py
  4. 2
      meson/scripts/meson_install.py
  5. 4
      run_cross_test.py
  6. 8
      run_tests.py

@ -1610,9 +1610,17 @@ class Interpreter():
regex_selector = vcs['rev_regex']
else:
vcs_cmd = [' '] # executing this cmd will fail in vcstagger.py and force to use the fallback string
scriptfile = os.path.join(self.environment.get_script_dir(), 'vcstagger.py')
# vcstagger.py parameters: infile, outfile, fallback, source_dir, replace_string, regex_selector, command...
kwargs['command'] = [sys.executable, scriptfile, '@INPUT0@', '@OUTPUT0@', fallback, source_dir, replace_string, regex_selector] + vcs_cmd
kwargs['command'] = [sys.executable,
self.environment.get_build_command(),
'--internal',
'vcstagger',
'@INPUT0@',
'@OUTPUT0@',
fallback,
source_dir,
replace_string,
regex_selector] + vcs_cmd
kwargs.setdefault('build_always', True)
return self.func_custom_target(node, [kwargs['output']], kwargs)

@ -172,12 +172,18 @@ def run_script_command(args):
elif cmdname == 'benchmark':
import meson.scripts.meson_benchmark as abc
cmdfunc = abc.run
elif cmdname == 'install':
import meson.scripts.meson_install as abc
cmdfunc = abc.run
elif cmdname == 'commandrunner':
import meson.scripts.commandrunner as abc
cmdfunc = abc.run
elif cmdname == 'delsuffix':
import meson.scripts.delwithsuffix as abc
cmdfunc = abc.run
elif cmdname == 'depfixer':
import meson.scripts.depfixer as abc
cmdfunc = abc.run
elif cmdname == 'dirchanger':
import meson.scripts.dirchanger as abc
cmdfunc = abc.run
@ -210,7 +216,6 @@ def run(mainfile, args):
handshake = True
else:
handshake = False
print(args)
args = mesonlib.expand_arguments(args)
if not args:
return 1

@ -457,14 +457,14 @@ int dummy;
script_root = self.environment.get_script_dir()
install_script = os.path.join(script_root, 'meson_install.py')
install_data_file = os.path.join(self.environment.get_scratch_dir(), 'install.dat')
depfixer = os.path.join(script_root, 'depfixer.py')
depfixer = [sys.executable, self.environment.get_build_command(), '--internal', 'depfixer']
d = InstallData(self.environment.get_source_dir(),
self.environment.get_build_dir(),
self.environment.get_prefix(), depfixer)
elem = NinjaBuildElement('install', 'CUSTOM_COMMAND', 'PHONY')
elem.add_dep('all')
elem.add_item('DESC', 'Installing files.')
elem.add_item('COMMAND', [sys.executable, install_script, install_data_file])
elem.add_item('COMMAND', [sys.executable, self.environment.get_build_command(), '--internal', 'install', install_data_file])
elem.add_item('pool', 'console')
self.generate_depmf_install(d)
self.generate_target_install(d)
@ -1094,9 +1094,12 @@ int dummy;
scriptdir = self.environment.get_script_dir()
outfile.write('\n')
symrule = 'rule SHSYM\n'
symcmd = ' command = "%s" "%s" %s %s $CROSS\n' % (ninja_quote(sys.executable),
ninja_quote(os.path.join(scriptdir, 'symbolextractor.py')),
'$in', '$out')
symcmd = ' command = "%s" "%s" %s %s %s %s $CROSS\n' % (ninja_quote(sys.executable),
self.environment.get_build_command(),
'--internal',
'symbolextractor',
'$in',
'$out')
synstat = ' restat = 1\n'
syndesc = ' description = Generating symbol file $out.\n'
outfile.write(symrule)

@ -193,7 +193,7 @@ def install_targets(d):
print("Symlink creation does not work on this platform.")
printed_symlink_error = True
if is_elf_platform():
p = subprocess.Popen([d.depfixer, outname, install_rpath],
p = subprocess.Popen(d.depfixer + [outname, install_rpath],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdo, stde) = p.communicate()

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright 2013-2014 The Meson development team
# Copyright 2013-2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -23,7 +23,7 @@ Not part of the main test suite because of two reasons:
Eventually migrate to something fancier.'''
import os, subprocess, shutil, sys
import environment
import meson.environment as environment
from run_tests import gather_tests

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright 2012-2015 The Meson development team
# Copyright 2012-2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ from meson import environment
from meson import mesonlib
from meson import mlog
from meson import mesonmain
from scripts import meson_test, meson_benchmark
from meson.scripts import meson_test, meson_benchmark
import argparse
import xml.etree.ElementTree as ET
import time
@ -45,7 +45,7 @@ print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ
test_build_dir = 'work area'
install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir')
meson_command = './meson.py'
meson_command = os.path.join(os.getcwd(), 'meson.py')
class StopException(Exception):
def __init__(self):
@ -155,7 +155,7 @@ def run_configure_inprocess(commandlist):
old_stderr = sys.stderr
sys.stderr = mystderr = StringIO()
try:
returncode = mesonmain.run(commandlist)
returncode = mesonmain.run(commandlist[0], commandlist[1:])
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr

Loading…
Cancel
Save