aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/ninjabackend.py3
-rw-r--r--mesonbuild/compilers.py4
-rw-r--r--mesonbuild/modules/gnome.py15
-rwxr-xr-xrun_tests.py21
-rw-r--r--test cases/common/12 data/installed_files.txt1
-rw-r--r--test cases/common/12 data/meson.build3
-rw-r--r--test cases/common/12 data/vanishing/vanishing2.dat4
7 files changed, 37 insertions, 14 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index d53730a..201b2d1 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -547,12 +547,13 @@ int dummy;
assert(isinstance(de, build.Data))
subdir = de.install_dir
for f in de.sources:
+ plain_f = os.path.split(f)[1]
if de.in_sourcetree:
srcprefix = self.environment.get_source_dir()
else:
srcprefix = self.environment.get_build_dir()
srcabs = os.path.join(srcprefix, de.source_subdir, f)
- dstabs = os.path.join(subdir, f)
+ dstabs = os.path.join(subdir, plain_f)
i = [srcabs, dstabs]
d.data.append(i)
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 9e90bcc..0535653 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -55,7 +55,9 @@ def is_library(fname):
return suffix in lib_suffixes
gnulike_buildtype_args = {'plain' : [],
- 'debug' : ['-g'],
+ # -O0 is passed for improved debugging information with gcc
+ # See https://github.com/mesonbuild/meson/pull/509
+ 'debug' : ['-O0', '-g'],
'debugoptimized' : ['-O2', '-g'],
'release' : ['-O3']}
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index f0de363..39a6ff7 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -23,10 +23,21 @@ from .. import mlog
from .. import mesonlib
girwarning_printed = False
+gresource_warning_printed = False
class GnomeModule:
+ def __print_gresources_warning(self):
+ global gresource_warning_printed
+ if not gresource_warning_printed:
+ mlog.log('Warning, glib compiled dependencies will not work reliably until this upstream issue is fixed:',
+ mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=745754'))
+ gresource_warning_printed = True
+ return []
+
def compile_resources(self, state, args, kwargs):
+ self.__print_gresources_warning()
+
cmd = ['glib-compile-resources', '@INPUT@']
source_dirs = kwargs.pop('source_dir', [])
@@ -59,6 +70,8 @@ class GnomeModule:
return [target_c, target_h]
def get_gresource_dependencies(self, state, input_file, source_dirs):
+ self.__print_gresources_warning()
+
cmd = ['glib-compile-resources',
input_file,
'--generate-dependencies']
@@ -314,8 +327,6 @@ class GnomeModule:
return build.CustomTarget(namebase + '-gdbus', state.subdir, custom_kwargs)
def initialize():
- mlog.log('Warning, glib compiled dependencies will not work reliably until this upstream issue is fixed:',
- mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=745754'))
return GnomeModule()
class GirTarget(build.CustomTarget):
diff --git a/run_tests.py b/run_tests.py
index 556a0a5..ad2450e 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -156,14 +156,8 @@ def validate_install(srcdir, installdir):
return 'Found extra file %s.' % fname
return ''
-def log_text_file(logfile, testdir, msg, stdo, stde):
- global passing_tests, failing_tests, stop
- if msg != '':
- print('Fail:', msg)
- failing_tests += 1
- else:
- print('Success')
- passing_tests += 1
+def log_text_file(logfile, testdir, stdo, stde):
+ global stop
logfile.write('%s\nstdout\n\n---\n' % testdir)
logfile.write(stdo)
logfile.write('\n\n---\n\nstderr\n\n---\n')
@@ -306,6 +300,7 @@ def detect_tests_to_run():
return all_tests
def run_tests(extra_args):
+ global passing_tests, failing_tests, stop
all_tests = detect_tests_to_run()
logfile = open('meson-test-run.txt', 'w', encoding="utf_8")
junit_root = ET.Element('testsuites')
@@ -340,12 +335,18 @@ def run_tests(extra_args):
skipped_tests += 1
else:
without_install = "" if len(install_commands) > 0 else " (without install)"
- print('Running test%s: %s' % (without_install, t))
+ if result.msg != '':
+ print('Failed test%s: %s' % (without_install, t))
+ print('Reason:', result.msg)
+ failing_tests += 1
+ else:
+ print('Succeeded test%s: %s' % (without_install, t))
+ passing_tests += 1
conf_time += result.conftime
build_time += result.buildtime
test_time += result.testtime
total_time = conf_time + build_time + test_time
- log_text_file(logfile, t, result.msg, result.stdo, result.stde)
+ log_text_file(logfile, t, result.stdo, result.stde)
current_test = ET.SubElement(current_suite, 'testcase', {'name' : testname,
'classname' : name,
'time' : '%.3f' % total_time})
diff --git a/test cases/common/12 data/installed_files.txt b/test cases/common/12 data/installed_files.txt
index 1c58623..3d4b12c 100644
--- a/test cases/common/12 data/installed_files.txt
+++ b/test cases/common/12 data/installed_files.txt
@@ -1,3 +1,4 @@
usr/share/progname/datafile.dat
usr/share/progname/vanishing.dat
+usr/share/progname/vanishing2.dat
etc/etcfile.dat
diff --git a/test cases/common/12 data/meson.build b/test cases/common/12 data/meson.build
index 2193f94..80f3835 100644
--- a/test cases/common/12 data/meson.build
+++ b/test cases/common/12 data/meson.build
@@ -1,4 +1,7 @@
project('data install test', 'c')
install_data(sources : 'datafile.dat', install_dir : 'share/progname')
install_data(sources : 'etcfile.dat', install_dir : '/etc')
+
subdir('vanishing')
+
+install_data(sources : 'vanishing/vanishing2.dat', install_dir : 'share/progname')
diff --git a/test cases/common/12 data/vanishing/vanishing2.dat b/test cases/common/12 data/vanishing/vanishing2.dat
new file mode 100644
index 0000000..99c923b
--- /dev/null
+++ b/test cases/common/12 data/vanishing/vanishing2.dat
@@ -0,0 +1,4 @@
+This is a data file to be installed in a subdirectory.
+
+It is installed from a different subdir to test that the
+installer strips the source tree dir prefix.