Commit Graph

234 Commits

Author SHA1 Message Date
Jussi Pakkanen 0744601fda
Merge pull request #3171 from jon-turney/flake8
Fix flake8 issues
2018-03-05 00:03:34 +02:00
Jussi Pakkanen a8da0e25ea Skip test that requires mocking when using an external exe. Also logging. 2018-03-04 19:08:37 +02:00
Jon Turney 8958529a25 Fix flake8 'variable assigned value but unused' reports
$ flake8 | grep -E 'F841'
./run_unittests.py:1987:13: F841 local variable 'objc' is assigned to but never used
./run_unittests.py:1988:13: F841 local variable 'objcpp' is assigned to but never used
./mesonbuild/minit.py:272:5: F841 local variable 'uppercase_token' is assigned to but never used
./mesonbuild/minit.py:307:5: F841 local variable 'uppercase_token' is assigned to but never used
./mesonbuild/modules/unstable_icestorm.py:36:9: F841 local variable 'result' is assigned to but never used
./mesonbuild/modules/unstable_icestorm.py:78:9: F841 local variable 'up_target' is assigned to but never used
./mesonbuild/modules/unstable_icestorm.py:81:9: F841 local variable 'time_target' is assigned to but never used
./msi/createmsi.py:226:17: F841 local variable 'file_source' is assigned to but never used
2018-03-03 21:36:37 +00:00
Jon Turney 2f6ed47077 Fix various flake8 indentation reports
$ flake8 | grep -E '(E123|E127|E128)'
./run_unittests.py:1358:37: E127 continuation line over-indented for visual indent
./run_unittests.py:1360:37: E127 continuation line over-indented for visual indent
./mesonbuild/minit.py:311:66: E128 continuation line under-indented for visual indent
./mesonbuild/minit.py:312:66: E128 continuation line under-indented for visual indent
./mesonbuild/minit.py:313:66: E128 continuation line under-indented for visual indent
./mesonbuild/compilers/cpp.py:115:63: E127 continuation line over-indented for visual indent
./msi/createmsi.py:156:13: E123 closing bracket does not match indentation of opening bracket's line
./msi/createmsi.py:188:13: E123 closing bracket does not match indentation of opening bracket's line
2018-03-03 21:35:53 +00:00
Jon Turney b8b23f4c50 Fix various flake8 whitespace reports
$ flake8 | grep -E '(E203|E221|E226|E303|W291|W293)'
./run_unittests.py:1503:5: E303 too many blank lines (2)
./mesonbuild/interpreter.py:2342:64: E226 missing whitespace around arithmetic operator
./mesonbuild/minit.py:110:17: E221 multiple spaces before operator
./mesonbuild/minit.py:131:1: W293 blank line contains whitespace
./mesonbuild/minit.py:135:19: E221 multiple spaces before operator
./mesonbuild/minit.py:155:1: W293 blank line contains whitespace
./mesonbuild/minit.py:181:1: W293 blank line contains whitespace
./mesonbuild/minit.py:183:1: W293 blank line contains whitespace
./mesonbuild/minit.py:294:47: W291 trailing whitespace
./mesonbuild/minit.py:331:47: W291 trailing whitespace
./mesonbuild/modules/unstable_icestorm.py:49:1: W293 blank line contains whitespace
./mesonbuild/modules/unstable_icestorm.py:76:31: E203 whitespace before ':'
./mesonbuild/modules/unstable_icestorm.py:82:22: E203 whitespace before ':'
2018-03-03 21:06:45 +00:00
Jon Turney cd5dba5358 Fix flake8 'imported but unused' reports
$ flake8 | grep F401
./meson.py:17:1: F401 'mesonbuild.mesonlib' imported but unused
./meson.py:18:1: F401 'locale' imported but unused
./run_unittests.py:24:1: F401 'sys' imported but unused
./mesonbuild/minit.py:2:1: F401 'pyclbr.Function' imported but unused
./mesonbuild/minit.py:18:1: F401 'os' imported but unused
./mesonbuild/backend/vs2010backend.py:15:1: F401 'sys' imported but unused
./mesonbuild/backend/xcodebackend.py:19:1: F401 'sys' imported but unused
./mesonbuild/dependencies/ui.py:20:1: F401 'shutil' imported but unused
./mesonbuild/modules/python3.py:15:1: F401 'sys' imported but unused
./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..compilers' imported but unused
./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..mlog' imported but unused
./test cases/common/98 gen extra/srcgen3.py:3:1: F401 'os' imported but unused
2018-03-03 21:06:45 +00:00
Hemmo Nieminen 473dc80701 Add some test setup selection tests. 2018-02-25 21:44:59 +02:00
Jon Turney cf98f5e370 Enable searching system crossfile locations on more platforms
There's no reason not to also look in these places on Cygwin or OSX.  Don't
do this on Windows, as these paths aren't meaningful there.

