Jussi Pakkanen
db8ad2a4bd
Add test for build_on_all.
8 years ago
Hemmo Nieminen
5833bd6735
tests: Add a test for new test suite selection.
8 years ago
Nirbheek Chauhan
7f3aeb27e7
unit tests: Use assertIn() instead of assertTrue()
...
assertIn() will print both the arguments on assertion fail, but
assertTrue() will not, so that makes it easier to debug.
8 years ago
Nirbheek Chauhan
731aca216e
icc: Fix C/C++ std options and add a unit test for them
...
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
8 years ago
Nirbheek Chauhan
c8bb7f2217
unit tests: Be more specific in checking for commands
...
'-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().
8 years ago
Jussi Pakkanen
74f15263b6
Can set envvars in test setups.
8 years ago
Jussi Pakkanen
ee8a6e6fc5
Can specify test setups and run them with mesontest.
8 years ago
Nirbheek Chauhan
3445beb00b
Add a test for deterministic exe-wrapper data file
...
https://github.com/mesonbuild/meson/issues/1062
8 years ago
Jussi Pakkanen
0a14ad63de
Add simple uninstall target. Closes #753 .
8 years ago
Nirbheek Chauhan
d5952531c7
Share code between installed and non-installed soname tests
8 years ago
Nirbheek Chauhan
18f581f2c4
Add an installed soname unit test
...
We also need to test that the sonames are correct after installation.
8 years ago
Igor Gnatenko
8268eb4959
tree-wide: remove unused imports
...
./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>
8 years ago
Jussi Pakkanen
eba3a7ed60
Fix compiler arg checking if ccache is used.
8 years ago
Jussi Pakkanen
14ca7d602c
Store subdir information for each node so we can remove files set in other subdirectories.
8 years ago
Jussi Pakkanen
6aa24362cd
Use copytree to prepare for further tests.
8 years ago
Jussi Pakkanen
90b038383d
Renamed rewriter.
8 years ago
Jussi Pakkanen
2168860a1e
Added unit test for rewriter.
8 years ago
Jussi Pakkanen
ecb882cd4f
Print readelf output if soversion can not be determined to help debugging.
8 years ago
Nirbheek Chauhan
ae8c4f5a30
run_unittests: Document the purpose of each test
8 years ago
Nirbheek Chauhan
025d699c00
unit tests: Use universal_newlines everywhere
...
This approach is locale-independent and more correct. For instance, this
will work with UTF-16 while the previous approach with binary comparison
would not.
This also removes the need for doing an explicit decode to utf-8 which
is lossy and can fail by yielding no output at all.
8 years ago
Nirbheek Chauhan
cee9638cc4
Compiler check and extra args should always override
...
We want compiler check arguments (-O0, -fpermissive, etc) to override
all other arguments, and we want extra_args passed in by the build file
to always override everything.
To do this properly, we must split include arguments out, append them
first, append all other arguments as usual, and then append the rest.
As part of this, we also add the compiler check flags to the
cc.compiles() and cc.links() helper functions since they also most
likely need them.
Also includes a unit test for all this.
8 years ago
Jussi Pakkanen
07d7e87411
Allow soname to be an arbitrary string and fix symlink generation.
8 years ago
Jussi Pakkanen
bfd190279c
Detect Qt5 properly on more platforms.
8 years ago
Jussi Pakkanen
d651727208
Bootstrap test code with CMake.
8 years ago
Elliott Sales de Andrade
330aebc186
Fix message to be checked in Qt5 unit test.
8 years ago
Nirbheek Chauhan
cedfa575f6
Add a unit test for Qt5 detection with qmake
...
This can only be done as a unit test because it requires changes to the
environment. This also means we need to pass the current environment to
subprocess.check_output, which we should always do anyway since the
environment is torn down and restored between each test.
8 years ago
Nirbheek Chauhan
66ec8c4258
tests: Check that run_target can find a files() argument
...
Tests https://github.com/mesonbuild/meson/issues/957
8 years ago
Jussi Pakkanen
69aa0091b1
The regex to detect version numbers needs to be a bit more complex. Closes #967 .
8 years ago
Jussi Pakkanen
6762d30c6a
Exposes the install names of targets in introspection. Closes #829 .
8 years ago
Nirbheek Chauhan
f3bb6bb227
Add a unit test to ensure object file order
...
Part of the changes to make input and output filenames in targets be
deterministic.
8 years ago
Nirbheek Chauhan
9ac98040ae
Add a unittest using the Vala and C warnings test
...
This actually tests that -Wall, -Werror, and -w are set in the right
targets.
8 years ago
Nirbheek Chauhan
6ffae922cc
Add a unittest for pkg-config file generation
...
This also tests that -lfoo is correctly added to libfoo.pc when the
library name is 'libfoo' and name_prefix is ''
8 years ago
Nirbheek Chauhan
7307f6a5c8
unittests/pic: Actually test that setting b_staticpic works
...
The previous test was tautological for the second half because:
a) b_staticpic=true is the default
b) We weren't refetching the compdb
8 years ago
Jussi Pakkanen
28df8b800e
Add an option to select if static libraries are built with -fPIC.
8 years ago
Jussi Pakkanen
f90bfa5245
Review fixes.
8 years ago
Jussi Pakkanen
3a002709f4
Pass cmd line args onwards.
8 years ago
Jussi Pakkanen
b11a5b93cb
Store all invocation output. Not shown to users yet.
8 years ago
Jussi Pakkanen
c7936f6819
Run unittests.
8 years ago
Jussi Pakkanen
4dc798dc7e
Check that soname matches the filename. Closes #785 .
8 years ago
Jussi Pakkanen
9fdec2d23f
Created a file to run unit test suite with.
8 years ago