summaryrefslogtreecommitdiff
path: root/run_unittests.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | wrap: Implement special wrap modes for use by packagersNirbheek Chauhan2017-03-251-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Special wrap modes: nofallback: Don't download wraps for dependency() fallbacks nodownload: Don't download wraps for all subproject() calls Subprojects are used for two purposes: 1. To download and build dependencies by using .wrap files if they are not provided by the system. This is usually expressed via dependency(..., fallback: ...). 2. To download and build 'copylibs' which are meant to be used by copying into your project. This is always done with an explicit subproject() call. --wrap-mode=nofallback will never do (1) --wrap-mode=nodownload will do neither (1) nor (2) If you are building from a release tarball, you should be able to safely use 'nodownload' since upstream is expected to ship all required sources with the tarball. If you are building from a git repository, you will want to use 'nofallback' so that any 'copylib' wraps will be download as subprojects. Note that these options do not affect subprojects that are git submodules since those are only usable in git repositories, and you almost always want to download them.
* unittests: Print output for failing commandsNirbheek Chauhan2017-03-131-9/+28
| | | | | | | Because we are using check_output, if the command fails no output will be printed at all. So, we use subprocess.run instead. Also, on configure failures, print the meson-log.txt instead of stdout.
* Have all compiler invocations in compdb. Closes #1439.Jussi Pakkanen2017-03-041-0/+2
|
* unit tests: Don't try to test objc/c++ on WindowsNirbheek Chauhan2017-02-211-1/+3
| | | | MSVC compiler doesn't support it obviously.
* Support passing of options to compilers and linkersNirbheek Chauhan2017-02-211-4/+4
| | | | | | | | If you pass options, the last element in the array won't be the compiler basename, so just check if the basename is in the exelist somewhere. Includes a test.
* Fix static linker exelist in cross-info and environmentNirbheek Chauhan2017-02-211-6/+30
| | | | | | | | https://github.com/mesonbuild/meson/pull/1406 had an incomplete fix for this. The test case caught it. Note: this still doesn't test that setting it in the cross-info works, but it's the same codepath as via the environment so it should be ok.
* Fix compiler exelist in cross-info and the environmentNirbheek Chauhan2017-02-211-1/+76
| | | | | | | | https://github.com/mesonbuild/meson/pull/1406 had an incomplete fix for this. The test case caught it. Note: this still doesn't test that setting it in the cross-info works, but it's the same codepath as via the environment so it should be ok.
* Merge pull request #1402 from centricular/test-setup-fixesJussi Pakkanen2017-02-201-0/+10
|\ | | | | Various fixes to how mesontest handles test setups.
| * unit tests: Test some corner-cases in test setupsNirbheek Chauhan2017-02-191-0/+10
| | | | | | | | https://github.com/mesonbuild/meson/pull/1402
* | Merge pull request #1403 from centricular/compile_resourcesJussi Pakkanen2017-02-201-0/+151
|\ \ | |/ |/| Make configure_file() great again
| * Rewrite custom_target template string substitutionNirbheek Chauhan2017-02-201-0/+151
| | | | | | | | | | | | | | | | Factor it out into a function in mesonlib.py. This will allow us to reuse it for generators and for configure_file(). The latter doesn't implement this at all right now. Also includes unit tests.
* | find_program: Fix implementation of .path()Nirbheek Chauhan2017-02-191-6/+6
| | | | | | | | | | | | | | | | And actually test that prog.path() works. The earlier test was just running the command without checking if it succeeded. Also make everything use prog.get_command() or get_path() instead of accessing the internal member prog.fullpath directly.
* | find_program: Correctly use scripts found in PATHNirbheek Chauhan2017-02-181-2/+47
| | | | | | | | | | | | | | | | | | | | | | We also need to check whether the program found in PATH can be executed directly by Windows or if we need to figure out what the interpreter is and add it to the list. Also add `msc` to the list of extensions that can be executed natively Includes a project test and a unit test for this and all expected behaviours on Windows.
* | run_unittests: Move more tests to AllPlatformTestsNirbheek Chauhan2017-02-181-169/+195
| | | | | | | | | | Only tests that depend on Linux-specific behaviour are now in LinuxlikeTests.
* | run_unittests: Resolve the real path of the tmpdirNirbheek Chauhan2017-02-181-3/+5
| | | | | | | | | | | | | | | | On macOS, the temporary directory is inside /var/folders, but /var is a symlink to /private/var, and for some reason that messes up path traversal when you're inside the temporary directory and the source directory is never found, and ninja runs in a loop trying to regenerate files that can never be regenerated.
* | run_unittests: Filter out non-object contents in static library testNirbheek Chauhan2017-02-181-2/+2
| | | | | | | | | | On macOS, this contains an extra file called `__.SYMDEF SORTED`, so filter it out.
* | run_unittests: Print output if a test failedNirbheek Chauhan2017-02-181-28/+33
| | | | | | | | | | Earlier we would just swallow all output making it impossible to figure out why something failed.
* | ninja: Delete output static lib before calling `ar`Nirbheek Chauhan2017-02-181-0/+41
| | | | | | | | | | | | | | Otherwise if the list of sources changes on reconfigure after building, the static library will contain both the old and new objects. Closes https://github.com/mesonbuild/meson/issues/1355
* | run_unittests: Move sleep() ninja bug hack to setconfNirbheek Chauhan2017-02-181-6/+7
| |
* | run_unittests: Support returning the output of a subprocessNirbheek Chauhan2017-02-181-3/+6
| |
* | Add unit tests related to absolute prefixesNirbheek Chauhan2017-02-181-19/+70
|/ | | | | | | | | | | | | Also split the unit tests into those that are actually Linux-specific and those that are not and can (and should) run on all platforms. This will give us much better coverage since a lot of these test platform-specific code in Meson that wraps features that we expose in a platform-agnostic way. Tests are for: https://github.com/mesonbuild/meson/issues/1341 https://github.com/mesonbuild/meson/issues/1345 https://github.com/mesonbuild/meson/issues/1349
* Fix absolute prefix/xxxdir subdir check on WindowsNirbheek Chauhan2017-02-061-1/+5
| | | | | | | | | os.path.commonpath (and our implementation of it) both always return the path using the native operating system path separator, so we can't just directly compare it since the prefix could be specified in '/', and commonpath would use '\' on Windows. Also add a unit test for this.
* coredata: Use our own implementation of commonpathNirbheek Chauhan2017-01-301-0/+17
| | | | | | | | | os.path.commonpath was added in Python 3.5, so just write our own for now. pathlib was added in Python 3.4, so this should be ok. We need to use that instead of doing str.split() etc because Windows path handling has a lot of exceptions and pathlib handles all that for us. Also adds a unit test for this.
* Cope with files created with a different umask.Jussi Pakkanen2017-01-291-2/+4
|
* Merge pull request #1335 from tp-m/test-custom-target-used-in-test-cmdJussi Pakkanen2017-01-281-1/+1
|\ | | | | tests: check custom target output is created before being used in a t…
| * tests: Move build-by-default unit test to common testsNirbheek Chauhan2017-01-281-1/+1
| | | | | | | | | | | | | | | | Also add a test() that can be run on all platforms. Currently unit tests are only run on Linux, so this was only testing the Ninja backend. This change reveals that build-by-default was broken with the Visual Studio backend.
* | Use CompilerArgs for generation of compile commandsNirbheek Chauhan2017-01-281-0/+33
| | | | | | | | | | | | | | | | At the same time, also fix the order in which compile arguments are added. Detailed comments have been added concerning the priority and order of the arguments. Also adds a unit test and an integration test for the same.
* | compilers: New class CompilerArgs derived from list()Nirbheek Chauhan2017-01-271-1/+58
|/ | | | | | | | | | | | | | | | | The purpose of this class is to make it possible to sanely generate compiler command-lines by ensuring that new arguments appended or added to a list of arguments properly override previous arguments. For instance: >>> a = CompilerArgs(['-Lfoo', '-DBAR']) >>> a += ['-Lgah', '-DTAZ'] >>> print(a) ['-Lgah', '-Lfoo', '-DBAR', '-DTAZ'] Arguments will be de-duped if it is safe to do so. Currently, this is only done for -I and -L arguments (previous occurances are removed when a new one is added) and arguments that once added cannot be overriden such as -pipe are removed completely.
* Support file perms for install_data and install_subdirNirbheek Chauhan2017-01-241-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | With the 'install_mode' kwarg, you can now specify the file and directory permissions and the owner and the group to be used while installing. You can pass either: * A single string specifying just the permissions * A list of strings with: - The first argument a string of permissions - The second argument a string specifying the owner or an int specifying the uid - The third argument a string specifying the group or an int specifying the gid Specifying `false` as any of the arguments skips setting that one. The format of the permissions kwarg is the same as the symbolic notation used by ls -l with the first character that specifies 'd', '-', 'c', etc for the file type omitted since that is always obvious from the context. Includes unit tests for the same. Sadly these only run on Linux right now, but we want them to run on all platforms. We do set the mode in the integration tests for all platforms but we don't check if they were actually set correctly.
* Force installation dir options to be inside prefixNirbheek Chauhan2017-01-231-5/+21
| | | | | | | | | | | | | | | | | | | With the exception of things like sysconfdir (/etc), every other installation directory option must be inside the prefix. Also move the prefix checks to coredata.py since prefix can also be set from inside project() with default_options and via mesonconf. Earlier you could set prefix to a relative path that way. This also allows us to return consistent values for get_option('xxxdir') regardless of whether relative paths are passed or absolute paths are passed while setting options on the command-line, via mesonconf, or via default_options in project(). Now the returned path will *always* be relative to the prefix. Includes a unit test for this, and a failing test. Closes #1299
* build_by_default it is.Jussi Pakkanen2017-01-151-2/+2
|
* Add test for build_on_all.Jussi Pakkanen2017-01-151-0/+11
|
* tests: Add a test for new test suite selection.Hemmo Nieminen2017-01-131-0/+55
|
* unit tests: Use assertIn() instead of assertTrue()Nirbheek Chauhan2017-01-041-9/+9
| | | | | assertIn() will print both the arguments on assertion fail, but assertTrue() will not, so that makes it easier to debug.
* icc: Fix C/C++ std options and add a unit test for themNirbheek Chauhan2017-01-041-3/+64
| | | | | | | | | Compiler versions 15.0 and later actually ignore invalid values for the -std= option unless `-diag-error 10159` is passed, so we need to put that in the unit test. I have tested this with versions 14.0.3, 15.0.6, 16.0.4, and 17.0.1. Would be great if someone could test with 13.x.y
* unit tests: Be more specific in checking for commandsNirbheek Chauhan2017-01-041-6/+6
| | | | | | | | | | | '-w' in c_command will check for it as a substring, which will also match '-wd', etc. So match it with quotes. This won't give us false positives, but might give us false negatives in case the argument is not quoted, but that's better behaviour for a test. The alternative is to split the string command, but the command does not necessarily obey shell quoting rules, so we cannot reliably use shlex.split().
* Can set envvars in test setups.Jussi Pakkanen2017-01-021-1/+12
|
* Can specify test setups and run them with mesontest.Jussi Pakkanen2017-01-021-0/+12
|
* Add a test for deterministic exe-wrapper data fileNirbheek Chauhan2016-12-311-1/+15
| | | | https://github.com/mesonbuild/meson/issues/1062
* Add simple uninstall target. Closes #753.Jussi Pakkanen2016-12-311-0/+13
|
* Share code between installed and non-installed soname testsNirbheek Chauhan2016-12-221-46/+12
|
* Add an installed soname unit testNirbheek Chauhan2016-12-221-3/+55
| | | | We also need to test that the sonames are correct after installation.
* tree-wide: remove unused importsIgor Gnatenko2016-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ./setup.py:17:1: F401 'os' imported but unused import os ^ ./setup.py:37:1: F401 'stat.ST_MODE' imported but unused from stat import ST_MODE ^ ./run_tests.py:17:1: F401 'os' imported but unused import subprocess, sys, os ^ ./run_tests.py:18:1: F401 'shutil' imported but unused import shutil ^ ./run_unittests.py:23:1: F401 'mesonbuild.dependencies.Qt5Dependency' imported but unused from mesonbuild.dependencies import PkgConfigDependency, Qt5Dependency ^ ./mesonbuild/build.py:15:1: F401 '.coredata' imported but unused from . import coredata ^ ./mesonbuild/interpreter.py:32:1: F401 'subprocess' imported but unused import os, sys, subprocess, shutil, uuid, re ^ ./mesonbuild/interpreter.py:32:1: F401 're' imported but unused import os, sys, subprocess, shutil, uuid, re ^ ./mesonbuild/dependencies.py:23:1: F401 'subprocess' imported but unused import os, stat, glob, subprocess, shutil ^ ./mesonbuild/mesonlib.py:17:1: F401 'sys' imported but unused import platform, subprocess, operator, os, shutil, re, sys ^ ./mesonbuild/modules/qt5.py:15:1: F401 'subprocess' imported but unused import os, subprocess ^ ./mesonbuild/modules/pkgconfig.py:15:1: F401 '..coredata' imported but unused from .. import coredata, build ^ ./mesonbuild/scripts/scanbuild.py:15:1: F401 'sys' imported but unused import sys, os ^ ./mesonbuild/scripts/meson_exe.py:20:1: F401 'subprocess' imported but unused import subprocess ^ ./mesonbuild/scripts/meson_exe.py:22:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/symbolextractor.py:23:1: F401 'subprocess' imported but unused import os, sys, subprocess ^ ./mesonbuild/scripts/symbolextractor.py:25:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/meson_install.py:19:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/yelphelper.py:15:1: F401 'sys' imported but unused import sys, os ^ ./mesonbuild/scripts/yelphelper.py:20:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException ^ ./mesonbuild/backend/vs2010backend.py:17:1: F401 're' imported but unused import re ^ ./test cases/vala/8 generated sources/src/copy_file.py:3:1: F401 'os' imported but unused import os ^ ./test cases/common/107 postconf/postconf.py:3:1: F401 'sys' imported but unused import sys, os ^ ./test cases/common/129 object only target/obj_generator.py:5:1: F401 'shutil' imported but unused import sys, shutil, subprocess ^ ./test cases/common/57 custom target chain/usetarget/subcomp.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/95 dep fallback/subprojects/boblib/genbob.py:3:1: F401 'os' imported but unused import os ^ ./test cases/common/98 gen extra/srcgen.py:4:1: F401 'os' imported but unused import os ^ ./test cases/common/113 generatorcustom/gen.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/113 generatorcustom/catter.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/59 object generator/obj_generator.py:5:1: F401 'shutil' imported but unused import sys, shutil, subprocess ^ Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Fix compiler arg checking if ccache is used.Jussi Pakkanen2016-12-061-0/+2
|
* Merge pull request #1103 from mesonbuild/rewriterJussi Pakkanen2016-12-061-0/+58
|\ | | | | Beginnings of a rewriter
| * Store subdir information for each node so we can remove files set in other ↵Jussi Pakkanen2016-12-041-5/+22
| | | | | | | | subdirectories.
| * Use copytree to prepare for further tests.Jussi Pakkanen2016-12-041-18/+18
| |
| * Renamed rewriter.Jussi Pakkanen2016-12-041-1/+1
| |
| * Added unit test for rewriter.Jussi Pakkanen2016-12-041-0/+42
| |
* | Print readelf output if soversion can not be determined to help debugging.Jussi Pakkanen2016-12-031-0/+1
| |