Move test_cross_file_system_paths from LinuxlikeTests to AllPlatformTests.
2018-02-21 23:58:14 +02:00
Nirbheek Chauhan 8842839bb4 pkgconfig deps: Warn when a static library isn't found
A hard error makes this feature useless in most cases since a static
library usually won't be found for every library, particularly system
libraries like -lm. Instead, warn so the user can provide the static
library if they wish.

This feature will be expanded and made more extensible and more usable
in the future.

Closes https://github.com/mesonbuild/meson/issues/2785
2018-02-20 19:26:51 +02:00
Nirbheek Chauhan 0c1c387703 gnome: Fix depend_files listing for compile_resources
Also add a unit test that will test all codepaths for old Glib tools
versions.

Closes https://github.com/mesonbuild/meson/issues/2860
2018-02-20 19:26:16 +02:00
Nirbheek Chauhan b2007217e0 vala: Fix path of C file with generated Vala files
We missed one particular edge-case in #2413: when the generated vala
file is inside --basedir, the path is not just the basename.c

Since this case can never happen in a project test, this includes a unit
test for the same.

Closes https://github.com/mesonbuild/meson/issues/815
2018-02-20 00:19:11 +02:00
Jon Turney 9e6d3f903c Only expose exception() test function during unit tests 2018-02-15 12:51:25 +00:00
Jon Turney b78a01bced Add a test case for python exception exit status 2018-02-15 12:51:25 +00:00
Jon Turney 6a1a56ab57 Report warning/error locations in a format IDEs may already know how to parse
Examples:

meson.build:2:0: ERROR: Dependency is both required and not-found
meson.build:4: WARNING: Keyword argument "link_with" defined multiple times.

These are already matched by the default compilation-error-regexp-alist in
emacs.

Also:
Don't start 'red' markup until after the \n before an error
Unabsorb full-stop at end of warning with location from mlog.warning()
Update warning_location test
2018-01-30 06:48:22 +11:00
Xavier Claessens 6e2e94c645 pkgconfig: Also ignore not found deps passed directly to pc generator
Currently only not found deps implicitly pulled from a Library object
are ignored. We should also ignore not found deps passed directly to
generate() method.

This makes the unit testing more complicated because libfoo pkgconfig
dependency cannot be found when generated from the within the same
meson.build.
2018-01-19 13:45:14 -05:00
Xavier Claessens ec37f625c7 run_unittests.py: Support building multiple projects in a single test 2018-01-19 11:48:27 -05:00
Jussi Pakkanen 5e4538fe63 Add external dependencies to pc files only if found. Closes #2911. 2018-01-19 15:49:49 +02:00
Jussi Pakkanen 714ac85d22 Renamed test dir to avoid duplicated numbers. 2018-01-19 15:49:49 +02:00
Dylan Baker 4620bdd8b4 tests: fix rpath_uses_ORIGIN on dragonflybsd
Which always seems to prepend /usr/lib/gcc50 (or whatever version) to
the rpath, and $ORIGIN after that.
2018-01-06 13:49:34 -08:00
Jussi Pakkanen 0538009d30 Bump minimum supported Python from 3.4 to 3.5. 2018-01-04 21:29:02 +02:00
Jussi Pakkanen 65f78a722a
Merge pull request #2856 from jon-turney/warning-location
Consolidate warning location formatting
2018-01-03 22:32:40 +02:00
Jussi Pakkanen ad54bc3726
Merge pull request #2838 from mesonbuild/nirbheek/consolidate-subproject-dep-checking
intrp: Consolidate subproject dep checking and logging
2018-01-02 20:35:19 +02:00
Jon Turney bcc95d7dd7 Use location formatting in mlog.warning() for invalid kwarg warning
This already reports the location (in a slightly different format), but
using mlog.warning() will make it easier if we want to change the location
format in future.
2018-01-01 13:21:01 +00:00
Jon Turney f85fde743a Wire up locations in a couple more warnings
These are the remaining warnings in the parser, where we have the location
to hand.
2018-01-01 13:21:00 +00:00
Jussi Pakkanen d4985d981f Merged init branch. 2018-01-01 02:12:13 +02:00
Jussi Pakkanen f2b33b8dcb
Merge pull request #2852 from jon-turney/warning-location
Add filename and lineno to duplicate kwargs warning
2018-01-01 02:09:45 +02:00
Jussi Pakkanen 4a189cf8c5 Add unit test that checks that the sample projects compile. 2017-12-31 23:24:29 +02:00
Nirbheek Chauhan 851475db9b intrp: Consolidate subproject dep checking and logging
If a dep is not found on the system and a fallback is specified, we
have two cases:

