aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md25
-rw-r--r--.github/workflows/unusedargs_missingreturn.yml38
-rw-r--r--README.md6
-rw-r--r--azure-pipelines.yml2
-rw-r--r--docs/markdown/Fs-module.md73
-rw-r--r--docs/markdown/Rewriter.md6
-rw-r--r--mesonbuild/coredata.py2
-rw-r--r--mesonbuild/dependencies/base.py53
-rw-r--r--mesonbuild/environment.py10
-rw-r--r--mesonbuild/interpreter.py6
-rw-r--r--mesonbuild/modules/fs.py100
-rw-r--r--mesonbuild/scripts/commandrunner.py7
-rwxr-xr-xrun_project_tests.py9
-rwxr-xr-xrun_unittests.py44
-rw-r--r--test cases/common/1 trivial/trivial.c2
-rw-r--r--test cases/common/100 stringdef/stringdef.c2
-rw-r--r--test cases/common/103 postconf/prog.c2
-rw-r--r--test cases/common/104 postconf with args/prog.c2
-rw-r--r--test cases/common/106 extract same name/main.c2
-rw-r--r--test cases/common/109 generatorcustom/main.c2
-rw-r--r--test cases/common/11 subdir/subdir/prog.c2
-rw-r--r--test cases/common/111 spaces backslash/comparer-end-notstring.c2
-rw-r--r--test cases/common/111 spaces backslash/comparer-end.c2
-rw-r--r--test cases/common/111 spaces backslash/comparer.c2
-rw-r--r--test cases/common/114 allgenerate/foobar.cpp.in2
-rw-r--r--test cases/common/119 subproject project arguments/exe.c2
-rw-r--r--test cases/common/119 subproject project arguments/exe.cpp2
-rw-r--r--test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c2
-rw-r--r--test cases/common/120 test skip/test_skip.c2
-rw-r--r--test cases/common/121 shared module/prog.c5
-rw-r--r--test cases/common/122 llvm ir and assembly/main.c3
-rw-r--r--test cases/common/122 llvm ir and assembly/main.cpp3
-rw-r--r--test cases/common/123 cpp and asm/trivial.cc2
-rw-r--r--test cases/common/124 extract all shared library/prog.c2
-rw-r--r--test cases/common/125 object only target/prog.c2
-rw-r--r--test cases/common/126 no buildincdir/prog.c2
-rw-r--r--test cases/common/128 dependency file generation/main .c2
-rw-r--r--test cases/common/129 configure file in generator/src/main.c2
-rw-r--r--test cases/common/13 pch/c/prog.c2
-rw-r--r--test cases/common/13 pch/cpp/prog.cc2
-rw-r--r--test cases/common/13 pch/generated/prog.c2
-rw-r--r--test cases/common/13 pch/mixed/main.cc2
-rw-r--r--test cases/common/13 pch/userDefined/prog.c2
-rw-r--r--test cases/common/13 pch/withIncludeDirectories/prog.c2
-rw-r--r--test cases/common/130 generated llvm ir/main.c3
-rw-r--r--test cases/common/131 generated assembly/main.c3
-rw-r--r--test cases/common/132 build by default targets in tests/main.c2
-rw-r--r--test cases/common/133 build by default/foo.c2
-rw-r--r--test cases/common/134 include order/ordertest.c3
-rw-r--r--test cases/common/134 include order/sub4/main.c2
-rw-r--r--test cases/common/135 override options/four.c2
-rw-r--r--test cases/common/135 override options/two.c2
-rw-r--r--test cases/common/137 c cpp and asm/main.c2
-rw-r--r--test cases/common/137 c cpp and asm/main.cpp2
-rw-r--r--test cases/common/138 compute int/prog.c.in2
-rw-r--r--test cases/common/139 custom target object output/progdir/prog.c2
-rw-r--r--test cases/common/14 configure file/dumpprog.c2
-rw-r--r--test cases/common/14 configure file/prog.c2
-rw-r--r--test cases/common/14 configure file/prog2.c2
-rw-r--r--test cases/common/14 configure file/prog4.c2
-rw-r--r--test cases/common/14 configure file/prog5.c2
-rw-r--r--test cases/common/14 configure file/prog6.c2
-rw-r--r--test cases/common/14 configure file/prog7.c2
-rw-r--r--test cases/common/14 configure file/prog9.c2
-rw-r--r--test cases/common/141 whole archive/prog.c2
-rw-r--r--test cases/common/149 recursive linking/3rdorderdeps/main.c.in2
-rw-r--r--test cases/common/149 recursive linking/circular/main.c2
-rw-r--r--test cases/common/149 recursive linking/edge-cases/shstmain.c2
-rw-r--r--test cases/common/149 recursive linking/edge-cases/stomain.c2
-rw-r--r--test cases/common/149 recursive linking/main.c2
-rw-r--r--test cases/common/15 if/prog.c2
-rw-r--r--test cases/common/151 simd/simdchecker.c2
-rw-r--r--test cases/common/152 shared module resolving symbol in executable/prog.c5
-rw-r--r--test cases/common/153 dotinclude/dotproc.c2
-rw-r--r--test cases/common/154 reserved targets/test.c2
-rw-r--r--test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c2
-rw-r--r--test cases/common/157 wrap file should not failed/src/subprojects/prog.c2
-rw-r--r--test cases/common/158 includedir subproj/prog.c2
-rw-r--r--test cases/common/159 subproject dir name collision/a.c2
-rw-r--r--test cases/common/16 else/prog.c2
-rw-r--r--test cases/common/17 comparison/prog.c2
-rw-r--r--test cases/common/170 get project license/bar.c2
-rw-r--r--test cases/common/172 subproject nested subproject dirs/prog.c2
-rw-r--r--test cases/common/173 preserve gendir/testprog.c2
-rw-r--r--test cases/common/174 source in dep/generated/main.c2
-rw-r--r--test cases/common/18 array/prog.c2
-rw-r--r--test cases/common/183 bothlibraries/main.c2
-rw-r--r--test cases/common/187 find override/otherdir/main.c2
-rw-r--r--test cases/common/187 find override/otherdir/main2.c2
-rw-r--r--test cases/common/19 includedir/src/prog.c2
-rw-r--r--test cases/common/195 install_mode/trivial.c2
-rw-r--r--test cases/common/2 cpp/trivial.cc2
-rw-r--r--test cases/common/20 header in file list/prog.c2
-rw-r--r--test cases/common/200 generator in subdir/com/mesonbuild/testprog.c2
-rw-r--r--test cases/common/201 override with exe/subprojects/sub/foobar.c1
-rw-r--r--test cases/common/202 subproject with features/nothing.c2
-rw-r--r--test cases/common/207 kwarg entry/prog.c2
-rw-r--r--test cases/common/21 global arg/prog.c2
-rw-r--r--test cases/common/21 global arg/prog.cc2
-rw-r--r--test cases/common/215 link custom/prog.c2
-rw-r--r--test cases/common/216 link custom_i single from multiple/prog.c2
-rw-r--r--test cases/common/217 link custom_i multiple from multiple/prog.c2
-rw-r--r--test cases/common/22 target arg/prog.cc2
-rw-r--r--test cases/common/22 target arg/prog2.cc2
-rw-r--r--test cases/common/227 fs module/meson.build53
-rw-r--r--test cases/common/23 object extraction/main.c2
-rw-r--r--test cases/common/24 endian/prog.c2
-rw-r--r--test cases/common/26 config subdir/src/prog.c2
-rw-r--r--test cases/common/27 pipeline/depends/filecopier.c1
-rw-r--r--test cases/common/27 pipeline/depends/prog.c2
-rw-r--r--test cases/common/27 pipeline/prog.c2
-rw-r--r--test cases/common/27 pipeline/src/prog.c2
-rw-r--r--test cases/common/28 find program/source.in2
-rw-r--r--test cases/common/29 multiline string/meson.build2
-rw-r--r--test cases/common/32 sizeof/prog.c.in2
-rw-r--r--test cases/common/33 define10/prog.c2
-rw-r--r--test cases/common/36 tryrun/error.c2
-rw-r--r--test cases/common/36 tryrun/meson.build6
-rw-r--r--test cases/common/36 tryrun/no_compile.c2
-rw-r--r--test cases/common/36 tryrun/ok.c2
-rw-r--r--test cases/common/44 test args/env2vars.c2
-rw-r--r--test cases/common/44 test args/envvars.c2
-rw-r--r--test cases/common/45 subproject/subprojects/sublib/simpletest.c2
-rw-r--r--test cases/common/45 subproject/user.c2
-rw-r--r--test cases/common/48 custom install dirs/prog.c2
-rw-r--r--test cases/common/49 subproject subproject/prog.c2
-rw-r--r--test cases/common/5 linkstatic/main.c2
-rw-r--r--test cases/common/50 same file name/prog.c2
-rw-r--r--test cases/common/51 file grabber/prog.c2
-rw-r--r--test cases/common/51 file grabber/subdir/subprog.c2
-rw-r--r--test cases/common/53 custom target chain/usetarget/myexe.c2
-rw-r--r--test cases/common/55 object generator/prog.c2
-rw-r--r--test cases/common/56 install script/prog.c2
-rw-r--r--test cases/common/57 custom target source output/main.c2
-rw-r--r--test cases/common/58 exe static shared/prog.c2
-rw-r--r--test cases/common/6 linkshared/cppmain.cpp2
-rw-r--r--test cases/common/6 linkshared/main.c2
-rw-r--r--test cases/common/60 custom header generator/prog.c2
-rw-r--r--test cases/common/61 multiple generators/main.cpp2
-rw-r--r--test cases/common/63 foreach/prog1.c2
-rw-r--r--test cases/common/63 foreach/prog2.c2
-rw-r--r--test cases/common/63 foreach/prog3.c2
-rw-r--r--test cases/common/68 build always/main.c2
-rw-r--r--test cases/common/69 vcstag/tagprog.c2
-rw-r--r--test cases/common/7 mixed/main.cc2
-rw-r--r--test cases/common/71 should fail/failing.c2
-rw-r--r--test cases/common/75 shared subproject/a.c2
-rw-r--r--test cases/common/76 shared subproject 2/a.c2
-rw-r--r--test cases/common/77 file object/prog.c2
-rw-r--r--test cases/common/77 file object/subdir1/prog.c2
-rw-r--r--test cases/common/77 file object/subdir2/prog.c2
-rw-r--r--test cases/common/78 custom subproject dir/a.c2
-rw-r--r--test cases/common/8 install/prog.c2
-rw-r--r--test cases/common/81 internal dependency/src/main.c2
-rw-r--r--test cases/common/82 same basename/exe1.c2
-rw-r--r--test cases/common/82 same basename/exe2.c2
-rw-r--r--test cases/common/83 declare dep/main.c2
-rw-r--r--test cases/common/84 extract all/prog.c2
-rw-r--r--test cases/common/85 add language/prog.c2
-rw-r--r--test cases/common/86 identical target name in subproject/bar.c2
-rw-r--r--test cases/common/86 identical target name in subproject/subprojects/foo/bar.c2
-rw-r--r--test cases/common/89 private include/user/libuser.c2
-rw-r--r--test cases/common/93 selfbuilt custom/mainprog.cpp2
-rw-r--r--test cases/common/94 gen extra/plain.c2
-rw-r--r--test cases/common/94 gen extra/upper.c2
-rw-r--r--test cases/common/95 benchmark/delayer.c2
-rw-r--r--test cases/common/96 test workdir/opener.c2
-rw-r--r--test cases/common/97 suites/exe1.c2
-rw-r--r--test cases/common/97 suites/exe2.c2
-rw-r--r--test cases/common/97 suites/subprojects/sub/sub1.c2
-rw-r--r--test cases/common/97 suites/subprojects/sub/sub2.c2
-rw-r--r--test cases/common/98 threads/threadprog.c8
-rw-r--r--test cases/common/98 threads/threadprog.cpp4
-rw-r--r--test cases/common/99 manygen/depuser.c2
-rw-r--r--test cases/fortran/1 basic/simple.f905
-rw-r--r--test cases/fortran/12 submodule/a1.f901
-rw-r--r--test cases/fortran/9 cpp/main.cpp2
-rw-r--r--test cases/linuxlike/1 pkg-config/meson.build2
-rw-r--r--test cases/linuxlike/1 pkg-config/prog-checkver.c2
-rw-r--r--test cases/linuxlike/1 pkg-config/prog.c2
-rw-r--r--test cases/linuxlike/11 runpath rpath ldlibrarypath/main.c2
-rw-r--r--test cases/linuxlike/12 subprojects in subprojects/main.c2
-rw-r--r--test cases/linuxlike/13 cmake dependency/meson.build2
-rw-r--r--test cases/linuxlike/13 cmake dependency/prog-checkver.c2
-rw-r--r--test cases/linuxlike/13 cmake dependency/prog.c2
-rw-r--r--test cases/linuxlike/13 cmake dependency/testFlagSet.c2
-rw-r--r--test cases/linuxlike/2 external library/meson.build4
-rw-r--r--test cases/linuxlike/2 external library/prog.c2
-rw-r--r--test cases/linuxlike/3 linker script/prog.c2
-rw-r--r--test cases/linuxlike/4 extdep static lib/prog.c2
-rw-r--r--test cases/linuxlike/7 library versions/exe.orig.c3
-rw-r--r--test cases/linuxlike/9 compiler checks with dependencies/meson.build4
-rw-r--r--test cases/unit/34 command line/meson_options.txt1
-rw-r--r--test cases/unit/67 rpath-link secondary/app/app.c4
-rw-r--r--test cases/unit/67 rpath-link secondary/app/meson.build5
-rw-r--r--test cases/unit/67 rpath-link secondary/libA/liba.c1
-rw-r--r--test cases/unit/67 rpath-link secondary/libA/liba.h1
-rw-r--r--test cases/unit/67 rpath-link secondary/libA/meson.build14
-rw-r--r--test cases/unit/67 rpath-link secondary/libB/libb.c3
-rw-r--r--test cases/unit/67 rpath-link secondary/libB/libb.h1
-rw-r--r--test cases/unit/67 rpath-link secondary/libB/meson.build16
-rw-r--r--test cases/windows/1 basic/prog.c2
-rw-r--r--test cases/windows/10 vs module defs generated custom target/prog.c2
-rw-r--r--test cases/windows/11 exe implib/prog.c2
-rw-r--r--test cases/windows/16 gui app/console_prog.c2
-rw-r--r--test cases/windows/6 vs module defs/prog.c2
-rw-r--r--test cases/windows/7 dll versioning/exe.orig.c3
-rw-r--r--test cases/windows/9 vs module defs generated/prog.c2
208 files changed, 512 insertions, 365 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..4bc3fe6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,25 @@
+---
+name: Bug report
+about: Meson bug report
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Please include your `meson.build` files, preferably as a minimal toy example showing the issue.
+You may need to create simple source code files (don't include private/proprietary code).
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**system parameters**
+* Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)?
+* what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
+* what Python version are you using e.g. 3.8.0
+* what `meson --version`
+* what `ninja --version` if it's a Ninja build
diff --git a/.github/workflows/unusedargs_missingreturn.yml b/.github/workflows/unusedargs_missingreturn.yml
new file mode 100644
index 0000000..303a8d1
--- /dev/null
+++ b/.github/workflows/unusedargs_missingreturn.yml
@@ -0,0 +1,38 @@
+name: UnusedMissingReturn
+# this workflow checks for usused input arguments or missing return values in test cases.
+# some users have default configs that will needlessly fail Meson self-tests due to these syntax.
+
+on:
+ push:
+ paths:
+ - "**.yml"
+ - "test cases/cmake/**"
+ - "test cases/common/**"
+ - "test cases/fortran/**"
+ - "test cases/platform-linux/**"
+ pull_request:
+ paths:
+ - "**.yml"
+ - "test cases/cmake/**"
+ - "test cases/common/**"
+ - "test cases/fortran/**"
+ - "test cases/platform-linux/**"
+
+jobs:
+
+ linux:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - uses: actions/setup-python@v1
+ with:
+ python-version: '3.x'
+ - name: Install Compilers
+ run: |
+ sudo apt update -yq
+ sudo apt install -yq --no-install-recommends g++ gfortran ninja-build
+ - run: python run_project_tests.py --only cmake common fortran platform-linux
+ env:
+ CFLAGS: "-Werror=unused-parameter -Werror=return-type"
+ CPPFLAGS: "-Werror=unused-parameter -Werror=return-type"
+ FFLAGS: "-fimplicit-none"
diff --git a/README.md b/README.md
index 175e7f6..073dfa4 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,12 @@ pip will download the package automatically). The exact command to
type to install with Pip can vary between systems, be sure to use the
Python 3 version of Pip.
+For builds using Ninja, Ninja can be [downloaded directly](https://github.com/ninja-build/ninja/releases) or via
+
+```sh
+python3 -m pip install ninja
+```
+
#### Running
Meson requires that you have a source directory and a build directory
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 5cac9da..ab0c7f2 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -24,7 +24,7 @@ jobs:
displayName: 'Install Pylint, MyPy'
- script: pylint mesonbuild
displayName: Lint Checks
- - script: mypy --follow-imports=skip mesonbuild/mtest.py mesonbuild/minit.py mesonbuild/msetup.py mesonbuild/wrap tools/
+ - script: mypy --follow-imports=skip mesonbuild/mtest.py mesonbuild/minit.py mesonbuild/msetup.py mesonbuild/wrap tools/ mesonbuild/modules/fs.py
- job: vs2015
diff --git a/docs/markdown/Fs-module.md b/docs/markdown/Fs-module.md
index e68bf68..45cb589 100644
--- a/docs/markdown/Fs-module.md
+++ b/docs/markdown/Fs-module.md
@@ -8,6 +8,8 @@ available starting with version 0.53.0.
Non-absolute paths are looked up relative to the directory where the
current `meson.build` file is.
+If specified, a leading `~` is expanded to the user home directory.
+
### exists
Takes a single string argument and returns true if an entity with that
@@ -29,3 +31,74 @@ name exists on the file system. This method follows symbolic links.
Takes a single string argument and returns true if the path pointed to
by the string is a symbolic link.
+
+## File Parameters
+
+### hash
+
+The `fs.hash(filename, hash_algorithm)` method returns a string containing
+the hexidecimal `hash_algorithm` digest of a file.
+`hash_algorithm` is a string; the available hash algorithms include:
+md5, sha1, sha224, sha256, sha384, sha512.
+
+### size
+
+The `fs.size(filename)` method returns the size of the file in integer bytes.
+Symlinks will be resolved if possible.
+
+### samefile
+
+The `fs.samefile(filename1, filename2)` returns boolean `true` if the input filenames refer to the same file.
+For example, suppose filename1 is a symlink and filename2 is a relative path.
+If filename1 can be resolved to a file that is the same file as filename2, then `true` is returned.
+If filename1 is not resolved to be the same as filename2, `false` is returned.
+If either filename does not exist, an error message is raised.
+
+Examples:
+
+```meson
+x = 'foo.txt'
+y = 'sub/../foo.txt'
+z = 'bar.txt' # a symlink pointing to foo.txt
+
+fs.samefile(x, y) # true
+fs.samefile(x, z) # true
+```
+
+
+## Filename modification
+
+### replace_suffix
+
+The `replace_suffix` method is a *string manipulation* convenient for filename modifications.
+It allows changing the filename suffix like:
+
+#### swap suffix
+
+```meson
+original = '/opt/foo.ini'
+new = fs.replace_suffix(original, '.txt') # /opt/foo.txt
+```
+
+#### add suffix
+
+```meson
+original = '/opt/foo'
+new = fs.replace_suffix(original, '.txt') # /opt/foo.txt
+```
+
+#### compound suffix swap
+
+```meson
+original = '/opt/foo.dll.a'
+new = fs.replace_suffix(original, '.so') # /opt/foo.dll.so
+```
+
+#### delete suffix
+
+```meson
+original = '/opt/foo.dll.a'
+new = fs.replace_suffix(original, '') # /opt/foo.dll
+```
+
+The files need not actually exist yet for this method, as it's just string manipulation. \ No newline at end of file
diff --git a/docs/markdown/Rewriter.md b/docs/markdown/Rewriter.md
index 9972bea..6414480 100644
--- a/docs/markdown/Rewriter.md
+++ b/docs/markdown/Rewriter.md
@@ -80,13 +80,13 @@ It is also possible to set kwargs of specific functions with the rewriter. The
general command for setting or removing kwargs is:
```bash
-meson rewriter kwargs {set/delete} <function type> <function ID> <key1> <value1> <key2> <value2> ...
+meson rewrite kwargs {set/delete} <function type> <function ID> <key1> <value1> <key2> <value2> ...
```
For instance, setting the project version can be achieved with this command:
```bash
-meson rewriter kwargs set project / version 1.0.0
+meson rewrite kwargs set project / version 1.0.0
```
Currently, only the following function types are supported:
@@ -95,7 +95,7 @@ Currently, only the following function types are supported:
- target (any build target, the function ID is the target name/ID)
- project (the function ID must be `/` since project() can only be called once)
-For more information see the help output of the rewriter kwargs command.
+For more information see the help output of the rewrite kwargs command.
### Setting the project default options
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 05cde4d..a5898f1 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -776,7 +776,7 @@ class CmdLineFileParser(configparser.ConfigParser):
def __init__(self):
# We don't want ':' as key delimiter, otherwise it would break when
# storing subproject options like "subproject:option=value"
- super().__init__(delimiters=['='])
+ super().__init__(delimiters=['='], interpolation=None)
def get_cmd_line_file(build_dir):
return os.path.join(build_dir, 'meson-private', 'cmd_line.txt')
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index b190414..1666e0c 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -33,7 +33,6 @@ from .. import mesonlib
from ..compilers import clib_langs
from ..environment import BinaryTable, Environment, MachineInfo
from ..cmake import CMakeExecutor, CMakeTraceParser, CMakeException
-from ..linkers import GnuLikeDynamicLinkerMixin
from ..mesonlib import MachineChoice, MesonException, OrderedSet, PerMachine
from ..mesonlib import Popen_safe, version_compare_many, version_compare, listify, stringlistify, extract_as_list, split_args
from ..mesonlib import Version, LibType
@@ -748,18 +747,16 @@ class PkgConfigDependency(ExternalDependency):
(self.name, err))
self.compile_args = self._convert_mingw_paths(self._split_args(out))
- def _search_libs(self, out, out_raw, out_all):
+ def _search_libs(self, out, out_raw):
'''
@out: PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 pkg-config --libs
@out_raw: pkg-config --libs
- @out_all: pkg-config --libs --static
We always look for the file ourselves instead of depending on the
compiler to find it with -lfoo or foo.lib (if possible) because:
1. We want to be able to select static or shared
2. We need the full path of the library to calculate RPATH values
3. De-dup of libraries is easier when we have absolute paths
- 4. We need to find the directories in which secondary dependencies reside
Libraries that are provided by the toolchain or are not found by
find_library() will be added with -L -l pairs.
@@ -793,18 +790,6 @@ class PkgConfigDependency(ExternalDependency):
continue
if arg.startswith('-L') and arg[2:] not in prefix_libpaths:
system_libpaths.add(arg[2:])
- # collect all secondary library paths
- secondary_libpaths = OrderedSet()
- all_args = self._convert_mingw_paths(shlex.split(out_all))
- for arg in all_args:
- if arg.startswith('-L') and not arg.startswith(('-L-l', '-L-L')):
- path = arg[2:]
- if not os.path.isabs(path):
- # Resolve the path as a compiler in the build directory would
- path = os.path.join(self.env.get_build_dir(), path)
- if path not in prefix_libpaths and path not in system_libpaths:
- secondary_libpaths.add(path)
-
# Use this re-ordered path list for library resolution
libpaths = list(prefix_libpaths) + list(system_libpaths)
# Track -lfoo libraries to avoid duplicate work
@@ -812,12 +797,8 @@ class PkgConfigDependency(ExternalDependency):
# Track not-found libraries to know whether to add library paths
libs_notfound = []
libtype = LibType.STATIC if self.static else LibType.PREFER_SHARED
- # Generate link arguments for this library, by
- # first appending secondary link arguments for ld
+ # Generate link arguments for this library
link_args = []
- if self.clib_compiler and self.clib_compiler.linker and isinstance(self.clib_compiler.linker, GnuLikeDynamicLinkerMixin):
- link_args = ['-Wl,-rpath-link,' + p for p in secondary_libpaths]
-
for lib in full_args:
if lib.startswith(('-L-l', '-L-L')):
# These are D language arguments, add them as-is
@@ -887,26 +868,6 @@ class PkgConfigDependency(ExternalDependency):
libcmd = [self.name, '--libs']
if self.static:
libcmd.append('--static')
- # We need to find *all* secondary dependencies of a library
- #
- # Say we have libA.so, located in /non/standard/dir1/, and
- # libB.so, located in /non/standard/dir2/, which links to
- # libA.so. Now when linking exeC to libB.so, the linker will
- # walk the complete symbol tree to determine that all undefined
- # symbols can be resolved. Because libA.so lives in a directory
- # not known to the linker by default, you will get errors like
- #
- # ld: warning: libA.so, needed by /non/standard/dir2/libB.so,
- # not found (try using -rpath or -rpath-link)
- # ld: /non/standard/dir2/libB.so: undefined reference to `foo()'
- #
- # To solve this, we load the -L paths of *all* dependencies, by
- # relying on --static to provide us with a complete picture. All
- # -L paths that are found via a --static lookup but that are not
- # contained in the normal lookup have to originate from secondary
- # dependencies. See also:
- # http://www.kaizou.org/2015/01/linux-libraries/
- libcmd_all = [self.name, '--libs', '--static']
# Force pkg-config to output -L fields even if they are system
# paths so we can do manual searching with cc.find_library() later.
env = os.environ.copy()
@@ -920,13 +881,9 @@ class PkgConfigDependency(ExternalDependency):
# gnome.generate_gir + gnome.gtkdoc which need -L -l arguments.
ret, out_raw, err_raw = self._call_pkgbin(libcmd)
if ret != 0:
- raise DependencyException('Could not generate libs for %s:\n%s\n' %
- (self.name, err_raw))
- ret, out_all, err_all = self._call_pkgbin(libcmd_all)
- if ret != 0:
- mlog.warning('Could not determine complete list of dependencies for %s:\n%s\n' %
- (self.name, err_all))
- self.link_args, self.raw_link_args = self._search_libs(out, out_raw, out_all)
+ raise DependencyException('Could not generate libs for %s:\n\n%s' %
+ (self.name, out_raw))
+ self.link_args, self.raw_link_args = self._search_libs(out, out_raw)
def get_pkgconfig_variable(self, variable_name, kwargs):
options = ['--variable=' + variable_name, self.name]
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 072e7c3..f53f17f 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -835,6 +835,8 @@ class Environment:
for compiler in compilers:
if isinstance(compiler, str):
compiler = [compiler]
+ compiler_name = os.path.basename(compiler[0])
+
if not set(['cl', 'cl.exe', 'clang-cl', 'clang-cl.exe']).isdisjoint(compiler):
# Watcom C provides it's own cl.exe clone that mimics an older
# version of Microsoft's compiler. Since Watcom's cl.exe is
@@ -855,11 +857,11 @@ class Environment:
if found_cl in watcom_cls:
continue
arg = '/?'
- elif 'armcc' in compiler[0]:
+ elif 'armcc' in compiler_name:
arg = '--vsn'
- elif 'ccrx' in compiler[0]:
+ elif 'ccrx' in compiler_name:
arg = '-v'
- elif 'icl' in compiler[0]:
+ elif 'icl' in compiler_name:
# if you pass anything to icl you get stuck in a pager
arg = ''
else:
@@ -871,7 +873,7 @@ class Environment:
popen_exceptions[' '.join(compiler + [arg])] = e
continue
- if 'ccrx' in compiler[0]:
+ if 'ccrx' in compiler_name:
out = err
full_version = out.split('\n', 1)[0]
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 72370ed..3179fb4 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2382,6 +2382,7 @@ external dependencies (including libraries) must go to "dependencies".''')
m = 'must be a string, or the output of find_program(), files() '\
'or configure_file(), or a compiler object; not {!r}'
+ expanded_args = []
if isinstance(cmd, ExternalProgramHolder):
cmd = cmd.held_object
if isinstance(cmd, build.Executable):
@@ -2392,12 +2393,14 @@ external dependencies (including libraries) must go to "dependencies".''')
if not cmd.found():
raise InterpreterException('command {!r} not found or not executable'.format(cmd))
elif isinstance(cmd, CompilerHolder):
- cmd = cmd.compiler.get_exelist()[0]
+ exelist = cmd.compiler.get_exelist()
+ cmd = exelist[0]
prog = ExternalProgram(cmd, silent=True)
if not prog.found():
raise InterpreterException('Program {!r} not found '
'or not executable'.format(cmd))
cmd = prog
+ expanded_args = exelist[1:]
else:
if isinstance(cmd, mesonlib.File):
cmd = cmd.absolute_path(srcdir, builddir)
@@ -2417,7 +2420,6 @@ external dependencies (including libraries) must go to "dependencies".''')
if not os.path.isabs(cmd_path):
if cmd_path not in self.build_def_files:
self.build_def_files.append(cmd_path)
- expanded_args = []
for a in listify(cargs):
if isinstance(a, str):
expanded_args.append(a)
diff --git a/mesonbuild/modules/fs.py b/mesonbuild/modules/fs.py
index 61ad917..86861ae 100644
--- a/mesonbuild/modules/fs.py
+++ b/mesonbuild/modules/fs.py
@@ -12,13 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import os
+import typing
+import hashlib
+from pathlib import Path, PurePath
+from .. import mlog
from . import ExtensionModule
from . import ModuleReturnValue
from ..mesonlib import MesonException
from ..interpreterbase import stringArgs, noKwargs
+if typing.TYPE_CHECKING:
+ from ..interpreter import ModuleState
class FSModule(ExtensionModule):
@@ -26,34 +31,93 @@ class FSModule(ExtensionModule):
super().__init__(interpreter)
self.snippets.add('generate_dub_file')
+ def _resolve_dir(self, state: 'ModuleState', arg: str) -> Path:
+ """
+ resolves (makes absolute) a directory relative to calling meson.build,
+ if not already absolute
+ """
+ return Path(state.source_root) / state.subdir / Path(arg).expanduser()
+
+ def _check(self, check: str, state: 'ModuleState', args: typing.Sequence[str]) -> ModuleReturnValue:
+ if len(args) != 1:
+ MesonException('fs.{} takes exactly one argument.'.format(check))
+ test_file = self._resolve_dir(state, args[0])
+ return ModuleReturnValue(getattr(test_file, check)(), [])
+
@stringArgs
@noKwargs
- def exists(self, state, args, kwargs):
- if len(args) != 1:
- MesonException('method takes exactly one argument.')
- test_file = os.path.join(state.source_root, state.subdir, args[0])
- return ModuleReturnValue(os.path.exists(test_file), [])
+ def exists(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ return self._check('exists', state, args)
- def _check(self, check_fun, state, args):
- if len(args) != 1:
- MesonException('method takes exactly one argument.')
- test_file = os.path.join(state.source_root, state.subdir, args[0])
- return ModuleReturnValue(check_fun(test_file), [])
+ @stringArgs
+ @noKwargs
+ def is_symlink(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ return self._check('is_symlink', state, args)
@stringArgs
@noKwargs
- def is_symlink(self, state, args, kwargs):
- return self._check(os.path.islink, state, args)
+ def is_file(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ return self._check('is_file', state, args)
@stringArgs
@noKwargs
- def is_file(self, state, args, kwargs):
- return self._check(os.path.isfile, state, args)
+ def is_dir(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ return self._check('is_dir', state, args)
@stringArgs
@noKwargs
- def is_dir(self, state, args, kwargs):
- return self._check(os.path.isdir, state, args)
+ def hash(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ if len(args) != 2:
+ MesonException('method takes exactly two arguments.')
+ file = self._resolve_dir(state, args[0])
+ if not file.is_file():
+ raise MesonException('{} is not a file and therefore cannot be hashed'.format(file))
+ try:
+ h = hashlib.new(args[1])
+ except ValueError:
+ raise MesonException('hash algorithm {} is not available'.format(args[1]))
+ mlog.debug('computing {} sum of {} size {} bytes'.format(args[1], file, file.stat().st_size))
+ h.update(file.read_bytes())
+ return ModuleReturnValue(h.hexdigest(), [])
+
+ @stringArgs
+ @noKwargs
+ def size(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ if len(args) != 1:
+ MesonException('method takes exactly one argument.')
+ file = self._resolve_dir(state, args[0])
+ if not file.is_file():
+ raise MesonException('{} is not a file and therefore cannot be sized'.format(file))
+ try:
+ return ModuleReturnValue(file.stat().st_size, [])
+ except ValueError:
+ raise MesonException('{} size could not be determined'.format(args[0]))
+
+ @stringArgs
+ @noKwargs
+ def samefile(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ if len(args) != 2:
+ MesonException('method takes exactly two arguments.')
+ file1 = self._resolve_dir(state, args[0])
+ file2 = self._resolve_dir(state, args[1])
+ if not file1.exists():
+ raise MesonException('{} is not a file, symlink or directory and therefore cannot be compared'.format(file1))
+ if not file2.exists():
+ raise MesonException('{} is not a file, symlink or directory and therefore cannot be compared'.format(file2))
+ try:
+ return ModuleReturnValue(file1.samefile(file2), [])
+ except OSError:
+ raise MesonException('{} could not be compared to {}'.format(file1, file2))
+
+ @stringArgs
+ @noKwargs
+ def replace_suffix(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ if len(args) != 2:
+ MesonException('method takes exactly two arguments.')
+ original = PurePath(args[0])
+ new = original.with_suffix(args[1])
+ return ModuleReturnValue(str(new), [])
+
-def initialize(*args, **kwargs):
+def initialize(*args, **kwargs) -> FSModule:
return FSModule(*args, **kwargs)
diff --git a/mesonbuild/scripts/commandrunner.py b/mesonbuild/scripts/commandrunner.py
index 3807114..22da417 100644
--- a/mesonbuild/scripts/commandrunner.py
+++ b/mesonbuild/scripts/commandrunner.py
@@ -71,7 +71,12 @@ def run(args):
command = args[4]
arguments = args[5:]
pc = run_command(src_dir, build_dir, subdir, meson_command, command, arguments)
- pc.wait()
+ while True:
+ try:
+ pc.wait()
+ break
+ except KeyboardInterrupt:
+ pass
return pc.returncode
if __name__ == '__main__':
diff --git a/run_project_tests.py b/run_project_tests.py
index ca0779c..64da5a6 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -651,14 +651,18 @@ def detect_tests_to_run(only: typing.List[str]) -> typing.List[typing.Tuple[str,
gathered_tests = [(name, gather_tests(Path('test cases', subdir)), skip) for name, subdir, skip in all_tests]
return gathered_tests
-def run_tests(all_tests, log_name_base, failfast: bool, extra_args):
+def run_tests(all_tests: typing.List[typing.Tuple[str, typing.List[Path], bool]],
+ log_name_base: str, failfast: bool,
+ extra_args: typing.List[str]) -> typing.Tuple[int, int, int]:
global logfile
txtname = log_name_base + '.txt'
with open(txtname, 'w', encoding='utf-8', errors='ignore') as lf:
logfile = lf
return _run_tests(all_tests, log_name_base, failfast, extra_args)
-def _run_tests(all_tests, log_name_base, failfast: bool, extra_args):
+def _run_tests(all_tests: typing.List[typing.Tuple[str, typing.List[Path], bool]],
+ log_name_base: str, failfast: bool,
+ extra_args: typing.List[str]) -> typing.Tuple[int, int, int]:
global stop, executor, futures, system_compiler
xmlname = log_name_base + '.xml'
junit_root = ET.Element('testsuites')
@@ -707,6 +711,7 @@ def _run_tests(all_tests, log_name_base, failfast: bool, extra_args):
if name.startswith('warning'):
suite_args = ['--fatal-meson-warnings']
should_fail = name.split('warning-')[1]
+
result = executor.submit(run_test, skipped, t.as_posix(), extra_args + suite_args,
system_compiler, backend, backend_flags, commands, should_fail)
futures.append((testname, t, result))
diff --git a/run_unittests.py b/run_unittests.py
index 6e18604..2aa4470 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -3382,6 +3382,11 @@ recommended as it is not supported on some platforms''')
self.assertEqual(obj.compiler_options.host['c_args'].value, ['foo bar', 'one', 'two'])
self.wipe()
+ self.init(testdir, extra_args=['-Dset_percent_opt=myoption%'])
+ obj = mesonbuild.coredata.load(self.builddir)
+ self.assertEqual(obj.user_options['set_percent_opt'].value, 'myoption%')
+ self.wipe()
+
# Setting a 2nd time the same option should override the first value
try:
self.init(testdir, extra_args=['--bindir=foo', '--bindir=bar',
@@ -5467,45 +5472,6 @@ class LinuxlikeTests(BasePlatformTests):
self.build()
@skipIfNoPkgconfig
- def test_pkgconfig_secondary_dependencies(self):
- '''
- Check that Meson gets -Wl,-rpath-link right for secondary dependencies
-
- This test requires at least two libraries, as -Wl,-rpath-link is only
- required for dependencies of dependencies (i.e. secondary dependencies).
- '''
- with tempfile.TemporaryDirectory() as tempdirname:
- testdirbase = os.path.join(self.unit_test_dir, '67 rpath-link secondary')
-
- # build libA
- testdirlibA = os.path.join(testdirbase, 'libA')
- testlibAprefix = os.path.join(tempdirname, 'libAprefix')
- self.init(testdirlibA, extra_args=['--prefix=' + testlibAprefix,
- '--libdir=lib',
- '--default-library=shared'], default_args=False)
- self.build()
- self.install(use_destdir=False)
-
- # build libB (uses libA)
- pkg_dir = [os.path.join(testlibAprefix, 'lib/pkgconfig')]
- self.new_builddir()
- testdirlibB = os.path.join(testdirbase, 'libB')
- testlibBprefix = os.path.join(tempdirname, 'libBprefix')
- self.init(testdirlibB, extra_args=['--prefix=' + testlibBprefix,
- '--libdir=lib',
- '--default-library=shared'], default_args=False,
- override_envvars={'PKG_CONFIG_PATH': ':'.join(pkg_dir)})
- self.build()
- self.install(use_destdir=False)
-
- # build executable (uses libB, secondary dependency on libA)
- pkg_dir.append(os.path.join(testlibBprefix, 'lib/pkgconfig'))
- self.new_builddir()
- self.init(os.path.join(testdirbase, 'app'),
- override_envvars={'PKG_CONFIG_PATH': ':'.join(pkg_dir)})
- self.build()
-
- @skipIfNoPkgconfig
def test_static_archive_stripping(self):
'''
Check that Meson produces valid static archives with --strip enabled
diff --git a/test cases/common/1 trivial/trivial.c b/test cases/common/1 trivial/trivial.c
index 24ac454..38b58cc 100644
--- a/test cases/common/1 trivial/trivial.c
+++ b/test cases/common/1 trivial/trivial.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("Trivial test is working.\n");
return 0;
}
diff --git a/test cases/common/100 stringdef/stringdef.c b/test cases/common/100 stringdef/stringdef.c
index 69ea656..f1f1ca4 100644
--- a/test cases/common/100 stringdef/stringdef.c
+++ b/test cases/common/100 stringdef/stringdef.c
@@ -1,7 +1,7 @@
#include<stdio.h>
#include<string.h>
-int main(int argc, char **argv) {
+int main() {
if(strcmp(FOO, "bar")) {
printf("FOO is misquoted: %s\n", FOO);
return 1;
diff --git a/test cases/common/103 postconf/prog.c b/test cases/common/103 postconf/prog.c
index 1e5d4cb..9315f86 100644
--- a/test cases/common/103 postconf/prog.c
+++ b/test cases/common/103 postconf/prog.c
@@ -1,5 +1,5 @@
#include"generated.h"
-int main(int argc, char **argv) {
+int main() {
return THE_NUMBER != 9;
}
diff --git a/test cases/common/104 postconf with args/prog.c b/test cases/common/104 postconf with args/prog.c
index 0e63a8c..6458543 100644
--- a/test cases/common/104 postconf with args/prog.c
+++ b/test cases/common/104 postconf with args/prog.c
@@ -1,5 +1,5 @@
#include"generated.h"
-int main(int argc, char **argv) {
+int main() {
return THE_NUMBER != 9 || THE_ARG1 != 5 || THE_ARG2 != 33;
}
diff --git a/test cases/common/106 extract same name/main.c b/test cases/common/106 extract same name/main.c
index dc57dd5..79e70a2 100644
--- a/test cases/common/106 extract same name/main.c
+++ b/test cases/common/106 extract same name/main.c
@@ -1,6 +1,6 @@
int func1();
int func2();
-int main(int argc, char **argv) {
+int main() {
return !(func1() == 23 && func2() == 42);
}
diff --git a/test cases/common/109 generatorcustom/main.c b/test cases/common/109 generatorcustom/main.c
index 04abcf6..23f894f 100644
--- a/test cases/common/109 generatorcustom/main.c
+++ b/test cases/common/109 generatorcustom/main.c
@@ -2,6 +2,6 @@
#include"alltogether.h"
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/11 subdir/subdir/prog.c b/test cases/common/11 subdir/subdir/prog.c
index 0314ff1..76e8197 100644
--- a/test cases/common/11 subdir/subdir/prog.c
+++ b/test cases/common/11 subdir/subdir/prog.c
@@ -1 +1 @@
-int main(int argc, char **argv) { return 0; }
+int main() { return 0; }
diff --git a/test cases/common/111 spaces backslash/comparer-end-notstring.c b/test cases/common/111 spaces backslash/comparer-end-notstring.c
index 65bf8bc..a50ad6d 100644
--- a/test cases/common/111 spaces backslash/comparer-end-notstring.c
+++ b/test cases/common/111 spaces backslash/comparer-end-notstring.c
@@ -10,7 +10,7 @@
#define COMPARE_WITH "foo\\bar\\" /* This is the literal `foo\bar\` */
-int main(int argc, char **argv) {
+int main() {
if(strcmp(QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH)) {
printf("Arg string is quoted incorrectly: %s instead of %s\n",
QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH);
diff --git a/test cases/common/111 spaces backslash/comparer-end.c b/test cases/common/111 spaces backslash/comparer-end.c
index fef25a5..60c6bdb 100644
--- a/test cases/common/111 spaces backslash/comparer-end.c
+++ b/test cases/common/111 spaces backslash/comparer-end.c
@@ -6,7 +6,7 @@
#define COMPARE_WITH "foo\\bar\\" /* This is `foo\bar\` */
-int main (int argc, char **argv) {
+int main () {
if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) {
printf ("Arg string is quoted incorrectly: %s vs %s\n",
DEF_WITH_BACKSLASH, COMPARE_WITH);
diff --git a/test cases/common/111 spaces backslash/comparer.c b/test cases/common/111 spaces backslash/comparer.c
index 937cb47..e705ff3 100644
--- a/test cases/common/111 spaces backslash/comparer.c
+++ b/test cases/common/111 spaces backslash/comparer.c
@@ -6,7 +6,7 @@
#define COMPARE_WITH "foo\\bar" /* This is the literal `foo\bar` */
-int main (int argc, char **argv) {
+int main () {
if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) {
printf ("Arg string is quoted incorrectly: %s instead of %s\n",
DEF_WITH_BACKSLASH, COMPARE_WITH);
diff --git a/test cases/common/114 allgenerate/foobar.cpp.in b/test cases/common/114 allgenerate/foobar.cpp.in
index c64f3b5..7cec281 100644
--- a/test cases/common/114 allgenerate/foobar.cpp.in
+++ b/test cases/common/114 allgenerate/foobar.cpp.in
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I am a program.\n");
return 0;
}
diff --git a/test cases/common/119 subproject project arguments/exe.c b/test cases/common/119 subproject project arguments/exe.c
index d6440f0..b338846 100644
--- a/test cases/common/119 subproject project arguments/exe.c
+++ b/test cases/common/119 subproject project arguments/exe.c
@@ -22,6 +22,6 @@
#error
#endif
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/119 subproject project arguments/exe.cpp b/test cases/common/119 subproject project arguments/exe.cpp
index 8471c6f..b739df7 100644
--- a/test cases/common/119 subproject project arguments/exe.cpp
+++ b/test cases/common/119 subproject project arguments/exe.cpp
@@ -22,7 +22,7 @@
#error
#endif
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c b/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c
index f748afc..62cc965 100644
--- a/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c
+++ b/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c
@@ -22,6 +22,6 @@
#error
#endif
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/120 test skip/test_skip.c b/test cases/common/120 test skip/test_skip.c
index db26681..24ea97b 100644
--- a/test cases/common/120 test skip/test_skip.c
+++ b/test cases/common/120 test skip/test_skip.c
@@ -1,3 +1,3 @@
-int main(int argc, char *argv[]) {
+int main() {
return 77;
}
diff --git a/test cases/common/121 shared module/prog.c b/test cases/common/121 shared module/prog.c
index 8b56d93..4741185 100644
--- a/test cases/common/121 shared module/prog.c
+++ b/test cases/common/121 shared module/prog.c
@@ -21,13 +21,13 @@ win32_get_last_error (void)
return msg;
}
-int
-main (int argc, char **argv)
+int main(int argc, char **argv)
{
HINSTANCE handle;
fptr importedfunc;
int expected, actual;
int ret = 1;
+ if(argc==0) {};
handle = LoadLibraryA (argv[1]);
if (!handle) {
@@ -68,6 +68,7 @@ int main(int argc, char **argv) {
int expected, actual;
char *error;
int ret = 1;
+ if(argc==0) {};
dlerror();
dl = dlopen(argv[1], RTLD_LAZY);
diff --git a/test cases/common/122 llvm ir and assembly/main.c b/test cases/common/122 llvm ir and assembly/main.c
index 97fe723..887c64a 100644
--- a/test cases/common/122 llvm ir and assembly/main.c
+++ b/test cases/common/122 llvm ir and assembly/main.c
@@ -2,8 +2,7 @@
unsigned square_unsigned (unsigned a);
-int
-main (int argc, char * argv[])
+int main ()
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {
diff --git a/test cases/common/122 llvm ir and assembly/main.cpp b/test cases/common/122 llvm ir and assembly/main.cpp
index f2c7de3..07eaab8 100644
--- a/test cases/common/122 llvm ir and assembly/main.cpp
+++ b/test cases/common/122 llvm ir and assembly/main.cpp
@@ -4,8 +4,7 @@ extern "C" {
unsigned square_unsigned (unsigned a);
}
-int
-main (int argc, char * argv[])
+int main ()
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {
diff --git a/test cases/common/123 cpp and asm/trivial.cc b/test cases/common/123 cpp and asm/trivial.cc
index d2928c0..7f2ead1 100644
--- a/test cases/common/123 cpp and asm/trivial.cc
+++ b/test cases/common/123 cpp and asm/trivial.cc
@@ -4,7 +4,7 @@ extern "C" {
int get_retval(void);
}
-int main(int argc, char **argv) {
+int main() {
std::cout << "C++ seems to be working." << std::endl;
#if defined(USE_ASM)
return get_retval();
diff --git a/test cases/common/124 extract all shared library/prog.c b/test cases/common/124 extract all shared library/prog.c
index 57a4c64..48e7680 100644
--- a/test cases/common/124 extract all shared library/prog.c
+++ b/test cases/common/124 extract all shared library/prog.c
@@ -1,7 +1,7 @@
#include"extractor.h"
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
if((1+2+3+4) != (func1() + func2() + func3() + func4())) {
printf("Arithmetic is fail.\n");
return 1;
diff --git a/test cases/common/125 object only target/prog.c b/test cases/common/125 object only target/prog.c
index 60459d6..09f2790 100644
--- a/test cases/common/125 object only target/prog.c
+++ b/test cases/common/125 object only target/prog.c
@@ -2,6 +2,6 @@ int func1_in_obj();
int func2_in_obj();
int func3_in_obj();
-int main(int argc, char **argv) {
+int main() {
return func1_in_obj() + func2_in_obj() + func3_in_obj();
}
diff --git a/test cases/common/126 no buildincdir/prog.c b/test cases/common/126 no buildincdir/prog.c
index 800f0d6..7e9d194 100644
--- a/test cases/common/126 no buildincdir/prog.c
+++ b/test cases/common/126 no buildincdir/prog.c
@@ -1,5 +1,5 @@
#include"header.h"
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/128 dependency file generation/main .c b/test cases/common/128 dependency file generation/main .c
index 0fb4389..4cce7f6 100644
--- a/test cases/common/128 dependency file generation/main .c
+++ b/test cases/common/128 dependency file generation/main .c
@@ -1,3 +1,3 @@
-int main(int argc, char *argv[]) {
+int main() {
return 0;
}
diff --git a/test cases/common/129 configure file in generator/src/main.c b/test cases/common/129 configure file in generator/src/main.c
index 54f4f57..3ee83e6 100644
--- a/test cases/common/129 configure file in generator/src/main.c
+++ b/test cases/common/129 configure file in generator/src/main.c
@@ -12,6 +12,6 @@
#error Source RESULT is not defined correctly
#endif
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/13 pch/c/prog.c b/test cases/common/13 pch/c/prog.c
index 0ce3d0a..ee6df21 100644
--- a/test cases/common/13 pch/c/prog.c
+++ b/test cases/common/13 pch/c/prog.c
@@ -4,7 +4,7 @@ void func() {
fprintf(stdout, "This is a function that fails if stdio is not #included.\n");
}
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/13 pch/cpp/prog.cc b/test cases/common/13 pch/cpp/prog.cc
index ea258c6..7fa6253 100644
--- a/test cases/common/13 pch/cpp/prog.cc
+++ b/test cases/common/13 pch/cpp/prog.cc
@@ -5,7 +5,7 @@ void func() {
<< std::endl;
}
-int main(int argc, char **argv) {
+int main() {
func();
return 0;
}
diff --git a/test cases/common/13 pch/generated/prog.c b/test cases/common/13 pch/generated/prog.c
index 9b2e2ef..e1601c9 100644
--- a/test cases/common/13 pch/generated/prog.c
+++ b/test cases/common/13 pch/generated/prog.c
@@ -1,6 +1,6 @@
// No includes here, they need to come from the PCH
-int main(int argc, char **argv) {
+int main() {
return FOO + BAR;
}
diff --git a/test cases/common/13 pch/mixed/main.cc b/test cases/common/13 pch/mixed/main.cc
index 44d049e..fb8932e 100644
--- a/test cases/common/13 pch/mixed/main.cc
+++ b/test cases/common/13 pch/mixed/main.cc
@@ -5,6 +5,6 @@ void func() {
<< std::endl;
}
-int main(int argc, char **argv) {
+int main() {
return cfunc();
}
diff --git a/test cases/common/13 pch/userDefined/prog.c b/test cases/common/13 pch/userDefined/prog.c
index eb068d9..c7b713a 100644
--- a/test cases/common/13 pch/userDefined/prog.c
+++ b/test cases/common/13 pch/userDefined/prog.c
@@ -1,6 +1,6 @@
// No includes here, they need to come from the PCH
-int main(int argc, char **argv) {
+int main() {
// Method is implemented in pch.c.
// This makes sure that we can properly handle user defined
// pch implementation files and not only auto-generated ones.
diff --git a/test cases/common/13 pch/withIncludeDirectories/prog.c b/test cases/common/13 pch/withIncludeDirectories/prog.c
index 0ce3d0a..ee6df21 100644
--- a/test cases/common/13 pch/withIncludeDirectories/prog.c
+++ b/test cases/common/13 pch/withIncludeDirectories/prog.c
@@ -4,7 +4,7 @@ void func() {
fprintf(stdout, "This is a function that fails if stdio is not #included.\n");
}
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/130 generated llvm ir/main.c b/test cases/common/130 generated llvm ir/main.c
index 97fe723..887c64a 100644
--- a/test cases/common/130 generated llvm ir/main.c
+++ b/test cases/common/130 generated llvm ir/main.c
@@ -2,8 +2,7 @@
unsigned square_unsigned (unsigned a);
-int
-main (int argc, char * argv[])
+int main ()
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {
diff --git a/test cases/common/131 generated assembly/main.c b/test cases/common/131 generated assembly/main.c
index b669cba..708eeb5 100644
--- a/test cases/common/131 generated assembly/main.c
+++ b/test cases/common/131 generated assembly/main.c
@@ -5,8 +5,7 @@
#endif
unsigned square_unsigned (unsigned a);
-int
-main (int argc, char * argv[])
+int main ()
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {
diff --git a/test cases/common/132 build by default targets in tests/main.c b/test cases/common/132 build by default targets in tests/main.c
index 63a62a1..49e3a51 100644
--- a/test cases/common/132 build by default targets in tests/main.c
+++ b/test cases/common/132 build by default targets in tests/main.c
@@ -1,3 +1,3 @@
-int main (int argc, char *argv[]) {
+int main () {
return 0;
}
diff --git a/test cases/common/133 build by default/foo.c b/test cases/common/133 build by default/foo.c
index ca97916..0e6f7a0 100644
--- a/test cases/common/133 build by default/foo.c
+++ b/test cases/common/133 build by default/foo.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("Existentialism.\n");
return 0;
}
diff --git a/test cases/common/134 include order/ordertest.c b/test cases/common/134 include order/ordertest.c
index 0d9173f..a5896b4 100644
--- a/test cases/common/134 include order/ordertest.c
+++ b/test cases/common/134 include order/ordertest.c
@@ -4,8 +4,7 @@
#error "Should have picked up hdr.h from inc1/hdr.h"
#endif
-int
-main (int c, char ** argv)
+int main ()
{
return 0;
}
diff --git a/test cases/common/134 include order/sub4/main.c b/test cases/common/134 include order/sub4/main.c
index 0b25eed..77417dd 100644
--- a/test cases/common/134 include order/sub4/main.c
+++ b/test cases/common/134 include order/sub4/main.c
@@ -1,7 +1,7 @@
/* Use the <> include notation to force searching in include directories */
#include <main.h>
-int main(int argc, char *argv[]) {
+int main() {
if (somefunc() == 1984)
return 0;
return 1;
diff --git a/test cases/common/135 override options/four.c b/test cases/common/135 override options/four.c
index 54f8491..2ab126d 100644
--- a/test cases/common/135 override options/four.c
+++ b/test cases/common/135 override options/four.c
@@ -4,6 +4,6 @@ static int duplicate_func() {
return -4;
}
-int main(int argc, char **argv) {
+int main() {
return duplicate_func() + func();
}
diff --git a/test cases/common/135 override options/two.c b/test cases/common/135 override options/two.c
index 04b1d3f..f3082a6 100644
--- a/test cases/common/135 override options/two.c
+++ b/test cases/common/135 override options/two.c
@@ -1,6 +1,6 @@
/*
* Requires a Unity build. Otherwise hidden_func is not specified.
*/
-int main(int argc, char **argv) {
+int main() {
return hidden_func();
}
diff --git a/test cases/common/137 c cpp and asm/main.c b/test cases/common/137 c cpp and asm/main.c
index 8976723..66985ed 100644
--- a/test cases/common/137 c cpp and asm/main.c
+++ b/test cases/common/137 c cpp and asm/main.c
@@ -2,7 +2,7 @@
int get_retval(void);
-int main(int argc, char **argv) {
+int main() {
printf("C seems to be working.\n");
return get_retval();
}
diff --git a/test cases/common/137 c cpp and asm/main.cpp b/test cases/common/137 c cpp and asm/main.cpp
index c089870..2abd084 100644
--- a/test cases/common/137 c cpp and asm/main.cpp
+++ b/test cases/common/137 c cpp and asm/main.cpp
@@ -5,7 +5,7 @@ extern "C" {
int get_cval(void);
}
-int main(int argc, char **argv) {
+int main() {
std::cout << "C++ seems to be working." << std::endl;
return get_retval();
}
diff --git a/test cases/common/138 compute int/prog.c.in b/test cases/common/138 compute int/prog.c.in
index ff1ad55..e78a98c 100644
--- a/test cases/common/138 compute int/prog.c.in
+++ b/test cases/common/138 compute int/prog.c.in
@@ -4,7 +4,7 @@
#include <limits.h>
#include "foobar.h"
-int main(int argc, char **argv) {
+int main() {
if(INTSIZE != sizeof(int)) {
fprintf(stderr, "Mismatch: computed int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int));
return 1;
diff --git a/test cases/common/139 custom target object output/progdir/prog.c b/test cases/common/139 custom target object output/progdir/prog.c
index c1ece33..d2648bb 100644
--- a/test cases/common/139 custom target object output/progdir/prog.c
+++ b/test cases/common/139 custom target object output/progdir/prog.c
@@ -1,5 +1,5 @@
int func1_in_obj();
-int main(int argc, char **argv) {
+int main() {
return func1_in_obj();
}
diff --git a/test cases/common/14 configure file/dumpprog.c b/test cases/common/14 configure file/dumpprog.c
index 39a215e..80410f2 100644
--- a/test cases/common/14 configure file/dumpprog.c
+++ b/test cases/common/14 configure file/dumpprog.c
@@ -15,7 +15,7 @@
#define stringify(s) str(s)
#define str(s) #s
-int main(int argc, char **argv) {
+int main() {
#if !(SHOULD_BE_UNQUOTED_STRING == string)
printf("String token (unquoted) defined wrong.\n");
return 1;
diff --git a/test cases/common/14 configure file/prog.c b/test cases/common/14 configure file/prog.c
index 89a718e..332e3bb 100644
--- a/test cases/common/14 configure file/prog.c
+++ b/test cases/common/14 configure file/prog.c
@@ -8,7 +8,7 @@
#error "FAIL!"
#endif
-int main(int argc, char **argv) {
+int main() {
#ifndef BE_TRUE
return 1;
#else
diff --git a/test cases/common/14 configure file/prog2.c b/test cases/common/14 configure file/prog2.c
index a88c70f..2aff40c 100644
--- a/test cases/common/14 configure file/prog2.c
+++ b/test cases/common/14 configure file/prog2.c
@@ -1,5 +1,5 @@
#include<config2.h>
-int main(int argc, char **argv) {
+int main() {
return ZERO_RESULT;
}
diff --git a/test cases/common/14 configure file/prog4.c b/test cases/common/14 configure file/prog4.c
index 92dc7cb..7ee4f49 100644
--- a/test cases/common/14 configure file/prog4.c
+++ b/test cases/common/14 configure file/prog4.c
@@ -1,6 +1,6 @@
#include <config4a.h>
#include <config4b.h>
-int main(int argc, char **argv) {
+int main() {
return RESULTA + RESULTB;
}
diff --git a/test cases/common/14 configure file/prog5.c b/test cases/common/14 configure file/prog5.c
index 42c08f9..f387530 100644
--- a/test cases/common/14 configure file/prog5.c
+++ b/test cases/common/14 configure file/prog5.c
@@ -1,6 +1,6 @@
#include <string.h>
#include <config5.h>
-int main(int argc, char **argv) {
+int main() {
return strcmp(MESSAGE, "@var2@");
}
diff --git a/test cases/common/14 configure file/prog6.c b/test cases/common/14 configure file/prog6.c
index 7412404..eecd63e 100644
--- a/test cases/common/14 configure file/prog6.c
+++ b/test cases/common/14 configure file/prog6.c
@@ -1,7 +1,7 @@
#include <string.h>
#include <config6.h>
-int main(int argc, char **argv) {
+int main() {
return strcmp(MESSAGE1, "foo")
|| strcmp(MESSAGE2, "@var1@")
|| strcmp(MESSAGE3, "\\foo")
diff --git a/test cases/common/14 configure file/prog7.c b/test cases/common/14 configure file/prog7.c
index 0bb7d13..a0e6f75 100644
--- a/test cases/common/14 configure file/prog7.c
+++ b/test cases/common/14 configure file/prog7.c
@@ -1,7 +1,7 @@
#include <string.h>
#include <config7.h>
-int main(int argc, char **argv) {
+int main() {
return strcmp(MESSAGE1, "foo")
|| strcmp(MESSAGE2, "${var1}")
|| strcmp(MESSAGE3, "\\foo")
diff --git a/test cases/common/14 configure file/prog9.c b/test cases/common/14 configure file/prog9.c
index 28c7354..7180a26 100644
--- a/test cases/common/14 configure file/prog9.c
+++ b/test cases/common/14 configure file/prog9.c
@@ -10,7 +10,7 @@
#error "Should be defined"
#endif
-int main(int argc, char **argv) {
+int main() {
return strcmp(A_STRING, "foo")
|| strcmp(B_STRING, "foo")
|| A_INT != 42
diff --git a/test cases/common/141 whole archive/prog.c b/test cases/common/141 whole archive/prog.c
index 9111ad4..c6eb045 100644
--- a/test cases/common/141 whole archive/prog.c
+++ b/test cases/common/141 whole archive/prog.c
@@ -1,5 +1,5 @@
#include<mylib.h>
-int main(int argc, char **argv) {
+int main() {
return func1() - func2();
}
diff --git a/test cases/common/149 recursive linking/3rdorderdeps/main.c.in b/test cases/common/149 recursive linking/3rdorderdeps/main.c.in
index 8155f35..f5bc0b4 100644
--- a/test cases/common/149 recursive linking/3rdorderdeps/main.c.in
+++ b/test cases/common/149 recursive linking/3rdorderdeps/main.c.in
@@ -4,7 +4,7 @@
SYMBOL_IMPORT int get_@LIBTYPE@@DEPENDENCY@dep_value (void);
-int main(int argc, char *argv[]) {
+int main() {
int val;
val = get_@LIBTYPE@@DEPENDENCY@dep_value ();
diff --git a/test cases/common/149 recursive linking/circular/main.c b/test cases/common/149 recursive linking/circular/main.c
index 5f797a5..a419333 100644
--- a/test cases/common/149 recursive linking/circular/main.c
+++ b/test cases/common/149 recursive linking/circular/main.c
@@ -6,7 +6,7 @@ int get_st1_value (void);
int get_st2_value (void);
int get_st3_value (void);
-int main(int argc, char *argv[]) {
+int main() {
int val;
val = get_st1_value ();
diff --git a/test cases/common/149 recursive linking/edge-cases/shstmain.c b/test cases/common/149 recursive linking/edge-cases/shstmain.c
index b44c55f..6598c72 100644
--- a/test cases/common/149 recursive linking/edge-cases/shstmain.c
+++ b/test cases/common/149 recursive linking/edge-cases/shstmain.c
@@ -4,7 +4,7 @@
int get_stshdep_value (void);
-int main(int argc, char *argv[]) {
+int main() {
int val;
val = get_stshdep_value ();
diff --git a/test cases/common/149 recursive linking/edge-cases/stomain.c b/test cases/common/149 recursive linking/edge-cases/stomain.c
index 90208a7..544ece9 100644
--- a/test cases/common/149 recursive linking/edge-cases/stomain.c
+++ b/test cases/common/149 recursive linking/edge-cases/stomain.c
@@ -4,7 +4,7 @@
int get_stodep_value (void);
-int main(int argc, char *argv[]) {
+int main() {
int val;
val = get_stodep_value ();
diff --git a/test cases/common/149 recursive linking/main.c b/test cases/common/149 recursive linking/main.c
index 0851611..2ddcb88 100644
--- a/test cases/common/149 recursive linking/main.c
+++ b/test cases/common/149 recursive linking/main.c
@@ -9,7 +9,7 @@ SYMBOL_IMPORT int get_shnodep_value (void);
SYMBOL_IMPORT int get_shshdep_value (void);
SYMBOL_IMPORT int get_shstdep_value (void);
-int main(int argc, char *argv[]) {
+int main() {
int val;
val = get_shnodep_value ();
diff --git a/test cases/common/15 if/prog.c b/test cases/common/15 if/prog.c
index 0314ff1..76e8197 100644
--- a/test cases/common/15 if/prog.c
+++ b/test cases/common/15 if/prog.c
@@ -1 +1 @@
-int main(int argc, char **argv) { return 0; }
+int main() { return 0; }
diff --git a/test cases/common/151 simd/simdchecker.c b/test cases/common/151 simd/simdchecker.c
index cd6fe4f..3593828 100644
--- a/test cases/common/151 simd/simdchecker.c
+++ b/test cases/common/151 simd/simdchecker.c
@@ -23,7 +23,7 @@ int check_simd_implementation(float *four,
return rv;
}
-int main(int argc, char **argv) {
+int main() {
static const float four_initial[4] = {2.0, 3.0, 4.0, 5.0};
ALIGN_16 float four[4];
const float expected[4] = {3.0, 4.0, 5.0, 6.0};
diff --git a/test cases/common/152 shared module resolving symbol in executable/prog.c b/test cases/common/152 shared module resolving symbol in executable/prog.c
index 746c192..b2abcdb 100644
--- a/test cases/common/152 shared module resolving symbol in executable/prog.c
+++ b/test cases/common/152 shared module resolving symbol in executable/prog.c
@@ -25,12 +25,13 @@ func_from_executable(void)
return 42;
}
-int
-main (int argc, char **argv)
+int main(int argc, char **argv)
{
int expected, actual;
fptr importedfunc;
+ if (argc=0) {}; // noop
+
#ifdef _WIN32
HMODULE h = LoadLibraryA(argv[1]);
#else
diff --git a/test cases/common/153 dotinclude/dotproc.c b/test cases/common/153 dotinclude/dotproc.c
index 5e65f7b..d8f3829 100644
--- a/test cases/common/153 dotinclude/dotproc.c
+++ b/test cases/common/153 dotinclude/dotproc.c
@@ -4,7 +4,7 @@
#error The wrapper stdio.h was not included.
#endif
-int main(int argc, char **argv) {
+int main() {
printf("Eventually I got printed.\n");
return 0;
}
diff --git a/test cases/common/154 reserved targets/test.c b/test cases/common/154 reserved targets/test.c
index 0fb4389..4cce7f6 100644
--- a/test cases/common/154 reserved targets/test.c
+++ b/test cases/common/154 reserved targets/test.c
@@ -1,3 +1,3 @@
-int main(int argc, char *argv[]) {
+int main() {
return 0;
}
diff --git a/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c b/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c
index 56f61a8..dc14736 100644
--- a/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c
+++ b/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("Do not have a file layout like this in your own projects.\n");
printf("This is only to test that this works.\n");
return 0;
diff --git a/test cases/common/157 wrap file should not failed/src/subprojects/prog.c b/test cases/common/157 wrap file should not failed/src/subprojects/prog.c
index 56f61a8..dc14736 100644
--- a/test cases/common/157 wrap file should not failed/src/subprojects/prog.c
+++ b/test cases/common/157 wrap file should not failed/src/subprojects/prog.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("Do not have a file layout like this in your own projects.\n");
printf("This is only to test that this works.\n");
return 0;
diff --git a/test cases/common/158 includedir subproj/prog.c b/test cases/common/158 includedir subproj/prog.c
index 772681e..f388ef8 100644
--- a/test cases/common/158 includedir subproj/prog.c
+++ b/test cases/common/158 includedir subproj/prog.c
@@ -1,4 +1,4 @@
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/159 subproject dir name collision/a.c b/test cases/common/159 subproject dir name collision/a.c
index 6ed96fa..db85d41 100644
--- a/test cases/common/159 subproject dir name collision/a.c
+++ b/test cases/common/159 subproject dir name collision/a.c
@@ -2,7 +2,7 @@
char func_b();
char func_c();
-int main(int argc, char **argv) {
+int main() {
if(func_b() != 'b') {
return 1;
}
diff --git a/test cases/common/16 else/prog.c b/test cases/common/16 else/prog.c
index 0314ff1..76e8197 100644
--- a/test cases/common/16 else/prog.c
+++ b/test cases/common/16 else/prog.c
@@ -1 +1 @@
-int main(int argc, char **argv) { return 0; }
+int main() { return 0; }
diff --git a/test cases/common/17 comparison/prog.c b/test cases/common/17 comparison/prog.c
index 0314ff1..76e8197 100644
--- a/test cases/common/17 comparison/prog.c
+++ b/test cases/common/17 comparison/prog.c
@@ -1 +1 @@
-int main(int argc, char **argv) { return 0; }
+int main() { return 0; }
diff --git a/test cases/common/170 get project license/bar.c b/test cases/common/170 get project license/bar.c
index 864869b..cc34d94 100644
--- a/test cases/common/170 get project license/bar.c
+++ b/test cases/common/170 get project license/bar.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I'm a main project bar.\n");
return 0;
}
diff --git a/test cases/common/172 subproject nested subproject dirs/prog.c b/test cases/common/172 subproject nested subproject dirs/prog.c
index 394f139..0bb5253 100644
--- a/test cases/common/172 subproject nested subproject dirs/prog.c
+++ b/test cases/common/172 subproject nested subproject dirs/prog.c
@@ -1,5 +1,5 @@
int func();
-int main(int argc, char **argv) {
+int main() {
return func() == 42 ? 0 : 1;
}
diff --git a/test cases/common/173 preserve gendir/testprog.c b/test cases/common/173 preserve gendir/testprog.c
index 46b4602..4484f22 100644
--- a/test cases/common/173 preserve gendir/testprog.c
+++ b/test cases/common/173 preserve gendir/testprog.c
@@ -1,6 +1,6 @@
#include"base.h"
#include"com/mesonbuild/subbie.h"
-int main(int argc, char **argv) {
+int main() {
return base() + subbie();
}
diff --git a/test cases/common/174 source in dep/generated/main.c b/test cases/common/174 source in dep/generated/main.c
index 07e7c93..75203cb 100644
--- a/test cases/common/174 source in dep/generated/main.c
+++ b/test cases/common/174 source in dep/generated/main.c
@@ -1,5 +1,5 @@
#include"funheader.h"
-int main(int argc, char **argv) {
+int main() {
return my_wonderful_function() != 42;
}
diff --git a/test cases/common/18 array/prog.c b/test cases/common/18 array/prog.c
index ad58a0b..faad956 100644
--- a/test cases/common/18 array/prog.c
+++ b/test cases/common/18 array/prog.c
@@ -1,3 +1,3 @@
extern int func();
-int main(int argc, char **argv) { return func(); }
+int main() { return func(); }
diff --git a/test cases/common/183 bothlibraries/main.c b/test cases/common/183 bothlibraries/main.c
index 03a8e02..b02e048 100644
--- a/test cases/common/183 bothlibraries/main.c
+++ b/test cases/common/183 bothlibraries/main.c
@@ -3,6 +3,6 @@
DO_IMPORT int func();
DO_IMPORT int retval;
-int main(int argc, char **arg) {
+int main() {
return func() == retval ? 0 : 1;
}
diff --git a/test cases/common/187 find override/otherdir/main.c b/test cases/common/187 find override/otherdir/main.c
index 2cef67c..c442282 100644
--- a/test cases/common/187 find override/otherdir/main.c
+++ b/test cases/common/187 find override/otherdir/main.c
@@ -1,5 +1,5 @@
int be_seeing_you();
-int main(int argc, char **argv) {
+int main() {
return be_seeing_you() == 6 ? 0 : 1;
}
diff --git a/test cases/common/187 find override/otherdir/main2.c b/test cases/common/187 find override/otherdir/main2.c
index 6d71688..e1f00c9 100644
--- a/test cases/common/187 find override/otherdir/main2.c
+++ b/test cases/common/187 find override/otherdir/main2.c
@@ -1,5 +1,5 @@
int number_returner();
-int main(int argc, char **argv) {
+int main() {
return number_returner() == 100 ? 0 : 1;
}
diff --git a/test cases/common/19 includedir/src/prog.c b/test cases/common/19 includedir/src/prog.c
index c26b9b3..eb9e2e2 100644
--- a/test cases/common/19 includedir/src/prog.c
+++ b/test cases/common/19 includedir/src/prog.c
@@ -1,5 +1,5 @@
#include "func.h"
-int main(int argc, char **argv) {
+int main() {
return func();
}
diff --git a/test cases/common/195 install_mode/trivial.c b/test cases/common/195 install_mode/trivial.c
index 24ac454..38b58cc 100644
--- a/test cases/common/195 install_mode/trivial.c
+++ b/test cases/common/195 install_mode/trivial.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("Trivial test is working.\n");
return 0;
}
diff --git a/test cases/common/2 cpp/trivial.cc b/test cases/common/2 cpp/trivial.cc
index 8aa907b..c5ade72 100644
--- a/test cases/common/2 cpp/trivial.cc
+++ b/test cases/common/2 cpp/trivial.cc
@@ -1,6 +1,6 @@
#include<iostream>
-int main(int argc, char **argv) {
+int main() {
std::cout << "C++ seems to be working." << std::endl;
return 0;
}
diff --git a/test cases/common/20 header in file list/prog.c b/test cases/common/20 header in file list/prog.c
index fbedab8..a9216a6 100644
--- a/test cases/common/20 header in file list/prog.c
+++ b/test cases/common/20 header in file list/prog.c
@@ -1,3 +1,3 @@
#include "header.h"
-int main(int argc, char **argv) { return 0; }
+int main() { return 0; }
diff --git a/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c b/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c
index 58867ad..5ea0cb3 100644
--- a/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c
+++ b/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c
@@ -1,5 +1,5 @@
#include"subbie.h"
-int main(int argc, char **argv) {
+int main() {
return subbie();
}
diff --git a/test cases/common/201 override with exe/subprojects/sub/foobar.c b/test cases/common/201 override with exe/subprojects/sub/foobar.c
index 030ac49..c21d450 100644
--- a/test cases/common/201 override with exe/subprojects/sub/foobar.c
+++ b/test cases/common/201 override with exe/subprojects/sub/foobar.c
@@ -2,6 +2,7 @@
#include <stdio.h>
int main(int argc, char* argv[]) {
+ assert(argc == 2);
FILE *f = fopen(argv[1], "w");
const char msg[] = "int main(void) {return 0;}\n";
size_t w = fwrite(msg, 1, sizeof(msg) - 1, f);
diff --git a/test cases/common/202 subproject with features/nothing.c b/test cases/common/202 subproject with features/nothing.c
index 77750c2..5bc5493 100644
--- a/test cases/common/202 subproject with features/nothing.c
+++ b/test cases/common/202 subproject with features/nothing.c
@@ -1,4 +1,4 @@
-int main(int argc, char const *argv[])
+int main()
{
return 0;
} \ No newline at end of file
diff --git a/test cases/common/207 kwarg entry/prog.c b/test cases/common/207 kwarg entry/prog.c
index 0c57f66..6d1e2f9 100644
--- a/test cases/common/207 kwarg entry/prog.c
+++ b/test cases/common/207 kwarg entry/prog.c
@@ -1,7 +1,7 @@
#include<prog.h>
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf(MESSAGE);
return 0;
}
diff --git a/test cases/common/21 global arg/prog.c b/test cases/common/21 global arg/prog.c
index 74d11aa..9c4660b 100644
--- a/test cases/common/21 global arg/prog.c
+++ b/test cases/common/21 global arg/prog.c
@@ -38,6 +38,6 @@
#endif
#endif
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/21 global arg/prog.cc b/test cases/common/21 global arg/prog.cc
index 0ffd85e..9a18362 100644
--- a/test cases/common/21 global arg/prog.cc
+++ b/test cases/common/21 global arg/prog.cc
@@ -10,6 +10,6 @@
#error "Global argument not set"
#endif
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/215 link custom/prog.c b/test cases/common/215 link custom/prog.c
index eaede6d..22487c5 100644
--- a/test cases/common/215 link custom/prog.c
+++ b/test cases/common/215 link custom/prog.c
@@ -1,6 +1,6 @@
void flob();
-int main(int argc, char **argv) {
+int main() {
flob();
return 0;
}
diff --git a/test cases/common/216 link custom_i single from multiple/prog.c b/test cases/common/216 link custom_i single from multiple/prog.c
index 8013034..7826d74 100644
--- a/test cases/common/216 link custom_i single from multiple/prog.c
+++ b/test cases/common/216 link custom_i single from multiple/prog.c
@@ -1,5 +1,5 @@
int flob();
-int main(int argc, char **argv) {
+int main() {
return (flob() == 1 ? 0 : 1);
}
diff --git a/test cases/common/217 link custom_i multiple from multiple/prog.c b/test cases/common/217 link custom_i multiple from multiple/prog.c
index 51effe6..3476899 100644
--- a/test cases/common/217 link custom_i multiple from multiple/prog.c
+++ b/test cases/common/217 link custom_i multiple from multiple/prog.c
@@ -1,7 +1,7 @@
void flob_1();
void flob_2();
-int main(int argc, char **argv) {
+int main() {
flob_1();
flob_2();
return 0;
diff --git a/test cases/common/22 target arg/prog.cc b/test cases/common/22 target arg/prog.cc
index d1893ba..4a3aa1f 100644
--- a/test cases/common/22 target arg/prog.cc
+++ b/test cases/common/22 target arg/prog.cc
@@ -8,6 +8,6 @@
extern "C" int func();
-int main(int argc, char **argv) {
+int main() {
return func();
}
diff --git a/test cases/common/22 target arg/prog2.cc b/test cases/common/22 target arg/prog2.cc
index ef2fc4b..8158d14 100644
--- a/test cases/common/22 target arg/prog2.cc
+++ b/test cases/common/22 target arg/prog2.cc
@@ -8,6 +8,6 @@
extern "C" int func();
-int main(int argc, char **argv) {
+int main() {
return func();
}
diff --git a/test cases/common/227 fs module/meson.build b/test cases/common/227 fs module/meson.build
index 515b3e2..3c452d0 100644
--- a/test cases/common/227 fs module/meson.build
+++ b/test cases/common/227 fs module/meson.build
@@ -1,11 +1,13 @@
project('fs module test')
+is_windows = build_machine.system() == 'windows'
+
fs = import('fs')
assert(fs.exists('meson.build'), 'Existing file reported as missing.')
assert(not fs.exists('nonexisting'), 'Nonexisting file was found.')
-if build_machine.system() != 'windows' and build_machine.system() != 'cygwin'
+if not is_windows and build_machine.system() != 'cygwin'
assert(fs.is_symlink('a_symlink'), 'Symlink not detected.')
assert(not fs.is_symlink('meson.build'), 'Regular file detected as symlink.')
endif
@@ -18,4 +20,53 @@ assert(fs.is_dir('subprojects'), 'Dir not detected correctly.')
assert(not fs.is_dir('meson.build'), 'File detected as a dir.')
assert(not fs.is_dir('nonexisting'), 'Bad path detected as a dir.')
+assert(fs.is_dir('~'), 'expanduser not working')
+assert(not fs.is_file('~'), 'expanduser not working')
+
+original = 'foo.txt'
+new = fs.replace_suffix(original, '.ini')
+assert(new == 'foo.ini', 'replace_suffix failed')
+
+original = 'foo'
+new = fs.replace_suffix(original, '.ini')
+assert(new == 'foo.ini', 'replace_suffix did not add suffix to suffixless file')
+
+original = 'foo.dll.a'
+new = fs.replace_suffix(original, '.so')
+assert(new == 'foo.dll.so', 'replace_suffix did not only modify last suffix')
+
+original = 'foo.dll'
+new = fs.replace_suffix(original, '')
+assert(new == 'foo', 'replace_suffix did not only delete last suffix')
+
+# `/` on windows is interpreted like `.drive` which in general may not be `c:/`
+# the files need not exist for fs.replace_suffix()
+original = is_windows ? 'j:/foo/bar.txt' : '/foo/bar.txt'
+new_check = is_windows ? 'j:\\foo\\bar.ini' : '/foo/bar.ini'
+
+new = fs.replace_suffix(original, '.ini')
+assert(new == new_check, 'absolute path replace_suffix failed')
+
+# -- hash
+
+md5 = fs.hash('subdir/subdirfile.txt', 'md5')
+sha256 = fs.hash('subdir/subdirfile.txt', 'sha256')
+assert(md5 == 'd0795db41614d25affdd548314b30b3b', 'md5sum did not match')
+assert(sha256 == 'be2170b0dae535b73f6775694fffa3fd726a43b5fabea11b7342f0605917a42a', 'sha256sum did not match')
+
+# -- size
+
+size = fs.size('subdir/subdirfile.txt')
+assert(size == 19, 'file size not found correctly')
+
+# -- are filenames referring to the same file?
+f1 = 'meson.build'
+f2 = 'subdir/../meson.build'
+assert(fs.samefile(f1, f2), 'samefile not realized')
+assert(not fs.samefile(f1, 'subdir/subdirfile.txt'), 'samefile known bad comparison')
+
+if not is_windows and build_machine.system() != 'cygwin'
+ assert(fs.samefile('a_symlink', 'meson.build'), 'symlink samefile fail')
+endif
+
subdir('subdir')
diff --git a/test cases/common/23 object extraction/main.c b/test cases/common/23 object extraction/main.c
index 394f139..0bb5253 100644
--- a/test cases/common/23 object extraction/main.c
+++ b/test cases/common/23 object extraction/main.c
@@ -1,5 +1,5 @@
int func();
-int main(int argc, char **argv) {
+int main() {
return func() == 42 ? 0 : 1;
}
diff --git a/test cases/common/24 endian/prog.c b/test cases/common/24 endian/prog.c
index b2a10d0..b598b7a 100644
--- a/test cases/common/24 endian/prog.c
+++ b/test cases/common/24 endian/prog.c
@@ -8,7 +8,7 @@ int is_big_endian(void) {
}
-int main(int argc, char **argv) {
+int main() {
int is_be_check = is_big_endian();
int is_be;
#ifdef IS_BE
diff --git a/test cases/common/26 config subdir/src/prog.c b/test cases/common/26 config subdir/src/prog.c
index 4c03c20..15a10d1 100644
--- a/test cases/common/26 config subdir/src/prog.c
+++ b/test cases/common/26 config subdir/src/prog.c
@@ -1,5 +1,5 @@
#include "config.h"
-int main(int argc, char **argv) {
+int main() {
return RETURN_VALUE;
}
diff --git a/test cases/common/27 pipeline/depends/filecopier.c b/test cases/common/27 pipeline/depends/filecopier.c
index 9001cf3..e10e4e7 100644
--- a/test cases/common/27 pipeline/depends/filecopier.c
+++ b/test cases/common/27 pipeline/depends/filecopier.c
@@ -9,6 +9,7 @@ int main(int argc, char **argv) {
size_t num_written;
FILE *fin = fopen(argv[1], "rb");
FILE *fout;
+ assert(argc>0);
assert(fin);
num_read = fread(buffer, 1, BUFSIZE, fin);
assert(num_read > 0);
diff --git a/test cases/common/27 pipeline/depends/prog.c b/test cases/common/27 pipeline/depends/prog.c
index f4a7dd3..f438a00 100644
--- a/test cases/common/27 pipeline/depends/prog.c
+++ b/test cases/common/27 pipeline/depends/prog.c
@@ -1,5 +1,5 @@
int func();
-int main(int argc, char **argv) {
+int main() {
return func() != 42;
}
diff --git a/test cases/common/27 pipeline/prog.c b/test cases/common/27 pipeline/prog.c
index 175a90d..458fc84 100644
--- a/test cases/common/27 pipeline/prog.c
+++ b/test cases/common/27 pipeline/prog.c
@@ -1,5 +1,5 @@
int func();
-int main(int argc, char **argv) {
+int main() {
return func();
}
diff --git a/test cases/common/27 pipeline/src/prog.c b/test cases/common/27 pipeline/src/prog.c
index 29396b9..e693d8a 100644
--- a/test cases/common/27 pipeline/src/prog.c
+++ b/test cases/common/27 pipeline/src/prog.c
@@ -1,6 +1,6 @@
#include"input_src.h"
-int main(int argc, char **argv) {
+int main() {
void *foo = printf;
if(foo) {
return 0;
diff --git a/test cases/common/28 find program/source.in b/test cases/common/28 find program/source.in
index 5c2fa9b..4cce7f6 100644
--- a/test cases/common/28 find program/source.in
+++ b/test cases/common/28 find program/source.in
@@ -1,3 +1,3 @@
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/29 multiline string/meson.build b/test cases/common/29 multiline string/meson.build
index 262cb15..8ed153c 100644
--- a/test cases/common/29 multiline string/meson.build
+++ b/test cases/common/29 multiline string/meson.build
@@ -26,7 +26,7 @@ endif
cc = meson.get_compiler('c')
prog = '''
-int main(int argc, char **argv) {
+int main() {
int num = 1;
printf("%d\n", num);
return 0;
diff --git a/test cases/common/32 sizeof/prog.c.in b/test cases/common/32 sizeof/prog.c.in
index 85b1229..99432f7 100644
--- a/test cases/common/32 sizeof/prog.c.in
+++ b/test cases/common/32 sizeof/prog.c.in
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <wchar.h>
-int main(int argc, char **argv) {
+int main() {
if(INTSIZE != sizeof(int)) {
fprintf(stderr, "Mismatch: detected int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int));
return 1;
diff --git a/test cases/common/33 define10/prog.c b/test cases/common/33 define10/prog.c
index 10e94f1..d13995b 100644
--- a/test cases/common/33 define10/prog.c
+++ b/test cases/common/33 define10/prog.c
@@ -1,7 +1,7 @@
#include<stdio.h>
#include"config.h"
-int main(int argc, char **argv) {
+int main() {
if(ONE != 1) {
fprintf(stderr, "ONE is not 1.\n");
return 1;
diff --git a/test cases/common/36 tryrun/error.c b/test cases/common/36 tryrun/error.c
index 80eeb5d..16db28e 100644
--- a/test cases/common/36 tryrun/error.c
+++ b/test cases/common/36 tryrun/error.c
@@ -1,3 +1,3 @@
-int main(int argc, char **argv) {
+int main() {
return 1;
}
diff --git a/test cases/common/36 tryrun/meson.build b/test cases/common/36 tryrun/meson.build
index c64446f..6682a33 100644
--- a/test cases/common/36 tryrun/meson.build
+++ b/test cases/common/36 tryrun/meson.build
@@ -12,19 +12,19 @@ else
endif
ok_code = '''#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("%s\n", "stdout");
fprintf(stderr, "%s\n", "stderr");
return 0;
}
'''
-error_code = '''int main(int argc, char **argv) {
+error_code = '''int main() {
return 1;
}
'''
-no_compile_code = '''int main(int argc, char **argv) {
+no_compile_code = '''int main() {
'''
INPUTS = [
diff --git a/test cases/common/36 tryrun/no_compile.c b/test cases/common/36 tryrun/no_compile.c
index 86b67ac..b3b753c 100644
--- a/test cases/common/36 tryrun/no_compile.c
+++ b/test cases/common/36 tryrun/no_compile.c
@@ -1 +1 @@
-int main(int argc, char **argv) {
+int main() {
diff --git a/test cases/common/36 tryrun/ok.c b/test cases/common/36 tryrun/ok.c
index 4111c74..0c987d9 100644
--- a/test cases/common/36 tryrun/ok.c
+++ b/test cases/common/36 tryrun/ok.c
@@ -1,5 +1,5 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("%s\n", "stdout");
fprintf(stderr, "%s\n", "stderr");
return 0;
diff --git a/test cases/common/44 test args/env2vars.c b/test cases/common/44 test args/env2vars.c
index 19250a8..f6c8ba3 100644
--- a/test cases/common/44 test args/env2vars.c
+++ b/test cases/common/44 test args/env2vars.c
@@ -2,7 +2,7 @@
#include<string.h>
#include<stdlib.h>
-int main(int argc, char **argv) {
+int main() {
if(strcmp(getenv("first"), "something-else") != 0) {
fprintf(stderr, "First envvar is wrong. %s\n", getenv("first"));
return 1;
diff --git a/test cases/common/44 test args/envvars.c b/test cases/common/44 test args/envvars.c
index 627e413..e40cc9b 100644
--- a/test cases/common/44 test args/envvars.c
+++ b/test cases/common/44 test args/envvars.c
@@ -2,7 +2,7 @@
#include<string.h>
#include<stdlib.h>
-int main(int argc, char **argv) {
+int main() {
if(strcmp(getenv("first"), "val1") != 0) {
fprintf(stderr, "First envvar is wrong. %s\n", getenv("first"));
return 1;
diff --git a/test cases/common/45 subproject/subprojects/sublib/simpletest.c b/test cases/common/45 subproject/subprojects/sublib/simpletest.c
index 3801a40..01d0f25 100644
--- a/test cases/common/45 subproject/subprojects/sublib/simpletest.c
+++ b/test cases/common/45 subproject/subprojects/sublib/simpletest.c
@@ -1,5 +1,5 @@
#include<subdefs.h>
-int main(int argc, char **argv) {
+int main() {
return subfunc() == 42 ? 0 : 1;
}
diff --git a/test cases/common/45 subproject/user.c b/test cases/common/45 subproject/user.c
index cfde532..ec34477 100644
--- a/test cases/common/45 subproject/user.c
+++ b/test cases/common/45 subproject/user.c
@@ -2,7 +2,7 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
int res;
printf("Calling into sublib now.\n");
res = subfunc();
diff --git a/test cases/common/48 custom install dirs/prog.c b/test cases/common/48 custom install dirs/prog.c
index 0f0061d..33c14ce 100644
--- a/test cases/common/48 custom install dirs/prog.c
+++ b/test cases/common/48 custom install dirs/prog.c
@@ -1,3 +1,3 @@
-int main(int argc, char **arv) {
+int main() {
return 0;
}
diff --git a/test cases/common/49 subproject subproject/prog.c b/test cases/common/49 subproject subproject/prog.c
index 394f139..0bb5253 100644
--- a/test cases/common/49 subproject subproject/prog.c
+++ b/test cases/common/49 subproject subproject/prog.c
@@ -1,5 +1,5 @@
int func();
-int main(int argc, char **argv) {
+int main() {
return func() == 42 ? 0 : 1;
}
diff --git a/test cases/common/5 linkstatic/main.c b/test cases/common/5 linkstatic/main.c
index 8aadb0c..458fc84 100644
--- a/test cases/common/5 linkstatic/main.c
+++ b/test cases/common/5 linkstatic/main.c
@@ -1,5 +1,5 @@
int func();
-int main(int argc, char **arg) {
+int main() {
return func();
}
diff --git a/test cases/common/50 same file name/prog.c b/test cases/common/50 same file name/prog.c
index 3441288..6e3628e 100644
--- a/test cases/common/50 same file name/prog.c
+++ b/test cases/common/50 same file name/prog.c
@@ -1,6 +1,6 @@
int func1();
int func2();
-int main(int argc, char **argv) {
+int main() {
return func1() - func2();
}
diff --git a/test cases/common/51 file grabber/prog.c b/test cases/common/51 file grabber/prog.c
index 3524f60..581b0e7 100644
--- a/test cases/common/51 file grabber/prog.c
+++ b/test cases/common/51 file grabber/prog.c
@@ -2,6 +2,6 @@ int funca();
int funcb();
int funcc();
-int main(int argc, char **argv) {
+int main() {
return funca() + funcb() + funcc();
}
diff --git a/test cases/common/51 file grabber/subdir/subprog.c b/test cases/common/51 file grabber/subdir/subprog.c
index 3524f60..581b0e7 100644
--- a/test cases/common/51 file grabber/subdir/subprog.c
+++ b/test cases/common/51 file grabber/subdir/subprog.c
@@ -2,6 +2,6 @@ int funca();
int funcb();
int funcc();
-int main(int argc, char **argv) {
+int main() {
return funca() + funcb() + funcc();
}
diff --git a/test cases/common/53 custom target chain/usetarget/myexe.c b/test cases/common/53 custom target chain/usetarget/myexe.c
index f9874fd..a5a13c3 100644
--- a/test cases/common/53 custom target chain/usetarget/myexe.c
+++ b/test cases/common/53 custom target chain/usetarget/myexe.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I am myexe.\n");
return 0;
}
diff --git a/test cases/common/55 object generator/prog.c b/test cases/common/55 object generator/prog.c
index 60459d6..09f2790 100644
--- a/test cases/common/55 object generator/prog.c
+++ b/test cases/common/55 object generator/prog.c
@@ -2,6 +2,6 @@ int func1_in_obj();
int func2_in_obj();
int func3_in_obj();
-int main(int argc, char **argv) {
+int main() {
return func1_in_obj() + func2_in_obj() + func3_in_obj();
}
diff --git a/test cases/common/56 install script/prog.c b/test cases/common/56 install script/prog.c
index 06bc6b1..1d32c26 100644
--- a/test cases/common/56 install script/prog.c
+++ b/test cases/common/56 install script/prog.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("This is text.\n");
return 0;
}
diff --git a/test cases/common/57 custom target source output/main.c b/test cases/common/57 custom target source output/main.c
index 2813c39..ca9909b 100644
--- a/test cases/common/57 custom target source output/main.c
+++ b/test cases/common/57 custom target source output/main.c
@@ -1,5 +1,5 @@
#include"mylib.h"
-int main(int argc, char **argv) {
+int main() {
return func();
}
diff --git a/test cases/common/58 exe static shared/prog.c b/test cases/common/58 exe static shared/prog.c
index 26603b6..b1dbe14 100644
--- a/test cases/common/58 exe static shared/prog.c
+++ b/test cases/common/58 exe static shared/prog.c
@@ -1,7 +1,7 @@
int shlibfunc2();
int statlibfunc();
-int main(int argc, char **argv) {
+int main() {
if (statlibfunc() != 42)
return 1;
if (shlibfunc2() != 24)
diff --git a/test cases/common/6 linkshared/cppmain.cpp b/test cases/common/6 linkshared/cppmain.cpp
index b2e4025..a7e27db 100644
--- a/test cases/common/6 linkshared/cppmain.cpp
+++ b/test cases/common/6 linkshared/cppmain.cpp
@@ -1,5 +1,5 @@
int cppfunc();
-int main(int argc, char **argv) {
+int main() {
return cppfunc() != 42;
}
diff --git a/test cases/common/6 linkshared/main.c b/test cases/common/6 linkshared/main.c
index 12f9c98..ff5a732 100644
--- a/test cases/common/6 linkshared/main.c
+++ b/test cases/common/6 linkshared/main.c
@@ -6,6 +6,6 @@
int DLL_IMPORT func();
-int main(int argc, char **arg) {
+int main() {
return func();
}
diff --git a/test cases/common/60 custom header generator/prog.c b/test cases/common/60 custom header generator/prog.c
index 184973a..2d071af 100644
--- a/test cases/common/60 custom header generator/prog.c
+++ b/test cases/common/60 custom header generator/prog.c
@@ -1,5 +1,5 @@
#include"myheader.lh"
-int main(int argc, char **argv) {
+int main() {
return RET_VAL;
}
diff --git a/test cases/common/61 multiple generators/main.cpp b/test cases/common/61 multiple generators/main.cpp
index 5277063..82027c8 100644
--- a/test cases/common/61 multiple generators/main.cpp
+++ b/test cases/common/61 multiple generators/main.cpp
@@ -1,6 +1,6 @@
#include"source1.h"
#include"source2.h"
-int main(int argc, char **argv) {
+int main() {
return func1() + func2();
}
diff --git a/test cases/common/63 foreach/prog1.c b/test cases/common/63 foreach/prog1.c
index a5ef0f1..30c67df 100644
--- a/test cases/common/63 foreach/prog1.c
+++ b/test cases/common/63 foreach/prog1.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("This is test #1.\n");
return 0;
}
diff --git a/test cases/common/63 foreach/prog2.c b/test cases/common/63 foreach/prog2.c
index b9fddbe..c25a205 100644
--- a/test cases/common/63 foreach/prog2.c
+++ b/test cases/common/63 foreach/prog2.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("This is test #2.\n");
return 0;
}
diff --git a/test cases/common/63 foreach/prog3.c b/test cases/common/63 foreach/prog3.c
index 5657396..7bea76d 100644
--- a/test cases/common/63 foreach/prog3.c
+++ b/test cases/common/63 foreach/prog3.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("This is test #3.\n");
return 0;
}
diff --git a/test cases/common/68 build always/main.c b/test cases/common/68 build always/main.c
index f8d9ac9..3632ab8 100644
--- a/test cases/common/68 build always/main.c
+++ b/test cases/common/68 build always/main.c
@@ -1,7 +1,7 @@
#include<stdio.h>
#include"version.h"
-int main(int argc, char **argv) {
+int main() {
printf("Version is %s.\n", version_string);
return 0;
}
diff --git a/test cases/common/69 vcstag/tagprog.c b/test cases/common/69 vcstag/tagprog.c
index 34146b4..1c47e52 100644
--- a/test cases/common/69 vcstag/tagprog.c
+++ b/test cases/common/69 vcstag/tagprog.c
@@ -2,7 +2,7 @@
const char *vcstag;
-int main(int argc, char **argv) {
+int main() {
printf("Version is %s\n", vcstag);
return 0;
}
diff --git a/test cases/common/7 mixed/main.cc b/test cases/common/7 mixed/main.cc
index f165346..29c680f 100644
--- a/test cases/common/7 mixed/main.cc
+++ b/test cases/common/7 mixed/main.cc
@@ -2,6 +2,6 @@ extern "C" int func();
class BreakPlainCCompiler;
-int main(int argc, char **argv) {
+int main() {
return func();
}
diff --git a/test cases/common/71 should fail/failing.c b/test cases/common/71 should fail/failing.c
index adada8d..6346e2d 100644
--- a/test cases/common/71 should fail/failing.c
+++ b/test cases/common/71 should fail/failing.c
@@ -1,3 +1,3 @@
-int main(int argc, char **argv) {
+int main() {
return 1;
}
diff --git a/test cases/common/75 shared subproject/a.c b/test cases/common/75 shared subproject/a.c
index 6ed96fa..db85d41 100644
--- a/test cases/common/75 shared subproject/a.c
+++ b/test cases/common/75 shared subproject/a.c
@@ -2,7 +2,7 @@
char func_b();
char func_c();
-int main(int argc, char **argv) {
+int main() {
if(func_b() != 'b') {
return 1;
}
diff --git a/test cases/common/76 shared subproject 2/a.c b/test cases/common/76 shared subproject 2/a.c
index 6ed96fa..db85d41 100644
--- a/test cases/common/76 shared subproject 2/a.c
+++ b/test cases/common/76 shared subproject 2/a.c
@@ -2,7 +2,7 @@
char func_b();
char func_c();
-int main(int argc, char **argv) {
+int main() {
if(func_b() != 'b') {
return 1;
}
diff --git a/test cases/common/77 file object/prog.c b/test cases/common/77 file object/prog.c
index 884d678..c2b6e98 100644
--- a/test cases/common/77 file object/prog.c
+++ b/test cases/common/77 file object/prog.c
@@ -2,7 +2,7 @@
int func(); /* Files in different subdirs return different values. */
-int main(int argc, char **argv) {
+int main() {
if(func() == 0) {
printf("Iz success.\n");
} else {
diff --git a/test cases/common/77 file object/subdir1/prog.c b/test cases/common/77 file object/subdir1/prog.c
index 37ccf72..cba4b14 100644
--- a/test cases/common/77 file object/subdir1/prog.c
+++ b/test cases/common/77 file object/subdir1/prog.c
@@ -2,7 +2,7 @@
int func();
-int main(int argc, char **argv) {
+int main() {
if(func() == 1) {
printf("Iz success.\n");
} else {
diff --git a/test cases/common/77 file object/subdir2/prog.c b/test cases/common/77 file object/subdir2/prog.c
index 3a90b0a..124c98b 100644
--- a/test cases/common/77 file object/subdir2/prog.c
+++ b/test cases/common/77 file object/subdir2/prog.c
@@ -2,7 +2,7 @@
int func();
-int main(int argc, char **argv) {
+int main() {
if(func() == 2) {
printf("Iz success.\n");
} else {
diff --git a/test cases/common/78 custom subproject dir/a.c b/test cases/common/78 custom subproject dir/a.c
index 6ed96fa..db85d41 100644
--- a/test cases/common/78 custom subproject dir/a.c
+++ b/test cases/common/78 custom subproject dir/a.c
@@ -2,7 +2,7 @@
char func_b();
char func_c();
-int main(int argc, char **argv) {
+int main() {
if(func_b() != 'b') {
return 1;
}
diff --git a/test cases/common/8 install/prog.c b/test cases/common/8 install/prog.c
index 11b7fad..33c14ce 100644
--- a/test cases/common/8 install/prog.c
+++ b/test cases/common/8 install/prog.c
@@ -1,3 +1,3 @@
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/common/81 internal dependency/src/main.c b/test cases/common/81 internal dependency/src/main.c
index 7d50b05..137cc61 100644
--- a/test cases/common/81 internal dependency/src/main.c
+++ b/test cases/common/81 internal dependency/src/main.c
@@ -1,7 +1,7 @@
#include<stdio.h>
#include<proj1.h>
-int main(int argc, char **argv) {
+int main() {
printf("Now calling into library.\n");
proj1_func1();
proj1_func2();
diff --git a/test cases/common/82 same basename/exe1.c b/test cases/common/82 same basename/exe1.c
index 175a90d..458fc84 100644
--- a/test cases/common/82 same basename/exe1.c
+++ b/test cases/common/82 same basename/exe1.c
@@ -1,5 +1,5 @@
int func();
-int main(int argc, char **argv) {
+int main() {
return func();
}
diff --git a/test cases/common/82 same basename/exe2.c b/test cases/common/82 same basename/exe2.c
index 56b04cc..9dbb09d 100644
--- a/test cases/common/82 same basename/exe2.c
+++ b/test cases/common/82 same basename/exe2.c
@@ -1,5 +1,5 @@
int func();
-int main(int argc, char **argv) {
+int main() {
return func() == 1 ? 0 : 1;
}
diff --git a/test cases/common/83 declare dep/main.c b/test cases/common/83 declare dep/main.c
index 4ad9d2a..3c37f81 100644
--- a/test cases/common/83 declare dep/main.c
+++ b/test cases/common/83 declare dep/main.c
@@ -5,7 +5,7 @@
#error "Entity use flag not used for compilation."
#endif
-int main(int argc, char **argv) {
+int main() {
if(entity_func1() != 5) {
printf("Error in func1.\n");
return 1;
diff --git a/test cases/common/84 extract all/prog.c b/test cases/common/84 extract all/prog.c
index 57a4c64..48e7680 100644
--- a/test cases/common/84 extract all/prog.c
+++ b/test cases/common/84 extract all/prog.c
@@ -1,7 +1,7 @@
#include"extractor.h"
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
if((1+2+3+4) != (func1() + func2() + func3() + func4())) {
printf("Arithmetic is fail.\n");
return 1;
diff --git a/test cases/common/85 add language/prog.c b/test cases/common/85 add language/prog.c
index 9b5685f..bdd43ff 100644
--- a/test cases/common/85 add language/prog.c
+++ b/test cases/common/85 add language/prog.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I am plain C.\n");
return 0;
}
diff --git a/test cases/common/86 identical target name in subproject/bar.c b/test cases/common/86 identical target name in subproject/bar.c
index 864869b..cc34d94 100644
--- a/test cases/common/86 identical target name in subproject/bar.c
+++ b/test cases/common/86 identical target name in subproject/bar.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I'm a main project bar.\n");
return 0;
}
diff --git a/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c b/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c
index 106005e..6e72576 100644
--- a/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c
+++ b/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I'm a subproject bar.\n");
return 0;
}
diff --git a/test cases/common/89 private include/user/libuser.c b/test cases/common/89 private include/user/libuser.c
index a74a973..b72bb4d 100644
--- a/test cases/common/89 private include/user/libuser.c
+++ b/test cases/common/89 private include/user/libuser.c
@@ -1,6 +1,6 @@
#include"foo1.h"
#include"foo2.h"
-int main(int argc, char **argv) {
+int main() {
return foo1() + foo2();
}
diff --git a/test cases/common/93 selfbuilt custom/mainprog.cpp b/test cases/common/93 selfbuilt custom/mainprog.cpp
index dcf9d20..6255028 100644
--- a/test cases/common/93 selfbuilt custom/mainprog.cpp
+++ b/test cases/common/93 selfbuilt custom/mainprog.cpp
@@ -1,5 +1,5 @@
#include"data.h"
-int main(int, char **) {
+int main() {
return generated_function() != 52;
}
diff --git a/test cases/common/94 gen extra/plain.c b/test cases/common/94 gen extra/plain.c
index 3845aee..914de72 100644
--- a/test cases/common/94 gen extra/plain.c
+++ b/test cases/common/94 gen extra/plain.c
@@ -1,5 +1,5 @@
int bob_mcbob();
-int main(int argc, char **argv) {
+int main() {
return bob_mcbob();
}
diff --git a/test cases/common/94 gen extra/upper.c b/test cases/common/94 gen extra/upper.c
index 44f8ad7..dad78fc 100644
--- a/test cases/common/94 gen extra/upper.c
+++ b/test cases/common/94 gen extra/upper.c
@@ -1,5 +1,5 @@
int BOB_MCBOB();
-int main(int argc, char **argv) {
+int main() {
return BOB_MCBOB();
}
diff --git a/test cases/common/95 benchmark/delayer.c b/test cases/common/95 benchmark/delayer.c
index cfcedad..c8da7ae 100644
--- a/test cases/common/95 benchmark/delayer.c
+++ b/test cases/common/95 benchmark/delayer.c
@@ -6,7 +6,7 @@
#include<windows.h>
#endif
-int main(int argc, char **argv) {
+int main() {
srand(time(NULL));
#if !defined(_WIN32)
struct timespec t;
diff --git a/test cases/common/96 test workdir/opener.c b/test cases/common/96 test workdir/opener.c
index 43c53ce..7be914d 100644
--- a/test cases/common/96 test workdir/opener.c
+++ b/test cases/common/96 test workdir/opener.c
@@ -2,7 +2,7 @@
#include<stdio.h>
-int main(int arg, char **argv) {
+int main() {
FILE *f = fopen("opener.c", "r");
if(f) {
fclose(f);
diff --git a/test cases/common/97 suites/exe1.c b/test cases/common/97 suites/exe1.c
index 23894c0..89a1c4e 100644
--- a/test cases/common/97 suites/exe1.c
+++ b/test cases/common/97 suites/exe1.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I am test exe1.\n");
return 0;
}
diff --git a/test cases/common/97 suites/exe2.c b/test cases/common/97 suites/exe2.c
index ec88e20..92f287d 100644
--- a/test cases/common/97 suites/exe2.c
+++ b/test cases/common/97 suites/exe2.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I am test exe2.\n");
return 0;
}
diff --git a/test cases/common/97 suites/subprojects/sub/sub1.c b/test cases/common/97 suites/subprojects/sub/sub1.c
index 3409e48..ab5822a 100644
--- a/test cases/common/97 suites/subprojects/sub/sub1.c
+++ b/test cases/common/97 suites/subprojects/sub/sub1.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I am test sub1.\n");
return 0;
}
diff --git a/test cases/common/97 suites/subprojects/sub/sub2.c b/test cases/common/97 suites/subprojects/sub/sub2.c
index 1a64a2a..f1e6d78 100644
--- a/test cases/common/97 suites/subprojects/sub/sub2.c
+++ b/test cases/common/97 suites/subprojects/sub/sub2.c
@@ -1,6 +1,6 @@
#include<stdio.h>
-int main(int argc, char **argv) {
+int main() {
printf("I am test sub2.\n");
return 0;
}
diff --git a/test cases/common/98 threads/threadprog.c b/test cases/common/98 threads/threadprog.c
index 47a5d18..5db40f1 100644
--- a/test cases/common/98 threads/threadprog.c
+++ b/test cases/common/98 threads/threadprog.c
@@ -3,12 +3,12 @@
#include<windows.h>
#include<stdio.h>
-DWORD WINAPI thread_func(LPVOID ignored) {
+DWORD WINAPI thread_func() {
printf("Printing from a thread.\n");
return 0;
}
-int main(int argc, char **argv) {
+int main() {
DWORD id;
HANDLE th;
printf("Starting thread.\n");
@@ -22,12 +22,12 @@ int main(int argc, char **argv) {
#include<pthread.h>
#include<stdio.h>
-void* main_func(void* ignored) {
+void* main_func() {
printf("Printing from a thread.\n");
return NULL;
}
-int main(int argc, char** argv) {
+int main() {
pthread_t thread;
int rc;
printf("Starting thread.\n");
diff --git a/test cases/common/98 threads/threadprog.cpp b/test cases/common/98 threads/threadprog.cpp
index 6fd747f..18fa9f5 100644
--- a/test cases/common/98 threads/threadprog.cpp
+++ b/test cases/common/98 threads/threadprog.cpp
@@ -14,7 +14,7 @@ DWORD WINAPI thread_func(LPVOID) {
return 0;
}
-int main(int, char**) {
+int main() {
printf("Starting thread.\n");
HANDLE th;
DWORD id;
@@ -32,7 +32,7 @@ void main_func() {
printf("Printing from a thread.\n");
}
-int main(int, char**) {
+int main() {
printf("Starting thread.\n");
std::thread th(main_func);
th.join();
diff --git a/test cases/common/99 manygen/depuser.c b/test cases/common/99 manygen/depuser.c
index 1a825e0..6374cd0 100644
--- a/test cases/common/99 manygen/depuser.c
+++ b/test cases/common/99 manygen/depuser.c
@@ -1,6 +1,6 @@
#include"gen_func.h"
-int main(int argc, char **argv) {
+int main() {
unsigned int i = (unsigned int) gen_func_in_lib();
unsigned int j = (unsigned int) gen_func_in_obj();
unsigned int k = (unsigned int) gen_func_in_src();
diff --git a/test cases/fortran/1 basic/simple.f90 b/test cases/fortran/1 basic/simple.f90
index e0fb1d8..53aeb4d 100644
--- a/test cases/fortran/1 basic/simple.f90
+++ b/test cases/fortran/1 basic/simple.f90
@@ -1,3 +1,2 @@
-program prog
- print *, "Fortran compilation is working."
-end program prog
+print *, "Fortran compilation is working."
+end program
diff --git a/test cases/fortran/12 submodule/a1.f90 b/test cases/fortran/12 submodule/a1.f90
index cb44916..c4b4555 100644
--- a/test cases/fortran/12 submodule/a1.f90
+++ b/test cases/fortran/12 submodule/a1.f90
@@ -15,6 +15,7 @@ end module a1
program hierN
use a1
+real :: tau, pi
pi = get_pi()
diff --git a/test cases/fortran/9 cpp/main.cpp b/test cases/fortran/9 cpp/main.cpp
index f5828f4..a3eeaec 100644
--- a/test cases/fortran/9 cpp/main.cpp
+++ b/test cases/fortran/9 cpp/main.cpp
@@ -2,7 +2,7 @@
extern "C" double fortran();
-int main(int, char**) {
+int main() {
std::cout << "FORTRAN gave us this number: " << fortran() << '\n';
return 0;
}
diff --git a/test cases/linuxlike/1 pkg-config/meson.build b/test cases/linuxlike/1 pkg-config/meson.build
index 891fea4..87a6e65 100644
--- a/test cases/linuxlike/1 pkg-config/meson.build
+++ b/test cases/linuxlike/1 pkg-config/meson.build
@@ -39,7 +39,7 @@ cc = meson.get_compiler('c')
zlibdep = cc.find_library('z')
code = '''#include<myinc.h>
-int main(int argc, char **argv) {
+int main() {
void * something = deflate;
if(something != 0)
return 0;
diff --git a/test cases/linuxlike/1 pkg-config/prog-checkver.c b/test cases/linuxlike/1 pkg-config/prog-checkver.c
index 16b7170..9c5f4f2 100644
--- a/test cases/linuxlike/1 pkg-config/prog-checkver.c
+++ b/test cases/linuxlike/1 pkg-config/prog-checkver.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-int main(int argc, char **argv) {
+int main() {
void * something = deflate;
if(strcmp(ZLIB_VERSION, FOUND_ZLIB) != 0) {
printf("Meson found '%s' but zlib is '%s'\n", FOUND_ZLIB, ZLIB_VERSION);
diff --git a/test cases/linuxlike/1 pkg-config/prog.c b/test cases/linuxlike/1 pkg-config/prog.c
index cea986d..e5774b7 100644
--- a/test cases/linuxlike/1 pkg-config/prog.c
+++ b/test cases/linuxlike/1 pkg-config/prog.c
@@ -1,6 +1,6 @@
#include<zlib.h>
-int main(int argc, char **argv) {
+int main() {
void * something = deflate;
if(something != 0)
return 0;
diff --git a/test cases/linuxlike/11 runpath rpath ldlibrarypath/main.c b/test cases/linuxlike/11 runpath rpath ldlibrarypath/main.c
index c9eff99..5009531 100644
--- a/test cases/linuxlike/11 runpath rpath ldlibrarypath/main.c
+++ b/test cases/linuxlike/11 runpath rpath ldlibrarypath/main.c
@@ -2,7 +2,7 @@
int some_symbol (void);
-int main (int argc, char *argv[]) {
+int main () {
int ret = some_symbol ();
if (ret == 1)
return 0;
diff --git a/test cases/linuxlike/12 subprojects in subprojects/main.c b/test cases/linuxlike/12 subprojects in subprojects/main.c
index 8793c62..e4969c3 100644
--- a/test cases/linuxlike/12 subprojects in subprojects/main.c
+++ b/test cases/linuxlike/12 subprojects in subprojects/main.c
@@ -2,7 +2,7 @@
#include "a.h"
#include "b.h"
-int main(int argc, char **argv) {
+int main() {
int life = a_fun() + b_fun();
printf("%d\n", life);
return 0;
diff --git a/test cases/linuxlike/13 cmake dependency/meson.build b/test cases/linuxlike/13 cmake dependency/meson.build
index 7d99764..bae85aa 100644
--- a/test cases/linuxlike/13 cmake dependency/meson.build
+++ b/test cases/linuxlike/13 cmake dependency/meson.build
@@ -61,7 +61,7 @@ cc = meson.get_compiler('c')
zlibdep = cc.find_library('z')
code = '''#include<myinc.h>
-int main(int argc, char **argv) {
+int main() {
void * something = deflate;
if(something != 0)
return 0;
diff --git a/test cases/linuxlike/13 cmake dependency/prog-checkver.c b/test cases/linuxlike/13 cmake dependency/prog-checkver.c
index 16b7170..9c5f4f2 100644
--- a/test cases/linuxlike/13 cmake dependency/prog-checkver.c
+++ b/test cases/linuxlike/13 cmake dependency/prog-checkver.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-int main(int argc, char **argv) {
+int main() {
void * something = deflate;
if(strcmp(ZLIB_VERSION, FOUND_ZLIB) != 0) {
printf("Meson found '%s' but zlib is '%s'\n", FOUND_ZLIB, ZLIB_VERSION);
diff --git a/test cases/linuxlike/13 cmake dependency/prog.c b/test cases/linuxlike/13 cmake dependency/prog.c
index cea986d..e5774b7 100644
--- a/test cases/linuxlike/13 cmake dependency/prog.c
+++ b/test cases/linuxlike/13 cmake dependency/prog.c
@@ -1,6 +1,6 @@
#include<zlib.h>
-int main(int argc, char **argv) {
+int main() {
void * something = deflate;
if(something != 0)
return 0;
diff --git a/test cases/linuxlike/13 cmake dependency/testFlagSet.c b/test cases/linuxlike/13 cmake dependency/testFlagSet.c
index 0c92690..ec87f59 100644
--- a/test cases/linuxlike/13 cmake dependency/testFlagSet.c
+++ b/test cases/linuxlike/13 cmake dependency/testFlagSet.c
@@ -9,7 +9,7 @@
#error "REQUIRED_MESON_FLAG2 not set"
#endif
-int main(int argc, char *argv[]) {
+int main() {
printf("Hello World\n");
void * something = deflate;
if(something != 0)
diff --git a/test cases/linuxlike/2 external library/meson.build b/test cases/linuxlike/2 external library/meson.build
index e17942d..43070f5 100644
--- a/test cases/linuxlike/2 external library/meson.build
+++ b/test cases/linuxlike/2 external library/meson.build
@@ -5,14 +5,14 @@ zlib = cc.find_library('z')
# Verify that link testing works.
linkcode = '''#include<zlib.h>
-int main(int argc, char **argv) {
+int main() {
void *ptr = (void*)(deflate);
return ptr == 0;
}
'''
nolinkcode='''int nonexisting();
-int main(int argc, char **argv) {
+int main() {
return nonexisting();
}
'''
diff --git a/test cases/linuxlike/2 external library/prog.c b/test cases/linuxlike/2 external library/prog.c
index cea986d..e5774b7 100644
--- a/test cases/linuxlike/2 external library/prog.c
+++ b/test cases/linuxlike/2 external library/prog.c
@@ -1,6 +1,6 @@
#include<zlib.h>
-int main(int argc, char **argv) {
+int main() {
void * something = deflate;
if(something != 0)
return 0;
diff --git a/test cases/linuxlike/3 linker script/prog.c b/test cases/linuxlike/3 linker script/prog.c
index da9c675..2c9b01b 100644
--- a/test cases/linuxlike/3 linker script/prog.c
+++ b/test cases/linuxlike/3 linker script/prog.c
@@ -1,5 +1,5 @@
#include"bob.h"
-int main(int argc, char **argv) {
+int main() {
return bobMcBob() != 42;
}
diff --git a/test cases/linuxlike/4 extdep static lib/prog.c b/test cases/linuxlike/4 extdep static lib/prog.c
index 843c628..c0268aa 100644
--- a/test cases/linuxlike/4 extdep static lib/prog.c
+++ b/test cases/linuxlike/4 extdep static lib/prog.c
@@ -1,5 +1,5 @@
int statlibfunc();
-int main(int argc, char **argv) {
+int main() {
return statlibfunc();
}
diff --git a/test cases/linuxlike/7 library versions/exe.orig.c b/test cases/linuxlike/7 library versions/exe.orig.c
index 86c4adc..7074d2f 100644
--- a/test cases/linuxlike/7 library versions/exe.orig.c
+++ b/test cases/linuxlike/7 library versions/exe.orig.c
@@ -1,7 +1,6 @@
int myFunc (void);
-int
-main (int argc, char *argv[])
+int main()
{
if (myFunc() == 55)
return 0;
diff --git a/test cases/linuxlike/9 compiler checks with dependencies/meson.build b/test cases/linuxlike/9 compiler checks with dependencies/meson.build
index 9f1755b..315971e 100644
--- a/test cases/linuxlike/9 compiler checks with dependencies/meson.build
+++ b/test cases/linuxlike/9 compiler checks with dependencies/meson.build
@@ -10,7 +10,7 @@ if glib.found()
assert (cc.has_member('GError', 'message', prefix : '#include <glib.h>', dependencies : glib), 'GError::message not found')
assert (cc.has_header_symbol('glib.h', 'gint32', dependencies : glib), 'gint32 symbol not found')
linkcode = '''#include <glib.h>
-int main (int argc, char *argv[]) {
+int main () {
GError *error = g_error_new_literal (0, 0, NULL);
return error == NULL;
}
@@ -21,7 +21,7 @@ endif
zlib = cc.find_library ('z')
if zlib.found()
linkcode = '''#include<zlib.h>
-int main(int argc, char *argv[]) {
+int main() {
void *ptr = (void*)(deflate);
return ptr == 0;
}
diff --git a/test cases/unit/34 command line/meson_options.txt b/test cases/unit/34 command line/meson_options.txt
index 7acc112..244f570 100644
--- a/test cases/unit/34 command line/meson_options.txt
+++ b/test cases/unit/34 command line/meson_options.txt
@@ -1 +1,2 @@
option('set_sub_opt', type : 'boolean', value : false)
+option('set_percent_opt', type : 'string', value: 'not_set')
diff --git a/test cases/unit/67 rpath-link secondary/app/app.c b/test cases/unit/67 rpath-link secondary/app/app.c
deleted file mode 100644
index f33b1a9..0000000
--- a/test cases/unit/67 rpath-link secondary/app/app.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <stdio.h>
-#include <libb.h>
-
-int main() { printf("The answer is: %d\n", libB_func()); }
diff --git a/test cases/unit/67 rpath-link secondary/app/meson.build b/test cases/unit/67 rpath-link secondary/app/meson.build
deleted file mode 100644
index 3d85a32..0000000
--- a/test cases/unit/67 rpath-link secondary/app/meson.build
+++ /dev/null
@@ -1,5 +0,0 @@
-project('app', ['c'])
-
-b = dependency('test-b')
-
-executable('app', 'app.c', dependencies : [b])
diff --git a/test cases/unit/67 rpath-link secondary/libA/liba.c b/test cases/unit/67 rpath-link secondary/libA/liba.c
deleted file mode 100644
index 620a994..0000000
--- a/test cases/unit/67 rpath-link secondary/libA/liba.c
+++ /dev/null
@@ -1 +0,0 @@
-int libA_func() { return 42; }
diff --git a/test cases/unit/67 rpath-link secondary/libA/liba.h b/test cases/unit/67 rpath-link secondary/libA/liba.h
deleted file mode 100644
index ed4fa7d..0000000
--- a/test cases/unit/67 rpath-link secondary/libA/liba.h
+++ /dev/null
@@ -1 +0,0 @@
-int libA_func();
diff --git a/test cases/unit/67 rpath-link secondary/libA/meson.build b/test cases/unit/67 rpath-link secondary/libA/meson.build
deleted file mode 100644
index 383bed0..0000000
--- a/test cases/unit/67 rpath-link secondary/libA/meson.build
+++ /dev/null
@@ -1,14 +0,0 @@
-project('lib', ['c'])
-
-a = library('test-a', 'liba.c', install: true)
-
-install_headers(files('liba.h'))
-
-import('pkgconfig').generate(
- a,
- version: '0.0',
- description: 'test library',
- filebase: 'test-a',
- name: 'test library',
- subdirs: ['.']
-)
diff --git a/test cases/unit/67 rpath-link secondary/libB/libb.c b/test cases/unit/67 rpath-link secondary/libB/libb.c
deleted file mode 100644
index d097066..0000000
--- a/test cases/unit/67 rpath-link secondary/libB/libb.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <liba.h>
-
-int libB_func() { return libA_func(); }
diff --git a/test cases/unit/67 rpath-link secondary/libB/libb.h b/test cases/unit/67 rpath-link secondary/libB/libb.h
deleted file mode 100644
index c5de0c2..0000000
--- a/test cases/unit/67 rpath-link secondary/libB/libb.h
+++ /dev/null
@@ -1 +0,0 @@
-int libB_func();
diff --git a/test cases/unit/67 rpath-link secondary/libB/meson.build b/test cases/unit/67 rpath-link secondary/libB/meson.build
deleted file mode 100644
index 3bfd0d2..0000000
--- a/test cases/unit/67 rpath-link secondary/libB/meson.build
+++ /dev/null
@@ -1,16 +0,0 @@
-project('lib', ['c'])
-
-libA_dep = dependency('test-a')
-
-b = library('test-b', 'libb.c', install: true, dependencies : libA_dep)
-
-install_headers(files('libb.h'))
-
-import('pkgconfig').generate(
- b,
- version: '0.0',
- description: 'test library',
- filebase: 'test-b',
- name: 'test library',
- subdirs: ['.']
-)
diff --git a/test cases/windows/1 basic/prog.c b/test cases/windows/1 basic/prog.c
index 58162a4..b94a38f 100644
--- a/test cases/windows/1 basic/prog.c
+++ b/test cases/windows/1 basic/prog.c
@@ -1,5 +1,5 @@
#include <windows.h>
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/windows/10 vs module defs generated custom target/prog.c b/test cases/windows/10 vs module defs generated custom target/prog.c
index f35f4a0..2567760 100644
--- a/test cases/windows/10 vs module defs generated custom target/prog.c
+++ b/test cases/windows/10 vs module defs generated custom target/prog.c
@@ -1,5 +1,5 @@
int somedllfunc();
-int main(int argc, char **argv) {
+int main() {
return somedllfunc() == 42 ? 0 : 1;
}
diff --git a/test cases/windows/11 exe implib/prog.c b/test cases/windows/11 exe implib/prog.c
index 6d5a9f5..2192019 100644
--- a/test cases/windows/11 exe implib/prog.c
+++ b/test cases/windows/11 exe implib/prog.c
@@ -1,6 +1,6 @@
#include <windows.h>
int __declspec(dllexport)
-main(int argc, char **argv) {
+main() {
return 0;
}
diff --git a/test cases/windows/16 gui app/console_prog.c b/test cases/windows/16 gui app/console_prog.c
index 11b7fad..33c14ce 100644
--- a/test cases/windows/16 gui app/console_prog.c
+++ b/test cases/windows/16 gui app/console_prog.c
@@ -1,3 +1,3 @@
-int main(int argc, char **argv) {
+int main() {
return 0;
}
diff --git a/test cases/windows/6 vs module defs/prog.c b/test cases/windows/6 vs module defs/prog.c
index f35f4a0..2567760 100644
--- a/test cases/windows/6 vs module defs/prog.c
+++ b/test cases/windows/6 vs module defs/prog.c
@@ -1,5 +1,5 @@
int somedllfunc();
-int main(int argc, char **argv) {
+int main() {
return somedllfunc() == 42 ? 0 : 1;
}
diff --git a/test cases/windows/7 dll versioning/exe.orig.c b/test cases/windows/7 dll versioning/exe.orig.c
index 86c4adc..7074d2f 100644
--- a/test cases/windows/7 dll versioning/exe.orig.c
+++ b/test cases/windows/7 dll versioning/exe.orig.c
@@ -1,7 +1,6 @@
int myFunc (void);
-int
-main (int argc, char *argv[])
+int main()
{
if (myFunc() == 55)
return 0;
diff --git a/test cases/windows/9 vs module defs generated/prog.c b/test cases/windows/9 vs module defs generated/prog.c
index f35f4a0..2567760 100644
--- a/test cases/windows/9 vs module defs generated/prog.c
+++ b/test cases/windows/9 vs module defs generated/prog.c
@@ -1,5 +1,5 @@
int somedllfunc();
-int main(int argc, char **argv) {
+int main() {
return somedllfunc() == 42 ? 0 : 1;
}