Better sanity testing.

pull/240/head
Jussi Pakkanen 10 years ago
parent 199c57d8d6
commit bd5b4deeda
  1. 6
      compilers.py
  2. 1
      interpreter.py
  3. 2
      meson.py

@ -223,6 +223,9 @@ class CCompiler():
return os.path.split(header_name)[-1] + '.' + self.get_pch_suffix() return os.path.split(header_name)[-1] + '.' + self.get_pch_suffix()
def sanity_check(self, work_dir): def sanity_check(self, work_dir):
mlog.debug('Sanity testing C compiler:', ' '.join(self.exelist))
mlog.debug('Is cross compiler: %s.' % str(self.is_cross))
source_name = os.path.join(work_dir, 'sanitycheckc.c') source_name = os.path.join(work_dir, 'sanitycheckc.c')
binary_name = os.path.join(work_dir, 'sanitycheckc') binary_name = os.path.join(work_dir, 'sanitycheckc')
ofile = open(source_name, 'w') ofile = open(source_name, 'w')
@ -239,8 +242,7 @@ class CCompiler():
cmdlist = self.exe_wrapper + [binary_name] cmdlist = self.exe_wrapper + [binary_name]
else: else:
cmdlist = [binary_name] cmdlist = [binary_name]
mlog.debug('Running C test binary, cross is %s.' % str(self.is_cross)) mlog.debug('Running test binary command: ' + ' '.join(cmdlist))
mlog.debug('Command: ' + ' '.join(cmdlist))
pe = subprocess.Popen(cmdlist) pe = subprocess.Popen(cmdlist)
pe.wait() pe.wait()
if pe.returncode != 0: if pe.returncode != 0:

@ -1315,6 +1315,7 @@ class Interpreter():
comp.sanity_check(self.environment.get_scratch_dir()) comp.sanity_check(self.environment.get_scratch_dir())
self.coredata.compilers[lang] = comp self.coredata.compilers[lang] = comp
if cross_comp is not None: if cross_comp is not None:
cross_comp.sanity_check(self.environment.get_scratch_dir())
self.coredata.cross_compilers[lang] = cross_comp self.coredata.cross_compilers[lang] = cross_comp
mlog.log('Native %s compiler: ' % lang, mlog.bold(' '.join(comp.get_exelist())), ' (%s %s)' % (comp.id, comp.version), sep='') mlog.log('Native %s compiler: ' % lang, mlog.bold(' '.join(comp.get_exelist())), ' (%s %s)' % (comp.id, comp.version), sep='')
if not comp.get_language() in self.coredata.external_args: if not comp.get_language() in self.coredata.external_args:

@ -15,6 +15,7 @@
# limitations under the License. # limitations under the License.
import sys, stat, traceback, pickle, argparse import sys, stat, traceback, pickle, argparse
import datetime
import os.path import os.path
import environment, interpreter, mesonlib import environment, interpreter, mesonlib
import build import build
@ -116,6 +117,7 @@ itself as required.'''
def generate(self): def generate(self):
env = environment.Environment(self.source_dir, self.build_dir, self.meson_script_file, self.options) env = environment.Environment(self.source_dir, self.build_dir, self.meson_script_file, self.options)
mlog.initialize(env.get_log_dir()) mlog.initialize(env.get_log_dir())
mlog.debug('Build started at', datetime.datetime.now().isoformat())
mlog.log(mlog.bold('The Meson build system')) mlog.log(mlog.bold('The Meson build system'))
mlog.log('Version:', coredata.version) mlog.log('Version:', coredata.version)
mlog.log('Source dir:', mlog.bold(self.source_dir)) mlog.log('Source dir:', mlog.bold(self.source_dir))

Loading…
Cancel
Save