1. Look for the dependency in a pre-initialized subproject
2. Initialize the subproject and look for the dependency

Both these require version comparing, ensuring the fetched variable
is a dependency, and printing a success message, erroring out, etc.

Now we share the relevant code instead of duplicating it. It already
diverged, so this is a good thing.

As a side-effect, we now log fallback dependencies in the same format
as system dependencies:

    Dependency libva found: YES
    Dependency libva found: YES (cached)

    Dependency glib-2.0 from subproject subprojects/glib found: YES
    Dependency glib-2.0 from subproject subprojects/glib found: YES (cached)
2018-01-01 01:14:03 +05:30
Jussi Pakkanen dd3f49af0d
Merge pull request #2757 from xclaesse/pkgconfig
pkgconfig: Allow passing Dependency objects to library(_private)
2017-12-31 19:11:57 +02:00
Jon Turney ad5cc2ce55 Append warning location to warning output by warning() 2017-12-30 20:10:15 +00:00
Jon Turney dd1de073f4 Add a test case for location in duplicate kwarg warning 2017-12-30 20:08:35 +00:00
Nirbheek Chauhan ae0f4ef055 compilers: Fix error when objc/objc++ compilers are not found
Earlier it would exit with a traceback:

UnboundLocalError: local variable 'out' referenced before assignment
2017-12-30 18:02:28 +02:00
Jussi Pakkanen ac8d6087bf
Merge pull request #2334 from mesonbuild/promotedep
Add functionality to promote nested dependencies to top level.
2017-12-26 13:24:30 +02:00
Jussi Pakkanen 1806aac376
Merge pull request #2817 from jon-turney/master
Update prefix-dependent defaults when project(default_options:) changes prefix
2017-12-26 13:22:03 +02:00
Nirbheek Chauhan 55abe16d5a unit tests: Test that relative install_rpath works correctly
We weren't testing this with C++, so the breakage was missed.

https://github.com/mesonbuild/meson/issues/2814
2017-12-26 03:23:26 +05:30
Jon Turney 198251395a Add a test of prefix-dependent defaults for project(default_options:)
See #2811
2017-12-21 19:10:18 +00:00
Xavier Claessens 2881db7379 pkgconfig: Move pc file checks to run_unittests.py 2017-12-20 19:09:08 -05:00
Dylan Baker e245e57865 Warn on unknown command line arguments
I have a tendency to typo things. Humans in general are bad at spotting
spelling mistakes, computers are not. This patches prints the bad
options and provides the generic meson "This will be a hard error
someday" message.
2017-12-19 10:10:40 -08:00
Jussi Pakkanen 164fb9a150 Also promote wrap files. 2017-12-17 21:19:22 +02:00
Jussi Pakkanen 46c071ea5c Add functionality to promote nested dependencies to top level. 2017-12-17 21:17:13 +02:00
Dylan Baker 7cd41ee8fb Use consistent mlog formatting with the ConfigTool dependency helpers
This just adds more consistent use of mlog.bold and mlog.red/green for
ConfigTool based dependencies.
2017-12-15 14:20:16 -08:00
Nirbheek Chauhan 2c4e7ebb9b dependencies: Don't use NotImplementedError for invalid methods
Using NotImplementedError throws an ugly traceback to the user which
does not print the line number and other information making it
impossible to figure out what's causing it.

Also override it for internal dependencies because self.name is "null"
for them.
2017-12-09 22:05:05 +02:00
Eric Engestrom 3d63f21b60 Fix `array` type name
c9351ce30c introduced the type as `array`,
so mintro should expose it under the same name.

(while at it, rename test 169 to be coherent)
2017-12-07 21:31:50 +02:00
Jussi Pakkanen c2d23dd678 Add C++17 flags to GCC and Clang. 2017-12-06 23:59:56 +02:00
Jussi Pakkanen de99b9d5b9 Silence git stdout messages. 2017-12-06 16:14:51 +02:00
Jussi Pakkanen 018deb48fe
Merge pull request #2663 from inigomartinez/pkg-config-define-variable
dependencies: Allow pkg-config to define variables
2017-12-03 22:53:44 +02:00
Jussi Pakkanen cf76ffad14
Merge pull request #2703 from mesonbuild/msvc-library-search-fixes
Various MSVC library search fixes
2017-12-03 22:48:56 +02:00
Jussi Pakkanen 2cf1e8da15 Merged array option branch. 2017-12-03 22:35:44 +02:00
Jussi Pakkanen f8a419b27d String arguments can permit arbitrary string values
by leaving out the choices keyword.
2017-12-03 22:27:55 +02:00
Nirbheek Chauhan bccb7a8eb8 unit tests: Skip coverage properly with clang 2017-12-03 20:20:31 +05:30