From 17bfbb99e5897ac759aca42d3ee375ebb33bd087 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 31 Jul 2018 19:22:24 +0300 Subject: Condense test dirs. --- run_project_tests.py | 6 +- run_unittests.py | 94 ++++++++++----------- test cases/common/157 dotinclude/dotproc.c | 10 +++ test cases/common/157 dotinclude/meson.build | 5 ++ test cases/common/157 dotinclude/stdio.h | 6 ++ test cases/common/158 dotinclude/dotproc.c | 10 --- test cases/common/158 dotinclude/meson.build | 5 -- test cases/common/158 dotinclude/stdio.h | 6 -- .../common/158 reserved targets/all/meson.build | 1 + .../158 reserved targets/benchmark/meson.build | 1 + .../158 reserved targets/clean-ctlist/meson.build | 1 + .../158 reserved targets/clean-gcda/meson.build | 1 + .../158 reserved targets/clean-gcno/meson.build | 1 + .../common/158 reserved targets/clean/meson.build | 1 + .../158 reserved targets/coverage-html/meson.build | 1 + .../158 reserved targets/coverage-text/meson.build | 1 + .../158 reserved targets/coverage-xml/meson.build | 1 + .../158 reserved targets/coverage/meson.build | 1 + .../common/158 reserved targets/dist/meson.build | 1 + .../158 reserved targets/distcheck/meson.build | 1 + .../158 reserved targets/install/meson.build | 1 + test cases/common/158 reserved targets/meson.build | 34 ++++++++ .../common/158 reserved targets/phony/meson.build | 1 + .../158 reserved targets/reconfigure/meson.build | 1 + .../158 reserved targets/runtarget/meson.build | 2 + .../158 reserved targets/scan-build/meson.build | 1 + test cases/common/158 reserved targets/test.c | 3 + .../common/158 reserved targets/test/meson.build | 1 + .../158 reserved targets/uninstall/meson.build | 1 + .../common/159 duplicate source names/dir1/file.c | 16 ++++ .../159 duplicate source names/dir1/meson.build | 1 + .../159 duplicate source names/dir2/dir1/file.c | 1 + .../common/159 duplicate source names/dir2/file.c | 1 + .../159 duplicate source names/dir2/meson.build | 1 + .../159 duplicate source names/dir3/dir1/file.c | 1 + .../common/159 duplicate source names/dir3/file.c | 1 + .../159 duplicate source names/dir3/meson.build | 1 + .../common/159 duplicate source names/meson.build | 7 ++ .../common/159 reserved targets/all/meson.build | 1 - .../159 reserved targets/benchmark/meson.build | 1 - .../159 reserved targets/clean-ctlist/meson.build | 1 - .../159 reserved targets/clean-gcda/meson.build | 1 - .../159 reserved targets/clean-gcno/meson.build | 1 - .../common/159 reserved targets/clean/meson.build | 1 - .../159 reserved targets/coverage-html/meson.build | 1 - .../159 reserved targets/coverage-text/meson.build | 1 - .../159 reserved targets/coverage-xml/meson.build | 1 - .../159 reserved targets/coverage/meson.build | 1 - .../common/159 reserved targets/dist/meson.build | 1 - .../159 reserved targets/distcheck/meson.build | 1 - .../159 reserved targets/install/meson.build | 1 - test cases/common/159 reserved targets/meson.build | 34 -------- .../common/159 reserved targets/phony/meson.build | 1 - .../159 reserved targets/reconfigure/meson.build | 1 - .../159 reserved targets/runtarget/meson.build | 2 - .../159 reserved targets/scan-build/meson.build | 1 - test cases/common/159 reserved targets/test.c | 3 - .../common/159 reserved targets/test/meson.build | 1 - .../159 reserved targets/uninstall/meson.build | 1 - .../common/160 duplicate source names/dir1/file.c | 16 ---- .../160 duplicate source names/dir1/meson.build | 1 - .../160 duplicate source names/dir2/dir1/file.c | 1 - .../common/160 duplicate source names/dir2/file.c | 1 - .../160 duplicate source names/dir2/meson.build | 1 - .../160 duplicate source names/dir3/dir1/file.c | 1 - .../common/160 duplicate source names/dir3/file.c | 1 - .../160 duplicate source names/dir3/meson.build | 1 - .../common/160 duplicate source names/meson.build | 7 -- .../common/160 index customtarget/check_args.py | 18 ++++ .../common/160 index customtarget/gen_sources.py | 49 +++++++++++ test cases/common/160 index customtarget/lib.c | 20 +++++ .../common/160 index customtarget/meson.build | 39 +++++++++ .../common/160 index customtarget/subdir/foo.c | 22 +++++ .../160 index customtarget/subdir/meson.build | 19 +++++ .../common/161 index customtarget/check_args.py | 18 ---- .../common/161 index customtarget/gen_sources.py | 49 ----------- test cases/common/161 index customtarget/lib.c | 20 ----- .../common/161 index customtarget/meson.build | 39 --------- .../common/161 index customtarget/subdir/foo.c | 22 ----- .../161 index customtarget/subdir/meson.build | 19 ----- .../161 wrap file should not failed/meson.build | 7 ++ .../src/meson.build | 2 + .../src/subprojects/foo/prog2.c | 7 ++ .../src/subprojects/prog.c | 7 ++ .../subprojects/packagecache/zlib-1.2.8-8-wrap.zip | 1 + .../subprojects/packagecache/zlib-1.2.8.tar.gz | 1 + .../subprojects/zlib-1.2.8/foo.c | 3 + .../subprojects/zlib-1.2.8/meson.build | 2 + .../subprojects/zlib.wrap | 10 +++ .../common/162 includedir subproj/meson.build | 9 ++ test cases/common/162 includedir subproj/prog.c | 4 + .../subprojects/inctest/include/incfile.h | 2 + .../subprojects/inctest/meson.build | 13 +++ .../162 wrap file should not failed/meson.build | 7 -- .../src/meson.build | 2 - .../src/subprojects/foo/prog2.c | 7 -- .../src/subprojects/prog.c | 7 -- .../subprojects/packagecache/zlib-1.2.8-8-wrap.zip | 1 - .../subprojects/packagecache/zlib-1.2.8.tar.gz | 1 - .../subprojects/zlib-1.2.8/foo.c | 3 - .../subprojects/zlib-1.2.8/meson.build | 2 - .../subprojects/zlib.wrap | 10 --- .../common/163 includedir subproj/meson.build | 9 -- test cases/common/163 includedir subproj/prog.c | 4 - .../subprojects/inctest/include/incfile.h | 2 - .../subprojects/inctest/meson.build | 13 --- .../common/163 subproject dir name collision/a.c | 13 +++ .../custom_subproject_dir/B/b.c | 20 +++++ .../custom_subproject_dir/B/meson.build | 4 + .../custom_subproject_dir/C/c.c | 14 +++ .../custom_subproject_dir/C/meson.build | 2 + .../163 subproject dir name collision/meson.build | 12 +++ .../other_subdir/custom_subproject_dir/other.c | 19 +++++ .../other_subdir/meson.build | 1 + .../common/164 config tool variable/meson.build | 31 +++++++ .../common/164 subproject dir name collision/a.c | 13 --- .../custom_subproject_dir/B/b.c | 20 ----- .../custom_subproject_dir/B/meson.build | 4 - .../custom_subproject_dir/C/c.c | 14 --- .../custom_subproject_dir/C/meson.build | 2 - .../164 subproject dir name collision/meson.build | 12 --- .../other_subdir/custom_subproject_dir/other.c | 19 ----- .../other_subdir/meson.build | 1 - .../common/165 config tool variable/meson.build | 31 ------- .../copyfile.py | 6 ++ .../meson.build | 7 ++ .../subdir/dep.dat | 1 + .../subdir/foo.c.in | 6 ++ .../subdir/meson.build | 6 ++ .../copyfile.py | 6 -- .../meson.build | 7 -- .../subdir/dep.dat | 1 - .../subdir/foo.c.in | 6 -- .../subdir/meson.build | 6 -- .../166 external program shebang parsing/input.txt | 1 + .../166 external program shebang parsing/main.c | 72 ++++++++++++++++ .../meson.build | 21 +++++ .../script.int.in | 2 + test cases/common/167 disabler/meson.build | 34 ++++++++ .../167 external program shebang parsing/input.txt | 1 - .../167 external program shebang parsing/main.c | 72 ---------------- .../meson.build | 21 ----- .../script.int.in | 2 - test cases/common/168 array option/meson.build | 17 ++++ .../common/168 array option/meson_options.txt | 19 +++++ test cases/common/168 disabler/meson.build | 34 -------- test cases/common/169 array option/meson.build | 17 ---- .../common/169 array option/meson_options.txt | 19 ----- .../checkcopy.py | 9 ++ .../foo.c.in | 6 ++ .../meson.build | 17 ++++ .../checkcopy.py | 9 -- .../foo.c.in | 6 -- .../meson.build | 17 ---- .../common/170 not-found dependency/meson.build | 14 +++ .../170 not-found dependency/sub/meson.build | 1 + .../subprojects/trivial/meson.build | 3 + .../subprojects/trivial/trivial.c | 3 + .../common/170 not-found dependency/testlib.c | 0 .../common/171 not-found dependency/meson.build | 14 --- .../171 not-found dependency/sub/meson.build | 1 - .../subprojects/trivial/meson.build | 3 - .../subprojects/trivial/trivial.c | 3 - .../common/171 not-found dependency/testlib.c | 0 test cases/common/171 subdir if_found/meson.build | 11 +++ .../common/171 subdir if_found/subdir/meson.build | 1 + .../meson.build | 1 + test cases/common/172 subdir if_found/meson.build | 11 --- .../common/172 subdir if_found/subdir/meson.build | 1 - .../meson.build | 1 - .../common/173 dependency factory/meson.build | 51 +++++++++++ .../common/174 dependency factory/meson.build | 51 ----------- test cases/common/174 get project license/bar.c | 6 ++ .../common/174 get project license/meson.build | 8 ++ test cases/common/175 get project license/bar.c | 6 -- .../common/175 get project license/meson.build | 8 -- test cases/common/175 yield/meson.build | 6 ++ test cases/common/175 yield/meson_options.txt | 2 + .../common/175 yield/subprojects/sub/meson.build | 4 + .../175 yield/subprojects/sub/meson_options.txt | 2 + .../contrib/subprojects/alpha/a.c | 15 ++++ .../contrib/subprojects/alpha/meson.build | 4 + .../alpha/var/subprojects/wrap_files_might_be_here | 1 + .../contrib/subprojects/beta/b.c | 14 +++ .../contrib/subprojects/beta/meson.build | 3 + .../meson.build | 7 ++ .../176 subproject nested subproject dirs/prog.c | 5 ++ test cases/common/176 yield/meson.build | 6 -- test cases/common/176 yield/meson_options.txt | 2 - .../common/176 yield/subprojects/sub/meson.build | 4 - .../176 yield/subprojects/sub/meson_options.txt | 2 - test cases/common/177 preserve gendir/base.inp | 1 + .../177 preserve gendir/com/mesonbuild/subbie.inp | 1 + test cases/common/177 preserve gendir/genprog.py | 46 ++++++++++ test cases/common/177 preserve gendir/meson.build | 13 +++ test cases/common/177 preserve gendir/testprog.c | 6 ++ .../contrib/subprojects/alpha/a.c | 15 ---- .../contrib/subprojects/alpha/meson.build | 4 - .../alpha/var/subprojects/wrap_files_might_be_here | 1 - .../contrib/subprojects/beta/b.c | 14 --- .../contrib/subprojects/beta/meson.build | 3 - .../meson.build | 7 -- .../177 subproject nested subproject dirs/prog.c | 5 -- test cases/common/178 preserve gendir/base.inp | 1 - .../178 preserve gendir/com/mesonbuild/subbie.inp | 1 - test cases/common/178 preserve gendir/genprog.py | 46 ---------- test cases/common/178 preserve gendir/meson.build | 13 --- test cases/common/178 preserve gendir/testprog.c | 6 -- test cases/common/178 source in dep/bar.cpp | 5 ++ test cases/common/178 source in dep/foo.c | 3 + .../common/178 source in dep/generated/funname | 1 + .../178 source in dep/generated/genheader.py | 17 ++++ .../common/178 source in dep/generated/main.c | 5 ++ .../common/178 source in dep/generated/meson.build | 12 +++ test cases/common/178 source in dep/meson.build | 8 ++ .../common/179 generator link whole/export.h | 18 ++++ .../common/179 generator link whole/generator.py | 30 +++++++ test cases/common/179 generator link whole/main.c | 11 +++ .../common/179 generator link whole/meson.build | 65 ++++++++++++++ .../meson_test_function.tmpl | 0 .../pull_meson_test_function.c | 6 ++ test cases/common/179 source in dep/bar.cpp | 5 -- test cases/common/179 source in dep/foo.c | 3 - .../common/179 source in dep/generated/funname | 1 - .../179 source in dep/generated/genheader.py | 17 ---- .../common/179 source in dep/generated/main.c | 5 -- .../common/179 source in dep/generated/meson.build | 12 --- test cases/common/179 source in dep/meson.build | 8 -- .../common/180 generator link whole/export.h | 18 ---- .../common/180 generator link whole/generator.py | 30 ------- test cases/common/180 generator link whole/main.c | 11 --- .../common/180 generator link whole/meson.build | 65 -------------- .../meson_test_function.tmpl | 0 .../pull_meson_test_function.c | 6 -- test cases/common/180 initial c_args/meson.build | 7 ++ test cases/common/180 initial c_args/test_args.txt | 4 + .../foo.c | 1 + .../main.c | 16 ++++ .../meson.build | 11 +++ .../subprojects/subproj/foo.c | 1 + .../subprojects/subproj/meson.build | 3 + test cases/common/181 initial c_args/meson.build | 7 -- test cases/common/181 initial c_args/test_args.txt | 4 - test cases/common/182 as-needed/config.h | 14 +++ test cases/common/182 as-needed/libA.cpp | 7 ++ test cases/common/182 as-needed/libA.h | 5 ++ test cases/common/182 as-needed/libB.cpp | 19 +++++ test cases/common/182 as-needed/main.cpp | 7 ++ test cases/common/182 as-needed/meson.build | 13 +++ .../foo.c | 1 - .../main.c | 16 ---- .../meson.build | 11 --- .../subprojects/subproj/foo.c | 1 - .../subprojects/subproj/meson.build | 3 - .../common/183 ndebug if-release enabled/main.c | 15 ++++ .../183 ndebug if-release enabled/meson.build | 7 ++ test cases/common/184 as-needed/config.h | 14 --- test cases/common/184 as-needed/libA.cpp | 7 -- test cases/common/184 as-needed/libA.h | 5 -- test cases/common/184 as-needed/libB.cpp | 19 ----- test cases/common/184 as-needed/main.cpp | 7 -- test cases/common/184 as-needed/meson.build | 13 --- .../common/184 ndebug if-release disabled/main.c | 7 ++ .../184 ndebug if-release disabled/meson.build | 7 ++ .../common/185 ndebug if-release enabled/main.c | 15 ---- .../185 ndebug if-release enabled/meson.build | 7 -- .../common/185 subproject version/meson.build | 10 +++ .../subprojects/a/meson.build | 5 ++ .../common/186 ndebug if-release disabled/main.c | 7 -- .../186 ndebug if-release disabled/meson.build | 7 -- test cases/common/186 subdir_done/meson.build | 12 +++ test cases/common/187 bothlibraries/libfile.c | 7 ++ test cases/common/187 bothlibraries/main.c | 8 ++ test cases/common/187 bothlibraries/meson.build | 12 +++ test cases/common/187 bothlibraries/mylib.h | 13 +++ .../common/187 subproject version/meson.build | 10 --- .../subprojects/a/meson.build | 5 -- test cases/common/188 escape and unicode/file.c.in | 5 ++ test cases/common/188 escape and unicode/file.py | 10 +++ test cases/common/188 escape and unicode/find.py | 9 ++ test cases/common/188 escape and unicode/fun.c | 3 + test cases/common/188 escape and unicode/main.c | 12 +++ .../common/188 escape and unicode/meson.build | 24 ++++++ test cases/common/188 subdir_done/meson.build | 12 --- test cases/common/189 bothlibraries/libfile.c | 7 -- test cases/common/189 bothlibraries/main.c | 8 -- test cases/common/189 bothlibraries/meson.build | 12 --- test cases/common/189 bothlibraries/mylib.h | 13 --- test cases/common/189 has link arg/meson.build | 44 ++++++++++ test cases/common/190 escape and unicode/file.c.in | 5 -- test cases/common/190 escape and unicode/file.py | 10 --- test cases/common/190 escape and unicode/find.py | 9 -- test cases/common/190 escape and unicode/fun.c | 3 - test cases/common/190 escape and unicode/main.c | 12 --- .../common/190 escape and unicode/meson.build | 24 ------ .../common/190 same target name flat layout/foo.c | 1 + .../common/190 same target name flat layout/main.c | 16 ++++ .../190 same target name flat layout/meson.build | 11 +++ .../190 same target name flat layout/subdir/foo.c | 1 + .../subdir/meson.build | 1 + test cases/common/191 find override/meson.build | 12 +++ .../common/191 find override/otherdir/main.c | 5 ++ .../common/191 find override/otherdir/main2.c | 5 ++ .../common/191 find override/otherdir/meson.build | 26 ++++++ .../common/191 find override/otherdir/source.desc | 1 + .../common/191 find override/otherdir/source2.desc | 1 + .../common/191 find override/subdir/converter.py | 15 ++++ .../191 find override/subdir/gencodegen.py.in | 15 ++++ .../common/191 find override/subdir/meson.build | 14 +++ test cases/common/191 has link arg/meson.build | 44 ---------- .../declare_dependency/headers/foo.c | 16 ++++ .../declare_dependency/headers/foo.h | 16 ++++ .../declare_dependency/main.c | 25 ++++++ .../declare_dependency/meson.build | 28 ++++++ .../declare_dependency/other.c | 20 +++++ .../common/192 partial dependency/meson.build | 17 ++++ .../common/192 same target name flat layout/foo.c | 1 - .../common/192 same target name flat layout/main.c | 16 ---- .../192 same target name flat layout/meson.build | 11 --- .../192 same target name flat layout/subdir/foo.c | 1 - .../subdir/meson.build | 1 - test cases/common/193 find override/meson.build | 12 --- .../common/193 find override/otherdir/main.c | 5 -- .../common/193 find override/otherdir/main2.c | 5 -- .../common/193 find override/otherdir/meson.build | 26 ------ .../common/193 find override/otherdir/source.desc | 1 - .../common/193 find override/otherdir/source2.desc | 1 - .../common/193 find override/subdir/converter.py | 15 ---- .../193 find override/subdir/gencodegen.py.in | 15 ---- .../common/193 find override/subdir/meson.build | 14 --- test cases/common/193 openmp/main.c | 16 ++++ test cases/common/193 openmp/main.cpp | 16 ++++ test cases/common/193 openmp/main.f90 | 8 ++ test cases/common/193 openmp/meson.build | 40 +++++++++ .../declare_dependency/headers/foo.c | 16 ---- .../declare_dependency/headers/foo.h | 16 ---- .../declare_dependency/main.c | 25 ------ .../declare_dependency/meson.build | 28 ------ .../declare_dependency/other.c | 20 ----- .../common/194 partial dependency/meson.build | 17 ---- test cases/common/194 same target name/file.c | 3 + test cases/common/194 same target name/meson.build | 4 + test cases/common/194 same target name/sub/file2.c | 3 + .../common/194 same target name/sub/meson.build | 1 + test cases/common/195 openmp/main.c | 16 ---- test cases/common/195 openmp/main.cpp | 16 ---- test cases/common/195 openmp/main.f90 | 8 -- test cases/common/195 openmp/meson.build | 40 --------- test cases/common/195 test depends/gen.py | 13 +++ test cases/common/195 test depends/main.c | 1 + test cases/common/195 test depends/meson.build | 26 ++++++ test cases/common/195 test depends/test.py | 20 +++++ test cases/common/196 args flattening/meson.build | 29 +++++++ test cases/common/196 same target name/file.c | 3 - test cases/common/196 same target name/meson.build | 4 - test cases/common/196 same target name/sub/file2.c | 3 - .../common/196 same target name/sub/meson.build | 1 - test cases/common/197 dict/meson.build | 23 +++++ test cases/common/197 dict/prog.c | 8 ++ test cases/common/197 test depends/gen.py | 13 --- test cases/common/197 test depends/main.c | 1 - test cases/common/197 test depends/meson.build | 26 ------ test cases/common/197 test depends/test.py | 20 ----- test cases/common/198 args flattening/meson.build | 29 ------- test cases/common/198 check header/meson.build | 48 +++++++++++ test cases/common/198 check header/ouagadougou.h | 1 + test cases/common/199 dict/meson.build | 23 ----- test cases/common/199 dict/prog.c | 8 -- test cases/common/199 install_mode/config.h.in | 5 ++ test cases/common/199 install_mode/data_source.txt | 1 + test cases/common/199 install_mode/foo.1 | 1 + .../common/199 install_mode/installed_files.txt | 8 ++ test cases/common/199 install_mode/meson.build | 52 ++++++++++++ test cases/common/199 install_mode/rootdir.h | 3 + test cases/common/199 install_mode/runscript.sh | 3 + test cases/common/199 install_mode/stat.c | 1 + test cases/common/199 install_mode/sub1/second.dat | 1 + test cases/common/199 install_mode/trivial.c | 6 ++ test cases/common/200 check header/meson.build | 48 ----------- test cases/common/200 check header/ouagadougou.h | 1 - .../200 subproject array version/meson.build | 3 + .../subprojects/foo/meson.build | 1 + test cases/common/201 feature option/meson.build | 47 +++++++++++ .../common/201 feature option/meson_options.txt | 3 + test cases/common/201 install_mode/config.h.in | 5 -- test cases/common/201 install_mode/data_source.txt | 1 - test cases/common/201 install_mode/foo.1 | 1 - .../common/201 install_mode/installed_files.txt | 8 -- test cases/common/201 install_mode/meson.build | 52 ------------ test cases/common/201 install_mode/rootdir.h | 3 - test cases/common/201 install_mode/runscript.sh | 3 - test cases/common/201 install_mode/stat.c | 1 - test cases/common/201 install_mode/sub1/second.dat | 1 - test cases/common/201 install_mode/trivial.c | 6 -- .../common/202 feature option disabled/meson.build | 23 +++++ .../202 feature option disabled/meson_options.txt | 3 + .../202 subproject array version/meson.build | 3 - .../subprojects/foo/meson.build | 1 - test cases/common/203 feature option/meson.build | 47 ----------- .../common/203 feature option/meson_options.txt | 3 - test cases/common/203 static threads/lib1.c | 13 +++ test cases/common/203 static threads/lib2.c | 5 ++ test cases/common/203 static threads/meson.build | 13 +++ test cases/common/203 static threads/prog.c | 6 ++ .../common/204 feature option disabled/meson.build | 23 ----- .../204 feature option disabled/meson_options.txt | 3 - test cases/common/205 static threads/lib1.c | 13 --- test cases/common/205 static threads/lib2.c | 5 -- test cases/common/205 static threads/meson.build | 13 --- test cases/common/205 static threads/prog.c | 6 -- test cases/failing/24 int conversion/meson.build | 3 + test cases/failing/25 badlang/meson.build | 3 + test cases/failing/25 int conversion/meson.build | 3 - test cases/failing/26 badlang/meson.build | 3 - test cases/failing/26 output subdir/foo.in | 1 + test cases/failing/26 output subdir/meson.build | 5 ++ .../failing/26 output subdir/subdir/dummy.txt | 2 + test cases/failing/27 noprog use/meson.build | 9 ++ test cases/failing/27 output subdir/foo.in | 1 - test cases/failing/27 output subdir/meson.build | 5 -- .../failing/27 output subdir/subdir/dummy.txt | 2 - test cases/failing/28 no crossprop/meson.build | 3 + test cases/failing/28 noprog use/meson.build | 9 -- test cases/failing/29 nested ternary/meson.build | 3 + test cases/failing/29 no crossprop/meson.build | 3 - .../failing/30 invalid man extension/meson.build | 2 + test cases/failing/30 nested ternary/meson.build | 3 - .../failing/31 invalid man extension/meson.build | 2 - test cases/failing/31 no man extension/meson.build | 2 + .../failing/32 exe static shared/meson.build | 11 +++ test cases/failing/32 exe static shared/prog.c | 10 +++ test cases/failing/32 exe static shared/shlib2.c | 16 ++++ test cases/failing/32 exe static shared/stat.c | 3 + test cases/failing/32 no man extension/meson.build | 2 - .../failing/33 exe static shared/meson.build | 11 --- test cases/failing/33 exe static shared/prog.c | 10 --- test cases/failing/33 exe static shared/shlib2.c | 16 ---- test cases/failing/33 exe static shared/stat.c | 3 - .../failing/33 non-root subproject/meson.build | 3 + .../33 non-root subproject/some/meson.build | 1 + .../meson.build | 4 + .../failing/34 non-root subproject/meson.build | 3 - .../34 non-root subproject/some/meson.build | 1 - .../meson.build | 4 - .../failing/35 project argument after target/exe.c | 3 + .../35 project argument after target/meson.build | 7 ++ .../meson.build | 3 + .../failing/36 project argument after target/exe.c | 3 - .../36 project argument after target/meson.build | 7 -- .../meson.build | 8 ++ .../37 has function external dependency/mylib.c | 1 + .../meson.build | 3 - .../meson.build | 8 -- .../38 has function external dependency/mylib.c | 1 - .../38 libdir must be inside prefix/meson.build | 2 + .../39 libdir must be inside prefix/meson.build | 2 - test cases/failing/39 prefix absolute/meson.build | 2 + test cases/failing/40 kwarg assign/dummy.c | 3 + test cases/failing/40 kwarg assign/meson.build | 4 + test cases/failing/40 kwarg assign/prog.c | 3 + test cases/failing/40 prefix absolute/meson.build | 2 - .../41 custom target plainname many inputs/1.txt | 1 + .../41 custom target plainname many inputs/2.txt | 1 + .../catfiles.py | 9 ++ .../meson.build | 8 ++ test cases/failing/41 kwarg assign/dummy.c | 3 - test cases/failing/41 kwarg assign/meson.build | 4 - test cases/failing/41 kwarg assign/prog.c | 3 - .../generator.py | 16 ++++ .../installed_files.txt | 6 ++ .../meson.build | 13 +++ .../42 custom target plainname many inputs/1.txt | 1 - .../42 custom target plainname many inputs/2.txt | 1 - .../catfiles.py | 9 -- .../meson.build | 8 -- .../generator.py | 16 ---- .../installed_files.txt | 6 -- .../meson.build | 13 --- .../failing/43 project name colon/meson.build | 1 + test cases/failing/44 abs subdir/bob/meson.build | 2 + test cases/failing/44 abs subdir/meson.build | 6 ++ .../failing/44 project name colon/meson.build | 1 - test cases/failing/45 abs subdir/bob/meson.build | 2 - test cases/failing/45 abs subdir/meson.build | 6 -- .../failing/45 abspath to srcdir/meson.build | 3 + .../failing/46 abspath to srcdir/meson.build | 3 - .../46 pkgconfig variables reserved/meson.build | 16 ++++ .../46 pkgconfig variables reserved/simple.c | 5 ++ .../46 pkgconfig variables reserved/simple.h | 6 ++ .../47 pkgconfig variables reserved/meson.build | 16 ---- .../47 pkgconfig variables reserved/simple.c | 5 -- .../47 pkgconfig variables reserved/simple.h | 6 -- .../47 pkgconfig variables zero length/meson.build | 16 ++++ .../47 pkgconfig variables zero length/simple.c | 5 ++ .../47 pkgconfig variables zero length/simple.h | 6 ++ .../meson.build | 16 ++++ .../simple.c | 5 ++ .../simple.h | 6 ++ .../48 pkgconfig variables zero length/meson.build | 16 ---- .../48 pkgconfig variables zero length/simple.c | 5 -- .../48 pkgconfig variables zero length/simple.h | 6 -- .../meson.build | 16 ++++ .../49 pkgconfig variables not key value/simple.c | 5 ++ .../49 pkgconfig variables not key value/simple.h | 6 ++ .../meson.build | 16 ---- .../simple.c | 5 -- .../simple.h | 6 -- .../failing/50 executable comparison/meson.build | 6 ++ test cases/failing/50 executable comparison/prog.c | 1 + .../meson.build | 16 ---- .../50 pkgconfig variables not key value/simple.c | 5 -- .../50 pkgconfig variables not key value/simple.h | 6 -- .../failing/51 executable comparison/meson.build | 6 -- test cases/failing/51 executable comparison/prog.c | 1 - .../failing/51 inconsistent comparison/meson.build | 7 ++ .../failing/52 inconsistent comparison/meson.build | 7 -- test cases/failing/52 slashname/meson.build | 12 +++ test cases/failing/52 slashname/sub/meson.build | 2 + test cases/failing/52 slashname/sub/prog.c | 6 ++ .../53 reserved meson prefix/meson-foo/meson.build | 0 .../failing/53 reserved meson prefix/meson.build | 3 + test cases/failing/53 slashname/meson.build | 12 --- test cases/failing/53 slashname/sub/meson.build | 2 - test cases/failing/53 slashname/sub/prog.c | 6 -- .../54 reserved meson prefix/meson-foo/meson.build | 0 .../failing/54 reserved meson prefix/meson.build | 3 - .../failing/54 wrong shared crate type/foo.rs | 0 .../failing/54 wrong shared crate type/meson.build | 3 + .../failing/55 wrong shared crate type/foo.rs | 0 .../failing/55 wrong shared crate type/meson.build | 3 - .../failing/55 wrong static crate type/foo.rs | 0 .../failing/55 wrong static crate type/meson.build | 3 + test cases/failing/56 or on new line/meson.build | 7 ++ .../failing/56 or on new line/meson_options.txt | 1 + .../failing/56 wrong static crate type/foo.rs | 0 .../failing/56 wrong static crate type/meson.build | 3 - test cases/failing/57 kwarg in module/meson.build | 5 ++ test cases/failing/57 or on new line/meson.build | 7 -- .../failing/57 or on new line/meson_options.txt | 1 - test cases/failing/58 kwarg in module/meson.build | 5 -- .../failing/58 link with executable/meson.build | 4 + .../failing/58 link with executable/module.c | 4 + test cases/failing/58 link with executable/prog.c | 5 ++ .../59 assign custom target index/meson.build | 24 ++++++ .../failing/59 link with executable/meson.build | 4 - .../failing/59 link with executable/module.c | 4 - test cases/failing/59 link with executable/prog.c | 5 -- .../60 assign custom target index/meson.build | 24 ------ test cases/failing/60 getoption prefix/meson.build | 5 ++ .../subprojects/abc/meson.build | 1 + .../subprojects/abc/meson_options.txt | 1 + .../failing/61 bad option argument/meson.build | 3 + .../61 bad option argument/meson_options.txt | 1 + test cases/failing/61 getoption prefix/meson.build | 5 -- .../subprojects/abc/meson.build | 1 - .../subprojects/abc/meson_options.txt | 1 - .../failing/62 bad option argument/meson.build | 3 - .../62 bad option argument/meson_options.txt | 1 - test cases/failing/62 subproj filegrab/meson.build | 5 ++ test cases/failing/62 subproj filegrab/prog.c | 1 + .../62 subproj filegrab/subprojects/a/meson.build | 3 + test cases/failing/63 grab subproj/meson.build | 7 ++ .../63 grab subproj/subprojects/foo/meson.build | 3 + .../failing/63 grab subproj/subprojects/foo/sub.c | 6 ++ test cases/failing/63 subproj filegrab/meson.build | 5 -- test cases/failing/63 subproj filegrab/prog.c | 1 - .../63 subproj filegrab/subprojects/a/meson.build | 3 - test cases/failing/64 grab sibling/meson.build | 3 + .../64 grab sibling/subprojects/a/meson.build | 3 + .../64 grab sibling/subprojects/b/meson.build | 3 + .../failing/64 grab sibling/subprojects/b/sneaky.c | 6 ++ test cases/failing/64 grab subproj/meson.build | 7 -- .../64 grab subproj/subprojects/foo/meson.build | 3 - .../failing/64 grab subproj/subprojects/foo/sub.c | 6 -- test cases/failing/65 grab sibling/meson.build | 3 - .../65 grab sibling/subprojects/a/meson.build | 3 - .../65 grab sibling/subprojects/b/meson.build | 3 - .../failing/65 grab sibling/subprojects/b/sneaky.c | 6 -- .../failing/65 string as link target/meson.build | 2 + test cases/failing/65 string as link target/prog.c | 1 + .../meson.build | 2 + .../failing/66 string as link target/meson.build | 2 - test cases/failing/66 string as link target/prog.c | 1 - .../meson.build | 2 - .../failing/67 subproj different versions/main.c | 9 ++ .../67 subproj different versions/meson.build | 9 ++ .../subprojects/a/a.c | 5 ++ .../subprojects/a/a.h | 1 + .../subprojects/a/meson.build | 11 +++ .../subprojects/b/b.c | 5 ++ .../subprojects/b/b.h | 1 + .../subprojects/b/meson.build | 11 +++ .../subprojects/c/c.h | 3 + .../subprojects/c/meson.build | 5 ++ .../failing/68 subproj different versions/main.c | 9 -- .../68 subproj different versions/meson.build | 9 -- .../subprojects/a/a.c | 5 -- .../subprojects/a/a.h | 1 - .../subprojects/a/meson.build | 11 --- .../subprojects/b/b.c | 5 -- .../subprojects/b/b.h | 1 - .../subprojects/b/meson.build | 11 --- .../subprojects/c/c.h | 3 - .../subprojects/c/meson.build | 5 -- .../failing/68 wrong boost module/meson.build | 5 ++ .../69 install_data rename bad size/file1.txt | 0 .../69 install_data rename bad size/file2.txt | 0 .../69 install_data rename bad size/meson.build | 3 + .../failing/69 wrong boost module/meson.build | 5 -- .../70 install_data rename bad size/file1.txt | 0 .../70 install_data rename bad size/file2.txt | 0 .../70 install_data rename bad size/meson.build | 3 - test cases/failing/70 skip only subdir/meson.build | 8 ++ .../failing/70 skip only subdir/subdir/meson.build | 3 + .../failing/71 invalid escape char/meson.build | 4 + test cases/failing/71 skip only subdir/meson.build | 8 -- .../failing/71 skip only subdir/subdir/meson.build | 3 - test cases/failing/72 dual override/meson.build | 5 ++ test cases/failing/72 dual override/overrides.py | 4 + .../failing/72 invalid escape char/meson.build | 4 - test cases/failing/73 dual override/meson.build | 5 -- test cases/failing/73 dual override/overrides.py | 4 - test cases/failing/73 override used/meson.build | 5 ++ test cases/failing/73 override used/other.py | 3 + test cases/failing/73 override used/something.py | 3 + test cases/failing/74 override used/meson.build | 5 -- test cases/failing/74 override used/other.py | 3 - test cases/failing/74 override used/something.py | 3 - .../74 run_command unclean exit/meson.build | 4 + .../74 run_command unclean exit/returncode.py | 4 + .../75 int literal leading zero/meson.build | 6 ++ .../75 run_command unclean exit/meson.build | 4 - .../75 run_command unclean exit/returncode.py | 4 - .../failing/76 configuration immutable/input | 0 .../failing/76 configuration immutable/meson.build | 12 +++ .../76 int literal leading zero/meson.build | 6 -- .../failing/77 configuration immutable/input | 0 .../failing/77 configuration immutable/meson.build | 12 --- .../77 link with shared module on osx/meson.build | 8 ++ .../77 link with shared module on osx/module.c | 3 + .../77 link with shared module on osx/prog.c | 4 + .../78 link with shared module on osx/meson.build | 8 -- .../78 link with shared module on osx/module.c | 3 - .../78 link with shared module on osx/prog.c | 4 - .../config9.h.in | 1 + .../meson.build | 10 +++ .../config9.h.in | 1 - .../meson.build | 10 --- .../meson.build | 2 + .../meson.build | 2 - test cases/failing/80 unfound run/meson.build | 4 + test cases/failing/81 unfound run/meson.build | 4 - .../objc/4 c++ project objc subproject/master.cpp | 11 +++ .../objc/4 c++ project objc subproject/meson.build | 6 ++ .../subprojects/foo/foo.m | 4 + .../subprojects/foo/meson.build | 5 ++ .../objc/6 c++ project objc subproject/master.cpp | 11 --- .../objc/6 c++ project objc subproject/meson.build | 6 -- .../subprojects/foo/foo.m | 4 - .../subprojects/foo/meson.build | 5 -- test cases/unit/10 build_rpath/meson.build | 16 ++++ test cases/unit/10 build_rpath/prog.c | 5 ++ test cases/unit/10 build_rpath/prog.cc | 8 ++ test cases/unit/10 build_rpath/sub/meson.build | 1 + test cases/unit/10 build_rpath/sub/stuff.c | 3 + test cases/unit/10 d dedup/meson.build | 6 -- test cases/unit/10 d dedup/prog.c | 14 --- test cases/unit/11 build_rpath/meson.build | 16 ---- test cases/unit/11 build_rpath/prog.c | 5 -- test cases/unit/11 build_rpath/prog.cc | 8 -- test cases/unit/11 build_rpath/sub/meson.build | 1 - test cases/unit/11 build_rpath/sub/stuff.c | 3 - test cases/unit/11 cross prog/meson.build | 16 ++++ test cases/unit/11 cross prog/some_cross_tool.py | 5 ++ test cases/unit/11 cross prog/sometool.py | 5 ++ test cases/unit/12 cross prog/meson.build | 16 ---- test cases/unit/12 cross prog/some_cross_tool.py | 5 -- test cases/unit/12 cross prog/sometool.py | 5 -- test cases/unit/12 promote/meson.build | 5 ++ .../unit/12 promote/subprojects/s1/meson.build | 7 ++ test cases/unit/12 promote/subprojects/s1/s1.c | 6 ++ .../subprojects/s1/subprojects/s3/meson.build | 4 + .../12 promote/subprojects/s1/subprojects/s3/s3.c | 3 + .../subprojects/s1/subprojects/scommon/meson.build | 4 + .../s1/subprojects/scommon/scommon_broken.c | 1 + .../unit/12 promote/subprojects/s2/meson.build | 6 ++ test cases/unit/12 promote/subprojects/s2/s2.c | 6 ++ .../subprojects/s2/subprojects/athing.wrap | 2 + .../subprojects/s2/subprojects/scommon/meson.build | 4 + .../s2/subprojects/scommon/scommon_ok.c | 3 + test cases/unit/13 promote/meson.build | 5 -- .../unit/13 promote/subprojects/s1/meson.build | 7 -- test cases/unit/13 promote/subprojects/s1/s1.c | 6 -- .../subprojects/s1/subprojects/s3/meson.build | 4 - .../13 promote/subprojects/s1/subprojects/s3/s3.c | 3 - .../subprojects/s1/subprojects/scommon/meson.build | 4 - .../s1/subprojects/scommon/scommon_broken.c | 1 - .../unit/13 promote/subprojects/s2/meson.build | 6 -- test cases/unit/13 promote/subprojects/s2/s2.c | 6 -- .../subprojects/s2/subprojects/athing.wrap | 2 - .../subprojects/s2/subprojects/scommon/meson.build | 4 - .../s2/subprojects/scommon/scommon_ok.c | 3 - test cases/unit/13 testsetup selection/main.c | 3 - test cases/unit/13 testsetup selection/meson.build | 10 --- .../13 testsetup selection/subprojects/bar/bar.c | 3 - .../subprojects/bar/meson.build | 6 -- .../13 testsetup selection/subprojects/foo/foo.c | 3 - .../subprojects/foo/meson.build | 4 - test cases/unit/14 prebuilt object/main.c | 5 -- test cases/unit/14 prebuilt object/meson.build | 25 ------ test cases/unit/14 prebuilt object/source.c | 8 -- test cases/unit/14 testsetup selection/main.c | 3 + test cases/unit/14 testsetup selection/meson.build | 10 +++ .../14 testsetup selection/subprojects/bar/bar.c | 3 + .../subprojects/bar/meson.build | 6 ++ .../14 testsetup selection/subprojects/foo/foo.c | 3 + .../subprojects/foo/meson.build | 4 + test cases/unit/15 prebuilt object/main.c | 5 ++ test cases/unit/15 prebuilt object/meson.build | 25 ++++++ test cases/unit/15 prebuilt object/source.c | 8 ++ test cases/unit/15 prebuilt static/libdir/best.c | 3 - test cases/unit/15 prebuilt static/libdir/best.h | 3 - .../unit/15 prebuilt static/libdir/meson.build | 5 -- test cases/unit/15 prebuilt static/main.c | 7 -- test cases/unit/15 prebuilt static/meson.build | 5 -- test cases/unit/16 prebuilt shared/alexandria.c | 6 -- test cases/unit/16 prebuilt shared/alexandria.h | 20 ----- .../unit/16 prebuilt shared/another_visitor.c | 10 --- test cases/unit/16 prebuilt shared/meson.build | 14 --- test cases/unit/16 prebuilt shared/patron.c | 8 -- test cases/unit/16 prebuilt static/libdir/best.c | 3 + test cases/unit/16 prebuilt static/libdir/best.h | 3 + .../unit/16 prebuilt static/libdir/meson.build | 5 ++ test cases/unit/16 prebuilt static/main.c | 7 ++ test cases/unit/16 prebuilt static/meson.build | 5 ++ test cases/unit/17 pkgconfig static/foo.c | 8 -- test cases/unit/17 pkgconfig static/foo.pc.in | 11 --- test cases/unit/17 pkgconfig static/include/foo.h | 3 - test cases/unit/17 pkgconfig static/main.c | 14 --- test cases/unit/17 pkgconfig static/meson.build | 37 -------- test cases/unit/17 prebuilt shared/alexandria.c | 6 ++ test cases/unit/17 prebuilt shared/alexandria.h | 20 +++++ .../unit/17 prebuilt shared/another_visitor.c | 10 +++ test cases/unit/17 prebuilt shared/meson.build | 14 +++ test cases/unit/17 prebuilt shared/patron.c | 8 ++ test cases/unit/18 array option/meson.build | 15 ---- test cases/unit/18 array option/meson_options.txt | 20 ----- test cases/unit/18 pkgconfig static/foo.c | 8 ++ test cases/unit/18 pkgconfig static/foo.pc.in | 11 +++ test cases/unit/18 pkgconfig static/include/foo.h | 3 + test cases/unit/18 pkgconfig static/main.c | 14 +++ test cases/unit/18 pkgconfig static/meson.build | 37 ++++++++ test cases/unit/19 array option/meson.build | 15 ++++ test cases/unit/19 array option/meson_options.txt | 20 +++++ test cases/unit/21 warning location/a.c | 0 test cases/unit/21 warning location/b.c | 0 test cases/unit/21 warning location/conf.in | 1 - test cases/unit/21 warning location/main.c | 0 test cases/unit/21 warning location/meson.build | 11 --- test cases/unit/21 warning location/sub/c.c | 0 test cases/unit/21 warning location/sub/d.c | 0 .../unit/21 warning location/sub/meson.build | 4 - test cases/unit/21 warning location/sub/sub.c | 0 test cases/unit/22 unfound pkgconfig/meson.build | 15 ---- test cases/unit/22 unfound pkgconfig/some.c | 3 - test cases/unit/22 warning location/a.c | 0 test cases/unit/22 warning location/b.c | 0 test cases/unit/22 warning location/conf.in | 1 + test cases/unit/22 warning location/main.c | 0 test cases/unit/22 warning location/meson.build | 11 +++ test cases/unit/22 warning location/sub/c.c | 0 test cases/unit/22 warning location/sub/d.c | 0 .../unit/22 warning location/sub/meson.build | 4 + test cases/unit/22 warning location/sub/sub.c | 0 .../unit/23 compiler run_command/meson.build | 10 --- .../unit/23 non-permitted kwargs/meson.build | 5 -- test cases/unit/23 unfound pkgconfig/meson.build | 15 ++++ test cases/unit/23 unfound pkgconfig/some.c | 3 + .../unit/24 compiler run_command/meson.build | 10 +++ test cases/unit/24 install umask/datafile.cat | 1 - test cases/unit/24 install umask/meson.build | 7 -- test cases/unit/24 install umask/myinstall.py | 17 ---- test cases/unit/24 install umask/prog.1 | 1 - test cases/unit/24 install umask/prog.c | 3 - test cases/unit/24 install umask/sample.h | 6 -- .../unit/24 install umask/subdir/datafile.dog | 1 - test cases/unit/24 install umask/subdir/sayhello | 2 - .../unit/24 pkgconfig usage/dependee/meson.build | 7 -- .../unit/24 pkgconfig usage/dependee/pkguser.c | 6 -- .../unit/24 pkgconfig usage/dependency/meson.build | 24 ------ .../unit/24 pkgconfig usage/dependency/pkgdep.c | 7 -- .../unit/24 pkgconfig usage/dependency/pkgdep.h | 3 - .../24 pkgconfig usage/dependency/privatelib.c | 3 - test cases/unit/25 ndebug if-release/main.c | 11 --- test cases/unit/25 ndebug if-release/meson.build | 3 - .../unit/25 non-permitted kwargs/meson.build | 5 ++ .../unit/26 guessed linker dependencies/exe/app.c | 6 -- .../26 guessed linker dependencies/exe/meson.build | 7 -- .../unit/26 guessed linker dependencies/lib/lib.c | 20 ----- .../26 guessed linker dependencies/lib/meson.build | 11 --- .../lib/meson_options.txt | 1 - test cases/unit/26 install umask/datafile.cat | 1 + test cases/unit/26 install umask/meson.build | 7 ++ test cases/unit/26 install umask/myinstall.py | 17 ++++ test cases/unit/26 install umask/prog.1 | 1 + test cases/unit/26 install umask/prog.c | 3 + test cases/unit/26 install umask/sample.h | 6 ++ .../unit/26 install umask/subdir/datafile.dog | 1 + test cases/unit/26 install umask/subdir/sayhello | 2 + test cases/unit/26 shared_mod linking/libfile.c | 14 --- test cases/unit/26 shared_mod linking/main.c | 11 --- test cases/unit/26 shared_mod linking/meson.build | 5 -- test cases/unit/27 forcefallback/meson.build | 9 -- .../subprojects/notzlib/meson.build | 7 -- .../27 forcefallback/subprojects/notzlib/notzlib.c | 6 -- .../27 forcefallback/subprojects/notzlib/notzlib.h | 18 ---- test cases/unit/27 forcefallback/test_not_zlib.c | 8 -- .../unit/27 pkgconfig usage/dependee/meson.build | 7 ++ .../unit/27 pkgconfig usage/dependee/pkguser.c | 6 ++ .../unit/27 pkgconfig usage/dependency/meson.build | 24 ++++++ .../unit/27 pkgconfig usage/dependency/pkgdep.c | 7 ++ .../unit/27 pkgconfig usage/dependency/pkgdep.h | 3 + .../27 pkgconfig usage/dependency/privatelib.c | 3 + test cases/unit/28 ndebug if-release/main.c | 11 +++ test cases/unit/28 ndebug if-release/meson.build | 3 + .../unit/28 pkgconfig use libraries/app/app.c | 6 -- .../28 pkgconfig use libraries/app/meson.build | 5 -- .../unit/28 pkgconfig use libraries/lib/liba.c | 2 - .../unit/28 pkgconfig use libraries/lib/libb.c | 5 -- .../28 pkgconfig use libraries/lib/meson.build | 16 ---- .../meson.build | 3 - .../29 cross file overrides always args/test.c | 8 -- .../ubuntu-armhf-overrides.txt | 19 ----- .../unit/29 guessed linker dependencies/exe/app.c | 6 ++ .../29 guessed linker dependencies/exe/meson.build | 7 ++ .../unit/29 guessed linker dependencies/lib/lib.c | 20 +++++ .../29 guessed linker dependencies/lib/meson.build | 11 +++ .../lib/meson_options.txt | 1 + test cases/unit/30 command line/meson.build | 9 -- test cases/unit/30 command line/meson_options.txt | 1 - .../30 command line/subprojects/subp/meson.build | 3 - .../subprojects/subp/meson_options.txt | 1 - .../unit/30 mixed command line args/meson.build | 1 - .../30 mixed command line args/meson_options.txt | 10 --- test cases/unit/30 shared_mod linking/libfile.c | 14 +++ test cases/unit/30 shared_mod linking/main.c | 11 +++ test cases/unit/30 shared_mod linking/meson.build | 5 ++ test cases/unit/31 forcefallback/meson.build | 9 ++ .../subprojects/notzlib/meson.build | 7 ++ .../31 forcefallback/subprojects/notzlib/notzlib.c | 6 ++ .../31 forcefallback/subprojects/notzlib/notzlib.h | 18 ++++ test cases/unit/31 forcefallback/test_not_zlib.c | 8 ++ test cases/unit/31 pkgconfig format/meson.build | 18 ---- test cases/unit/31 pkgconfig format/somelib.c | 7 -- test cases/unit/31 pkgconfig format/someret.c | 3 - .../unit/32 pkgconfig use libraries/app/app.c | 6 ++ .../32 pkgconfig use libraries/app/meson.build | 5 ++ .../unit/32 pkgconfig use libraries/lib/liba.c | 2 + .../unit/32 pkgconfig use libraries/lib/libb.c | 5 ++ .../32 pkgconfig use libraries/lib/meson.build | 16 ++++ test cases/unit/32 python extmodule/blaster.py | 14 --- .../unit/32 python extmodule/ext/meson.build | 6 -- .../unit/32 python extmodule/ext/tachyon_module.c | 59 ------------- test cases/unit/32 python extmodule/meson.build | 23 ----- .../unit/32 python extmodule/meson_options.txt | 3 - .../meson.build | 3 + .../33 cross file overrides always args/test.c | 8 ++ .../ubuntu-armhf-overrides.txt | 19 +++++ .../built library/bar.c | 7 -- .../built library/meson.build | 12 --- .../built library/meson_options.txt | 1 - .../built library/prog.c | 7 -- .../external library/faa.c | 4 - .../external library/foo.c | 4 - .../external library/meson.build | 9 -- test cases/unit/34 command line/meson.build | 9 ++ test cases/unit/34 command line/meson_options.txt | 1 + .../34 command line/subprojects/subp/meson.build | 3 + .../subprojects/subp/meson_options.txt | 1 + .../unit/34 featurenew subprojects/meson.build | 6 -- .../subprojects/bar/meson.build | 3 - .../subprojects/foo/meson.build | 3 - .../unit/35 mixed command line args/meson.build | 1 + .../35 mixed command line args/meson_options.txt | 10 +++ test cases/unit/35 rpath order/meson.build | 11 --- test cases/unit/35 rpath order/myexe.c | 3 - .../unit/35 rpath order/subprojects/sub1/lib.c | 0 .../35 rpath order/subprojects/sub1/meson.build | 5 -- .../unit/35 rpath order/subprojects/sub2/lib.c | 0 .../35 rpath order/subprojects/sub2/meson.build | 5 -- test cases/unit/36 dep order/lib1.c | 0 test cases/unit/36 dep order/lib2.c | 0 test cases/unit/36 dep order/meson.build | 8 -- test cases/unit/36 dep order/myexe.c | 3 - test cases/unit/36 pkgconfig format/meson.build | 18 ++++ test cases/unit/36 pkgconfig format/somelib.c | 7 ++ test cases/unit/36 pkgconfig format/someret.c | 3 + test cases/unit/37 python extmodule/blaster.py | 14 +++ .../unit/37 python extmodule/ext/meson.build | 6 ++ .../unit/37 python extmodule/ext/tachyon_module.c | 59 +++++++++++++ test cases/unit/37 python extmodule/meson.build | 23 +++++ .../unit/37 python extmodule/meson_options.txt | 3 + .../built library/bar.c | 7 ++ .../built library/meson.build | 12 +++ .../built library/meson_options.txt | 1 + .../built library/prog.c | 7 ++ .../external library/faa.c | 4 + .../external library/foo.c | 4 + .../external library/meson.build | 9 ++ .../unit/39 featurenew subprojects/meson.build | 6 ++ .../subprojects/bar/meson.build | 3 + .../subprojects/foo/meson.build | 3 + test cases/unit/40 rpath order/meson.build | 11 +++ test cases/unit/40 rpath order/myexe.c | 3 + .../unit/40 rpath order/subprojects/sub1/lib.c | 0 .../40 rpath order/subprojects/sub1/meson.build | 5 ++ .../unit/40 rpath order/subprojects/sub2/lib.c | 0 .../40 rpath order/subprojects/sub2/meson.build | 5 ++ test cases/unit/41 dep order/lib1.c | 0 test cases/unit/41 dep order/lib2.c | 0 test cases/unit/41 dep order/meson.build | 8 ++ test cases/unit/41 dep order/myexe.c | 3 + test cases/unit/8 -L -l order/first.pc | 13 +++ test cases/unit/8 -L -l order/meson.build | 6 ++ test cases/unit/8 -L -l order/prog.c | 5 ++ test cases/unit/8 -L -l order/second.pc | 13 +++ test cases/unit/9 -L -l order/first.pc | 13 --- test cases/unit/9 -L -l order/meson.build | 6 -- test cases/unit/9 -L -l order/prog.c | 5 -- test cases/unit/9 -L -l order/second.pc | 13 --- test cases/unit/9 d dedup/meson.build | 6 ++ test cases/unit/9 d dedup/prog.c | 14 +++ .../meson.build | 10 +++ .../prog.c | 5 ++ .../subdir/make_def.py | 6 ++ .../subdir/meson.build | 7 ++ .../subdir/somedll.c | 3 + .../10 vs module defs generated/meson.build | 5 -- .../windows/10 vs module defs generated/prog.c | 5 -- .../10 vs module defs generated/subdir/meson.build | 9 -- .../10 vs module defs generated/subdir/somedll.c | 3 - .../subdir/somedll.def.in | 2 - .../windows/11 exe implib/installed_files.txt | 8 ++ test cases/windows/11 exe implib/meson.build | 7 ++ test cases/windows/11 exe implib/prog.c | 6 ++ .../meson.build | 10 --- .../prog.c | 5 -- .../subdir/make_def.py | 6 -- .../subdir/meson.build | 7 -- .../subdir/somedll.c | 3 - .../windows/12 exe implib/installed_files.txt | 8 -- test cases/windows/12 exe implib/meson.build | 7 -- test cases/windows/12 exe implib/prog.c | 6 -- .../12 resources with custom targets/meson.build | 70 +++++++++++++++ .../12 resources with custom targets/prog.c | 14 +++ .../res/gen-res.py | 6 ++ .../res/meson.build | 19 +++++ .../res/myres.rc.in | 4 + .../res/myres_static.rc | 3 + .../res/resource.h | 0 .../res/sample.ico | Bin 0 -> 9662 bytes .../13 resources with custom targets/meson.build | 70 --------------- .../13 resources with custom targets/prog.c | 14 --- .../res/gen-res.py | 6 -- .../res/meson.build | 19 ----- .../res/myres.rc.in | 4 - .../res/myres_static.rc | 3 - .../res/resource.h | 0 .../res/sample.ico | Bin 9662 -> 0 bytes .../13 test argument extra paths/exe/main.c | 5 ++ .../13 test argument extra paths/exe/meson.build | 3 + .../windows/13 test argument extra paths/lib/foo.c | 6 ++ .../windows/13 test argument extra paths/lib/foo.h | 14 +++ .../13 test argument extra paths/lib/meson.build | 3 + .../13 test argument extra paths/meson.build | 5 ++ .../13 test argument extra paths/test/meson.build | 3 + .../test/test_run_exe.py | 12 +++ .../ico/gen-ico.py | 6 ++ .../ico/meson.build | 8 ++ .../ico/sample.ico.in | Bin 0 -> 9662 bytes .../meson.build | 69 +++++++++++++++ .../prog.c | 14 +++ .../res/meson.build | 4 + .../res/myres.rc | 3 + .../14 test argument extra paths/exe/main.c | 5 -- .../14 test argument extra paths/exe/meson.build | 3 - .../windows/14 test argument extra paths/lib/foo.c | 6 -- .../windows/14 test argument extra paths/lib/foo.h | 14 --- .../14 test argument extra paths/lib/meson.build | 3 - .../14 test argument extra paths/meson.build | 5 -- .../14 test argument extra paths/test/meson.build | 3 - .../test/test_run_exe.py | 12 --- .../a/meson.build | 1 + .../a/rsrc.rc | 1 + .../b/meson.build | 2 + .../b/rsrc.rc | 1 + .../c/meson.build | 2 + .../c/rsrc.rc | 1 + .../meson.build | 19 +++++ .../rsrc.rc | 1 + .../verify.c | 23 +++++ .../ico/gen-ico.py | 6 -- .../ico/meson.build | 8 -- .../ico/sample.ico.in | Bin 9662 -> 0 bytes .../meson.build | 69 --------------- .../prog.c | 14 --- .../res/meson.build | 4 - .../res/myres.rc | 3 - .../a/meson.build | 1 - .../a/rsrc.rc | 1 - .../b/meson.build | 2 - .../b/rsrc.rc | 1 - .../c/meson.build | 2 - .../c/rsrc.rc | 1 - .../meson.build | 19 ----- .../rsrc.rc | 1 - .../verify.c | 23 ----- test cases/windows/7 dll versioning/copyfile.py | 6 ++ test cases/windows/7 dll versioning/exe.orig.c | 9 ++ .../windows/7 dll versioning/installed_files.txt | 26 ++++++ test cases/windows/7 dll versioning/lib.c | 6 ++ test cases/windows/7 dll versioning/meson.build | 52 ++++++++++++ test cases/windows/8 dll versioning/copyfile.py | 6 -- test cases/windows/8 dll versioning/exe.orig.c | 9 -- .../windows/8 dll versioning/installed_files.txt | 26 ------ test cases/windows/8 dll versioning/lib.c | 6 -- test cases/windows/8 dll versioning/meson.build | 52 ------------ test cases/windows/8 find program/meson.build | 12 +++ test cases/windows/8 find program/test-script | 3 + .../windows/8 find program/test-script-ext.py | 3 + test cases/windows/9 find program/meson.build | 12 --- test cases/windows/9 find program/test-script | 3 - .../windows/9 find program/test-script-ext.py | 3 - .../windows/9 vs module defs generated/meson.build | 5 ++ .../windows/9 vs module defs generated/prog.c | 5 ++ .../9 vs module defs generated/subdir/meson.build | 9 ++ .../9 vs module defs generated/subdir/somedll.c | 3 + .../subdir/somedll.def.in | 2 + 1038 files changed, 4317 insertions(+), 4317 deletions(-) create mode 100644 test cases/common/157 dotinclude/dotproc.c create mode 100644 test cases/common/157 dotinclude/meson.build create mode 100644 test cases/common/157 dotinclude/stdio.h delete mode 100644 test cases/common/158 dotinclude/dotproc.c delete mode 100644 test cases/common/158 dotinclude/meson.build delete mode 100644 test cases/common/158 dotinclude/stdio.h create mode 100644 test cases/common/158 reserved targets/all/meson.build create mode 100644 test cases/common/158 reserved targets/benchmark/meson.build create mode 100644 test cases/common/158 reserved targets/clean-ctlist/meson.build create mode 100644 test cases/common/158 reserved targets/clean-gcda/meson.build create mode 100644 test cases/common/158 reserved targets/clean-gcno/meson.build create mode 100644 test cases/common/158 reserved targets/clean/meson.build create mode 100644 test cases/common/158 reserved targets/coverage-html/meson.build create mode 100644 test cases/common/158 reserved targets/coverage-text/meson.build create mode 100644 test cases/common/158 reserved targets/coverage-xml/meson.build create mode 100644 test cases/common/158 reserved targets/coverage/meson.build create mode 100644 test cases/common/158 reserved targets/dist/meson.build create mode 100644 test cases/common/158 reserved targets/distcheck/meson.build create mode 100644 test cases/common/158 reserved targets/install/meson.build create mode 100644 test cases/common/158 reserved targets/meson.build create mode 100644 test cases/common/158 reserved targets/phony/meson.build create mode 100644 test cases/common/158 reserved targets/reconfigure/meson.build create mode 100644 test cases/common/158 reserved targets/runtarget/meson.build create mode 100644 test cases/common/158 reserved targets/scan-build/meson.build create mode 100644 test cases/common/158 reserved targets/test.c create mode 100644 test cases/common/158 reserved targets/test/meson.build create mode 100644 test cases/common/158 reserved targets/uninstall/meson.build create mode 100644 test cases/common/159 duplicate source names/dir1/file.c create mode 100644 test cases/common/159 duplicate source names/dir1/meson.build create mode 100644 test cases/common/159 duplicate source names/dir2/dir1/file.c create mode 100644 test cases/common/159 duplicate source names/dir2/file.c create mode 100644 test cases/common/159 duplicate source names/dir2/meson.build create mode 100644 test cases/common/159 duplicate source names/dir3/dir1/file.c create mode 100644 test cases/common/159 duplicate source names/dir3/file.c create mode 100644 test cases/common/159 duplicate source names/dir3/meson.build create mode 100644 test cases/common/159 duplicate source names/meson.build delete mode 100644 test cases/common/159 reserved targets/all/meson.build delete mode 100644 test cases/common/159 reserved targets/benchmark/meson.build delete mode 100644 test cases/common/159 reserved targets/clean-ctlist/meson.build delete mode 100644 test cases/common/159 reserved targets/clean-gcda/meson.build delete mode 100644 test cases/common/159 reserved targets/clean-gcno/meson.build delete mode 100644 test cases/common/159 reserved targets/clean/meson.build delete mode 100644 test cases/common/159 reserved targets/coverage-html/meson.build delete mode 100644 test cases/common/159 reserved targets/coverage-text/meson.build delete mode 100644 test cases/common/159 reserved targets/coverage-xml/meson.build delete mode 100644 test cases/common/159 reserved targets/coverage/meson.build delete mode 100644 test cases/common/159 reserved targets/dist/meson.build delete mode 100644 test cases/common/159 reserved targets/distcheck/meson.build delete mode 100644 test cases/common/159 reserved targets/install/meson.build delete mode 100644 test cases/common/159 reserved targets/meson.build delete mode 100644 test cases/common/159 reserved targets/phony/meson.build delete mode 100644 test cases/common/159 reserved targets/reconfigure/meson.build delete mode 100644 test cases/common/159 reserved targets/runtarget/meson.build delete mode 100644 test cases/common/159 reserved targets/scan-build/meson.build delete mode 100644 test cases/common/159 reserved targets/test.c delete mode 100644 test cases/common/159 reserved targets/test/meson.build delete mode 100644 test cases/common/159 reserved targets/uninstall/meson.build delete mode 100644 test cases/common/160 duplicate source names/dir1/file.c delete mode 100644 test cases/common/160 duplicate source names/dir1/meson.build delete mode 100644 test cases/common/160 duplicate source names/dir2/dir1/file.c delete mode 100644 test cases/common/160 duplicate source names/dir2/file.c delete mode 100644 test cases/common/160 duplicate source names/dir2/meson.build delete mode 100644 test cases/common/160 duplicate source names/dir3/dir1/file.c delete mode 100644 test cases/common/160 duplicate source names/dir3/file.c delete mode 100644 test cases/common/160 duplicate source names/dir3/meson.build delete mode 100644 test cases/common/160 duplicate source names/meson.build create mode 100644 test cases/common/160 index customtarget/check_args.py create mode 100644 test cases/common/160 index customtarget/gen_sources.py create mode 100644 test cases/common/160 index customtarget/lib.c create mode 100644 test cases/common/160 index customtarget/meson.build create mode 100644 test cases/common/160 index customtarget/subdir/foo.c create mode 100644 test cases/common/160 index customtarget/subdir/meson.build delete mode 100644 test cases/common/161 index customtarget/check_args.py delete mode 100644 test cases/common/161 index customtarget/gen_sources.py delete mode 100644 test cases/common/161 index customtarget/lib.c delete mode 100644 test cases/common/161 index customtarget/meson.build delete mode 100644 test cases/common/161 index customtarget/subdir/foo.c delete mode 100644 test cases/common/161 index customtarget/subdir/meson.build create mode 100644 test cases/common/161 wrap file should not failed/meson.build create mode 100644 test cases/common/161 wrap file should not failed/src/meson.build create mode 100644 test cases/common/161 wrap file should not failed/src/subprojects/foo/prog2.c create mode 100644 test cases/common/161 wrap file should not failed/src/subprojects/prog.c create mode 100644 test cases/common/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip create mode 100644 test cases/common/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz create mode 100644 test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/foo.c create mode 100644 test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/meson.build create mode 100644 test cases/common/161 wrap file should not failed/subprojects/zlib.wrap create mode 100644 test cases/common/162 includedir subproj/meson.build create mode 100644 test cases/common/162 includedir subproj/prog.c create mode 100644 test cases/common/162 includedir subproj/subprojects/inctest/include/incfile.h create mode 100644 test cases/common/162 includedir subproj/subprojects/inctest/meson.build delete mode 100644 test cases/common/162 wrap file should not failed/meson.build delete mode 100644 test cases/common/162 wrap file should not failed/src/meson.build delete mode 100644 test cases/common/162 wrap file should not failed/src/subprojects/foo/prog2.c delete mode 100644 test cases/common/162 wrap file should not failed/src/subprojects/prog.c delete mode 100644 test cases/common/162 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip delete mode 100644 test cases/common/162 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz delete mode 100644 test cases/common/162 wrap file should not failed/subprojects/zlib-1.2.8/foo.c delete mode 100644 test cases/common/162 wrap file should not failed/subprojects/zlib-1.2.8/meson.build delete mode 100644 test cases/common/162 wrap file should not failed/subprojects/zlib.wrap delete mode 100644 test cases/common/163 includedir subproj/meson.build delete mode 100644 test cases/common/163 includedir subproj/prog.c delete mode 100644 test cases/common/163 includedir subproj/subprojects/inctest/include/incfile.h delete mode 100644 test cases/common/163 includedir subproj/subprojects/inctest/meson.build create mode 100644 test cases/common/163 subproject dir name collision/a.c create mode 100644 test cases/common/163 subproject dir name collision/custom_subproject_dir/B/b.c create mode 100644 test cases/common/163 subproject dir name collision/custom_subproject_dir/B/meson.build create mode 100644 test cases/common/163 subproject dir name collision/custom_subproject_dir/C/c.c create mode 100644 test cases/common/163 subproject dir name collision/custom_subproject_dir/C/meson.build create mode 100644 test cases/common/163 subproject dir name collision/meson.build create mode 100644 test cases/common/163 subproject dir name collision/other_subdir/custom_subproject_dir/other.c create mode 100644 test cases/common/163 subproject dir name collision/other_subdir/meson.build create mode 100644 test cases/common/164 config tool variable/meson.build delete mode 100644 test cases/common/164 subproject dir name collision/a.c delete mode 100644 test cases/common/164 subproject dir name collision/custom_subproject_dir/B/b.c delete mode 100644 test cases/common/164 subproject dir name collision/custom_subproject_dir/B/meson.build delete mode 100644 test cases/common/164 subproject dir name collision/custom_subproject_dir/C/c.c delete mode 100644 test cases/common/164 subproject dir name collision/custom_subproject_dir/C/meson.build delete mode 100644 test cases/common/164 subproject dir name collision/meson.build delete mode 100644 test cases/common/164 subproject dir name collision/other_subdir/custom_subproject_dir/other.c delete mode 100644 test cases/common/164 subproject dir name collision/other_subdir/meson.build delete mode 100644 test cases/common/165 config tool variable/meson.build create mode 100644 test cases/common/165 custom target subdir depend files/copyfile.py create mode 100644 test cases/common/165 custom target subdir depend files/meson.build create mode 100644 test cases/common/165 custom target subdir depend files/subdir/dep.dat create mode 100644 test cases/common/165 custom target subdir depend files/subdir/foo.c.in create mode 100644 test cases/common/165 custom target subdir depend files/subdir/meson.build delete mode 100644 test cases/common/166 custom target subdir depend files/copyfile.py delete mode 100644 test cases/common/166 custom target subdir depend files/meson.build delete mode 100644 test cases/common/166 custom target subdir depend files/subdir/dep.dat delete mode 100644 test cases/common/166 custom target subdir depend files/subdir/foo.c.in delete mode 100644 test cases/common/166 custom target subdir depend files/subdir/meson.build create mode 100644 test cases/common/166 external program shebang parsing/input.txt create mode 100644 test cases/common/166 external program shebang parsing/main.c create mode 100644 test cases/common/166 external program shebang parsing/meson.build create mode 100644 test cases/common/166 external program shebang parsing/script.int.in create mode 100644 test cases/common/167 disabler/meson.build delete mode 100644 test cases/common/167 external program shebang parsing/input.txt delete mode 100644 test cases/common/167 external program shebang parsing/main.c delete mode 100644 test cases/common/167 external program shebang parsing/meson.build delete mode 100644 test cases/common/167 external program shebang parsing/script.int.in create mode 100644 test cases/common/168 array option/meson.build create mode 100644 test cases/common/168 array option/meson_options.txt delete mode 100644 test cases/common/168 disabler/meson.build delete mode 100644 test cases/common/169 array option/meson.build delete mode 100644 test cases/common/169 array option/meson_options.txt create mode 100644 test cases/common/169 custom target template substitution/checkcopy.py create mode 100644 test cases/common/169 custom target template substitution/foo.c.in create mode 100644 test cases/common/169 custom target template substitution/meson.build delete mode 100644 test cases/common/170 custom target template substitution/checkcopy.py delete mode 100644 test cases/common/170 custom target template substitution/foo.c.in delete mode 100644 test cases/common/170 custom target template substitution/meson.build create mode 100644 test cases/common/170 not-found dependency/meson.build create mode 100644 test cases/common/170 not-found dependency/sub/meson.build create mode 100644 test cases/common/170 not-found dependency/subprojects/trivial/meson.build create mode 100644 test cases/common/170 not-found dependency/subprojects/trivial/trivial.c create mode 100644 test cases/common/170 not-found dependency/testlib.c delete mode 100644 test cases/common/171 not-found dependency/meson.build delete mode 100644 test cases/common/171 not-found dependency/sub/meson.build delete mode 100644 test cases/common/171 not-found dependency/subprojects/trivial/meson.build delete mode 100644 test cases/common/171 not-found dependency/subprojects/trivial/trivial.c delete mode 100644 test cases/common/171 not-found dependency/testlib.c create mode 100644 test cases/common/171 subdir if_found/meson.build create mode 100644 test cases/common/171 subdir if_found/subdir/meson.build create mode 100644 test cases/common/172 default options prefix dependent defaults/meson.build delete mode 100644 test cases/common/172 subdir if_found/meson.build delete mode 100644 test cases/common/172 subdir if_found/subdir/meson.build delete mode 100644 test cases/common/173 default options prefix dependent defaults/meson.build create mode 100644 test cases/common/173 dependency factory/meson.build delete mode 100644 test cases/common/174 dependency factory/meson.build create mode 100644 test cases/common/174 get project license/bar.c create mode 100644 test cases/common/174 get project license/meson.build delete mode 100644 test cases/common/175 get project license/bar.c delete mode 100644 test cases/common/175 get project license/meson.build create mode 100644 test cases/common/175 yield/meson.build create mode 100644 test cases/common/175 yield/meson_options.txt create mode 100644 test cases/common/175 yield/subprojects/sub/meson.build create mode 100644 test cases/common/175 yield/subprojects/sub/meson_options.txt create mode 100644 test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/a.c create mode 100644 test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build create mode 100644 test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here create mode 100644 test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/b.c create mode 100644 test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/meson.build create mode 100644 test cases/common/176 subproject nested subproject dirs/meson.build create mode 100644 test cases/common/176 subproject nested subproject dirs/prog.c delete mode 100644 test cases/common/176 yield/meson.build delete mode 100644 test cases/common/176 yield/meson_options.txt delete mode 100644 test cases/common/176 yield/subprojects/sub/meson.build delete mode 100644 test cases/common/176 yield/subprojects/sub/meson_options.txt create mode 100644 test cases/common/177 preserve gendir/base.inp create mode 100644 test cases/common/177 preserve gendir/com/mesonbuild/subbie.inp create mode 100755 test cases/common/177 preserve gendir/genprog.py create mode 100644 test cases/common/177 preserve gendir/meson.build create mode 100644 test cases/common/177 preserve gendir/testprog.c delete mode 100644 test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/a.c delete mode 100644 test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build delete mode 100644 test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here delete mode 100644 test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/b.c delete mode 100644 test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/meson.build delete mode 100644 test cases/common/177 subproject nested subproject dirs/meson.build delete mode 100644 test cases/common/177 subproject nested subproject dirs/prog.c delete mode 100644 test cases/common/178 preserve gendir/base.inp delete mode 100644 test cases/common/178 preserve gendir/com/mesonbuild/subbie.inp delete mode 100755 test cases/common/178 preserve gendir/genprog.py delete mode 100644 test cases/common/178 preserve gendir/meson.build delete mode 100644 test cases/common/178 preserve gendir/testprog.c create mode 100644 test cases/common/178 source in dep/bar.cpp create mode 100644 test cases/common/178 source in dep/foo.c create mode 100644 test cases/common/178 source in dep/generated/funname create mode 100755 test cases/common/178 source in dep/generated/genheader.py create mode 100644 test cases/common/178 source in dep/generated/main.c create mode 100644 test cases/common/178 source in dep/generated/meson.build create mode 100644 test cases/common/178 source in dep/meson.build create mode 100644 test cases/common/179 generator link whole/export.h create mode 100755 test cases/common/179 generator link whole/generator.py create mode 100644 test cases/common/179 generator link whole/main.c create mode 100644 test cases/common/179 generator link whole/meson.build create mode 100644 test cases/common/179 generator link whole/meson_test_function.tmpl create mode 100644 test cases/common/179 generator link whole/pull_meson_test_function.c delete mode 100644 test cases/common/179 source in dep/bar.cpp delete mode 100644 test cases/common/179 source in dep/foo.c delete mode 100644 test cases/common/179 source in dep/generated/funname delete mode 100755 test cases/common/179 source in dep/generated/genheader.py delete mode 100644 test cases/common/179 source in dep/generated/main.c delete mode 100644 test cases/common/179 source in dep/generated/meson.build delete mode 100644 test cases/common/179 source in dep/meson.build delete mode 100644 test cases/common/180 generator link whole/export.h delete mode 100755 test cases/common/180 generator link whole/generator.py delete mode 100644 test cases/common/180 generator link whole/main.c delete mode 100644 test cases/common/180 generator link whole/meson.build delete mode 100644 test cases/common/180 generator link whole/meson_test_function.tmpl delete mode 100644 test cases/common/180 generator link whole/pull_meson_test_function.c create mode 100644 test cases/common/180 initial c_args/meson.build create mode 100644 test cases/common/180 initial c_args/test_args.txt create mode 100644 test cases/common/181 identical target name in subproject flat layout/foo.c create mode 100644 test cases/common/181 identical target name in subproject flat layout/main.c create mode 100644 test cases/common/181 identical target name in subproject flat layout/meson.build create mode 100644 test cases/common/181 identical target name in subproject flat layout/subprojects/subproj/foo.c create mode 100644 test cases/common/181 identical target name in subproject flat layout/subprojects/subproj/meson.build delete mode 100644 test cases/common/181 initial c_args/meson.build delete mode 100644 test cases/common/181 initial c_args/test_args.txt create mode 100644 test cases/common/182 as-needed/config.h create mode 100644 test cases/common/182 as-needed/libA.cpp create mode 100644 test cases/common/182 as-needed/libA.h create mode 100644 test cases/common/182 as-needed/libB.cpp create mode 100644 test cases/common/182 as-needed/main.cpp create mode 100644 test cases/common/182 as-needed/meson.build delete mode 100644 test cases/common/182 identical target name in subproject flat layout/foo.c delete mode 100644 test cases/common/182 identical target name in subproject flat layout/main.c delete mode 100644 test cases/common/182 identical target name in subproject flat layout/meson.build delete mode 100644 test cases/common/182 identical target name in subproject flat layout/subprojects/subproj/foo.c delete mode 100644 test cases/common/182 identical target name in subproject flat layout/subprojects/subproj/meson.build create mode 100644 test cases/common/183 ndebug if-release enabled/main.c create mode 100644 test cases/common/183 ndebug if-release enabled/meson.build delete mode 100644 test cases/common/184 as-needed/config.h delete mode 100644 test cases/common/184 as-needed/libA.cpp delete mode 100644 test cases/common/184 as-needed/libA.h delete mode 100644 test cases/common/184 as-needed/libB.cpp delete mode 100644 test cases/common/184 as-needed/main.cpp delete mode 100644 test cases/common/184 as-needed/meson.build create mode 100644 test cases/common/184 ndebug if-release disabled/main.c create mode 100644 test cases/common/184 ndebug if-release disabled/meson.build delete mode 100644 test cases/common/185 ndebug if-release enabled/main.c delete mode 100644 test cases/common/185 ndebug if-release enabled/meson.build create mode 100644 test cases/common/185 subproject version/meson.build create mode 100644 test cases/common/185 subproject version/subprojects/a/meson.build delete mode 100644 test cases/common/186 ndebug if-release disabled/main.c delete mode 100644 test cases/common/186 ndebug if-release disabled/meson.build create mode 100644 test cases/common/186 subdir_done/meson.build create mode 100644 test cases/common/187 bothlibraries/libfile.c create mode 100644 test cases/common/187 bothlibraries/main.c create mode 100644 test cases/common/187 bothlibraries/meson.build create mode 100644 test cases/common/187 bothlibraries/mylib.h delete mode 100644 test cases/common/187 subproject version/meson.build delete mode 100644 test cases/common/187 subproject version/subprojects/a/meson.build create mode 100644 test cases/common/188 escape and unicode/file.c.in create mode 100644 test cases/common/188 escape and unicode/file.py create mode 100644 test cases/common/188 escape and unicode/find.py create mode 100644 test cases/common/188 escape and unicode/fun.c create mode 100644 test cases/common/188 escape and unicode/main.c create mode 100644 test cases/common/188 escape and unicode/meson.build delete mode 100644 test cases/common/188 subdir_done/meson.build delete mode 100644 test cases/common/189 bothlibraries/libfile.c delete mode 100644 test cases/common/189 bothlibraries/main.c delete mode 100644 test cases/common/189 bothlibraries/meson.build delete mode 100644 test cases/common/189 bothlibraries/mylib.h create mode 100644 test cases/common/189 has link arg/meson.build delete mode 100644 test cases/common/190 escape and unicode/file.c.in delete mode 100644 test cases/common/190 escape and unicode/file.py delete mode 100644 test cases/common/190 escape and unicode/find.py delete mode 100644 test cases/common/190 escape and unicode/fun.c delete mode 100644 test cases/common/190 escape and unicode/main.c delete mode 100644 test cases/common/190 escape and unicode/meson.build create mode 100644 test cases/common/190 same target name flat layout/foo.c create mode 100644 test cases/common/190 same target name flat layout/main.c create mode 100644 test cases/common/190 same target name flat layout/meson.build create mode 100644 test cases/common/190 same target name flat layout/subdir/foo.c create mode 100644 test cases/common/190 same target name flat layout/subdir/meson.build create mode 100644 test cases/common/191 find override/meson.build create mode 100644 test cases/common/191 find override/otherdir/main.c create mode 100644 test cases/common/191 find override/otherdir/main2.c create mode 100644 test cases/common/191 find override/otherdir/meson.build create mode 100644 test cases/common/191 find override/otherdir/source.desc create mode 100644 test cases/common/191 find override/otherdir/source2.desc create mode 100755 test cases/common/191 find override/subdir/converter.py create mode 100755 test cases/common/191 find override/subdir/gencodegen.py.in create mode 100644 test cases/common/191 find override/subdir/meson.build delete mode 100644 test cases/common/191 has link arg/meson.build create mode 100644 test cases/common/192 partial dependency/declare_dependency/headers/foo.c create mode 100644 test cases/common/192 partial dependency/declare_dependency/headers/foo.h create mode 100644 test cases/common/192 partial dependency/declare_dependency/main.c create mode 100644 test cases/common/192 partial dependency/declare_dependency/meson.build create mode 100644 test cases/common/192 partial dependency/declare_dependency/other.c create mode 100644 test cases/common/192 partial dependency/meson.build delete mode 100644 test cases/common/192 same target name flat layout/foo.c delete mode 100644 test cases/common/192 same target name flat layout/main.c delete mode 100644 test cases/common/192 same target name flat layout/meson.build delete mode 100644 test cases/common/192 same target name flat layout/subdir/foo.c delete mode 100644 test cases/common/192 same target name flat layout/subdir/meson.build delete mode 100644 test cases/common/193 find override/meson.build delete mode 100644 test cases/common/193 find override/otherdir/main.c delete mode 100644 test cases/common/193 find override/otherdir/main2.c delete mode 100644 test cases/common/193 find override/otherdir/meson.build delete mode 100644 test cases/common/193 find override/otherdir/source.desc delete mode 100644 test cases/common/193 find override/otherdir/source2.desc delete mode 100755 test cases/common/193 find override/subdir/converter.py delete mode 100755 test cases/common/193 find override/subdir/gencodegen.py.in delete mode 100644 test cases/common/193 find override/subdir/meson.build create mode 100644 test cases/common/193 openmp/main.c create mode 100644 test cases/common/193 openmp/main.cpp create mode 100644 test cases/common/193 openmp/main.f90 create mode 100644 test cases/common/193 openmp/meson.build delete mode 100644 test cases/common/194 partial dependency/declare_dependency/headers/foo.c delete mode 100644 test cases/common/194 partial dependency/declare_dependency/headers/foo.h delete mode 100644 test cases/common/194 partial dependency/declare_dependency/main.c delete mode 100644 test cases/common/194 partial dependency/declare_dependency/meson.build delete mode 100644 test cases/common/194 partial dependency/declare_dependency/other.c delete mode 100644 test cases/common/194 partial dependency/meson.build create mode 100644 test cases/common/194 same target name/file.c create mode 100644 test cases/common/194 same target name/meson.build create mode 100644 test cases/common/194 same target name/sub/file2.c create mode 100644 test cases/common/194 same target name/sub/meson.build delete mode 100644 test cases/common/195 openmp/main.c delete mode 100644 test cases/common/195 openmp/main.cpp delete mode 100644 test cases/common/195 openmp/main.f90 delete mode 100644 test cases/common/195 openmp/meson.build create mode 100755 test cases/common/195 test depends/gen.py create mode 100644 test cases/common/195 test depends/main.c create mode 100644 test cases/common/195 test depends/meson.build create mode 100755 test cases/common/195 test depends/test.py create mode 100644 test cases/common/196 args flattening/meson.build delete mode 100644 test cases/common/196 same target name/file.c delete mode 100644 test cases/common/196 same target name/meson.build delete mode 100644 test cases/common/196 same target name/sub/file2.c delete mode 100644 test cases/common/196 same target name/sub/meson.build create mode 100644 test cases/common/197 dict/meson.build create mode 100644 test cases/common/197 dict/prog.c delete mode 100755 test cases/common/197 test depends/gen.py delete mode 100644 test cases/common/197 test depends/main.c delete mode 100644 test cases/common/197 test depends/meson.build delete mode 100755 test cases/common/197 test depends/test.py delete mode 100644 test cases/common/198 args flattening/meson.build create mode 100644 test cases/common/198 check header/meson.build create mode 100644 test cases/common/198 check header/ouagadougou.h delete mode 100644 test cases/common/199 dict/meson.build delete mode 100644 test cases/common/199 dict/prog.c create mode 100644 test cases/common/199 install_mode/config.h.in create mode 100644 test cases/common/199 install_mode/data_source.txt create mode 100644 test cases/common/199 install_mode/foo.1 create mode 100644 test cases/common/199 install_mode/installed_files.txt create mode 100644 test cases/common/199 install_mode/meson.build create mode 100644 test cases/common/199 install_mode/rootdir.h create mode 100644 test cases/common/199 install_mode/runscript.sh create mode 100644 test cases/common/199 install_mode/stat.c create mode 100644 test cases/common/199 install_mode/sub1/second.dat create mode 100644 test cases/common/199 install_mode/trivial.c delete mode 100644 test cases/common/200 check header/meson.build delete mode 100644 test cases/common/200 check header/ouagadougou.h create mode 100644 test cases/common/200 subproject array version/meson.build create mode 100644 test cases/common/200 subproject array version/subprojects/foo/meson.build create mode 100644 test cases/common/201 feature option/meson.build create mode 100644 test cases/common/201 feature option/meson_options.txt delete mode 100644 test cases/common/201 install_mode/config.h.in delete mode 100644 test cases/common/201 install_mode/data_source.txt delete mode 100644 test cases/common/201 install_mode/foo.1 delete mode 100644 test cases/common/201 install_mode/installed_files.txt delete mode 100644 test cases/common/201 install_mode/meson.build delete mode 100644 test cases/common/201 install_mode/rootdir.h delete mode 100644 test cases/common/201 install_mode/runscript.sh delete mode 100644 test cases/common/201 install_mode/stat.c delete mode 100644 test cases/common/201 install_mode/sub1/second.dat delete mode 100644 test cases/common/201 install_mode/trivial.c create mode 100644 test cases/common/202 feature option disabled/meson.build create mode 100644 test cases/common/202 feature option disabled/meson_options.txt delete mode 100644 test cases/common/202 subproject array version/meson.build delete mode 100644 test cases/common/202 subproject array version/subprojects/foo/meson.build delete mode 100644 test cases/common/203 feature option/meson.build delete mode 100644 test cases/common/203 feature option/meson_options.txt create mode 100644 test cases/common/203 static threads/lib1.c create mode 100644 test cases/common/203 static threads/lib2.c create mode 100644 test cases/common/203 static threads/meson.build create mode 100644 test cases/common/203 static threads/prog.c delete mode 100644 test cases/common/204 feature option disabled/meson.build delete mode 100644 test cases/common/204 feature option disabled/meson_options.txt delete mode 100644 test cases/common/205 static threads/lib1.c delete mode 100644 test cases/common/205 static threads/lib2.c delete mode 100644 test cases/common/205 static threads/meson.build delete mode 100644 test cases/common/205 static threads/prog.c create mode 100644 test cases/failing/24 int conversion/meson.build create mode 100644 test cases/failing/25 badlang/meson.build delete mode 100644 test cases/failing/25 int conversion/meson.build delete mode 100644 test cases/failing/26 badlang/meson.build create mode 100644 test cases/failing/26 output subdir/foo.in create mode 100644 test cases/failing/26 output subdir/meson.build create mode 100644 test cases/failing/26 output subdir/subdir/dummy.txt create mode 100644 test cases/failing/27 noprog use/meson.build delete mode 100644 test cases/failing/27 output subdir/foo.in delete mode 100644 test cases/failing/27 output subdir/meson.build delete mode 100644 test cases/failing/27 output subdir/subdir/dummy.txt create mode 100644 test cases/failing/28 no crossprop/meson.build delete mode 100644 test cases/failing/28 noprog use/meson.build create mode 100644 test cases/failing/29 nested ternary/meson.build delete mode 100644 test cases/failing/29 no crossprop/meson.build create mode 100644 test cases/failing/30 invalid man extension/meson.build delete mode 100644 test cases/failing/30 nested ternary/meson.build delete mode 100644 test cases/failing/31 invalid man extension/meson.build create mode 100644 test cases/failing/31 no man extension/meson.build create mode 100644 test cases/failing/32 exe static shared/meson.build create mode 100644 test cases/failing/32 exe static shared/prog.c create mode 100644 test cases/failing/32 exe static shared/shlib2.c create mode 100644 test cases/failing/32 exe static shared/stat.c delete mode 100644 test cases/failing/32 no man extension/meson.build delete mode 100644 test cases/failing/33 exe static shared/meson.build delete mode 100644 test cases/failing/33 exe static shared/prog.c delete mode 100644 test cases/failing/33 exe static shared/shlib2.c delete mode 100644 test cases/failing/33 exe static shared/stat.c create mode 100644 test cases/failing/33 non-root subproject/meson.build create mode 100644 test cases/failing/33 non-root subproject/some/meson.build create mode 100644 test cases/failing/34 dependency not-required then required/meson.build delete mode 100644 test cases/failing/34 non-root subproject/meson.build delete mode 100644 test cases/failing/34 non-root subproject/some/meson.build delete mode 100644 test cases/failing/35 dependency not-required then required/meson.build create mode 100644 test cases/failing/35 project argument after target/exe.c create mode 100644 test cases/failing/35 project argument after target/meson.build create mode 100644 test cases/failing/36 pkgconfig dependency impossible conditions/meson.build delete mode 100644 test cases/failing/36 project argument after target/exe.c delete mode 100644 test cases/failing/36 project argument after target/meson.build create mode 100644 test cases/failing/37 has function external dependency/meson.build create mode 100644 test cases/failing/37 has function external dependency/mylib.c delete mode 100644 test cases/failing/37 pkgconfig dependency impossible conditions/meson.build delete mode 100644 test cases/failing/38 has function external dependency/meson.build delete mode 100644 test cases/failing/38 has function external dependency/mylib.c create mode 100644 test cases/failing/38 libdir must be inside prefix/meson.build delete mode 100644 test cases/failing/39 libdir must be inside prefix/meson.build create mode 100644 test cases/failing/39 prefix absolute/meson.build create mode 100644 test cases/failing/40 kwarg assign/dummy.c create mode 100644 test cases/failing/40 kwarg assign/meson.build create mode 100644 test cases/failing/40 kwarg assign/prog.c delete mode 100644 test cases/failing/40 prefix absolute/meson.build create mode 100644 test cases/failing/41 custom target plainname many inputs/1.txt create mode 100644 test cases/failing/41 custom target plainname many inputs/2.txt create mode 100644 test cases/failing/41 custom target plainname many inputs/catfiles.py create mode 100644 test cases/failing/41 custom target plainname many inputs/meson.build delete mode 100644 test cases/failing/41 kwarg assign/dummy.c delete mode 100644 test cases/failing/41 kwarg assign/meson.build delete mode 100644 test cases/failing/41 kwarg assign/prog.c create mode 100755 test cases/failing/42 custom target outputs not matching install_dirs/generator.py create mode 100644 test cases/failing/42 custom target outputs not matching install_dirs/installed_files.txt create mode 100644 test cases/failing/42 custom target outputs not matching install_dirs/meson.build delete mode 100644 test cases/failing/42 custom target plainname many inputs/1.txt delete mode 100644 test cases/failing/42 custom target plainname many inputs/2.txt delete mode 100644 test cases/failing/42 custom target plainname many inputs/catfiles.py delete mode 100644 test cases/failing/42 custom target plainname many inputs/meson.build delete mode 100755 test cases/failing/43 custom target outputs not matching install_dirs/generator.py delete mode 100644 test cases/failing/43 custom target outputs not matching install_dirs/installed_files.txt delete mode 100644 test cases/failing/43 custom target outputs not matching install_dirs/meson.build create mode 100644 test cases/failing/43 project name colon/meson.build create mode 100644 test cases/failing/44 abs subdir/bob/meson.build create mode 100644 test cases/failing/44 abs subdir/meson.build delete mode 100644 test cases/failing/44 project name colon/meson.build delete mode 100644 test cases/failing/45 abs subdir/bob/meson.build delete mode 100644 test cases/failing/45 abs subdir/meson.build create mode 100644 test cases/failing/45 abspath to srcdir/meson.build delete mode 100644 test cases/failing/46 abspath to srcdir/meson.build create mode 100644 test cases/failing/46 pkgconfig variables reserved/meson.build create mode 100644 test cases/failing/46 pkgconfig variables reserved/simple.c create mode 100644 test cases/failing/46 pkgconfig variables reserved/simple.h delete mode 100644 test cases/failing/47 pkgconfig variables reserved/meson.build delete mode 100644 test cases/failing/47 pkgconfig variables reserved/simple.c delete mode 100644 test cases/failing/47 pkgconfig variables reserved/simple.h create mode 100644 test cases/failing/47 pkgconfig variables zero length/meson.build create mode 100644 test cases/failing/47 pkgconfig variables zero length/simple.c create mode 100644 test cases/failing/47 pkgconfig variables zero length/simple.h create mode 100644 test cases/failing/48 pkgconfig variables zero length value/meson.build create mode 100644 test cases/failing/48 pkgconfig variables zero length value/simple.c create mode 100644 test cases/failing/48 pkgconfig variables zero length value/simple.h delete mode 100644 test cases/failing/48 pkgconfig variables zero length/meson.build delete mode 100644 test cases/failing/48 pkgconfig variables zero length/simple.c delete mode 100644 test cases/failing/48 pkgconfig variables zero length/simple.h create mode 100644 test cases/failing/49 pkgconfig variables not key value/meson.build create mode 100644 test cases/failing/49 pkgconfig variables not key value/simple.c create mode 100644 test cases/failing/49 pkgconfig variables not key value/simple.h delete mode 100644 test cases/failing/49 pkgconfig variables zero length value/meson.build delete mode 100644 test cases/failing/49 pkgconfig variables zero length value/simple.c delete mode 100644 test cases/failing/49 pkgconfig variables zero length value/simple.h create mode 100644 test cases/failing/50 executable comparison/meson.build create mode 100644 test cases/failing/50 executable comparison/prog.c delete mode 100644 test cases/failing/50 pkgconfig variables not key value/meson.build delete mode 100644 test cases/failing/50 pkgconfig variables not key value/simple.c delete mode 100644 test cases/failing/50 pkgconfig variables not key value/simple.h delete mode 100644 test cases/failing/51 executable comparison/meson.build delete mode 100644 test cases/failing/51 executable comparison/prog.c create mode 100644 test cases/failing/51 inconsistent comparison/meson.build delete mode 100644 test cases/failing/52 inconsistent comparison/meson.build create mode 100644 test cases/failing/52 slashname/meson.build create mode 100644 test cases/failing/52 slashname/sub/meson.build create mode 100644 test cases/failing/52 slashname/sub/prog.c create mode 100644 test cases/failing/53 reserved meson prefix/meson-foo/meson.build create mode 100644 test cases/failing/53 reserved meson prefix/meson.build delete mode 100644 test cases/failing/53 slashname/meson.build delete mode 100644 test cases/failing/53 slashname/sub/meson.build delete mode 100644 test cases/failing/53 slashname/sub/prog.c delete mode 100644 test cases/failing/54 reserved meson prefix/meson-foo/meson.build delete mode 100644 test cases/failing/54 reserved meson prefix/meson.build create mode 100644 test cases/failing/54 wrong shared crate type/foo.rs create mode 100644 test cases/failing/54 wrong shared crate type/meson.build delete mode 100644 test cases/failing/55 wrong shared crate type/foo.rs delete mode 100644 test cases/failing/55 wrong shared crate type/meson.build create mode 100644 test cases/failing/55 wrong static crate type/foo.rs create mode 100644 test cases/failing/55 wrong static crate type/meson.build create mode 100644 test cases/failing/56 or on new line/meson.build create mode 100644 test cases/failing/56 or on new line/meson_options.txt delete mode 100644 test cases/failing/56 wrong static crate type/foo.rs delete mode 100644 test cases/failing/56 wrong static crate type/meson.build create mode 100644 test cases/failing/57 kwarg in module/meson.build delete mode 100644 test cases/failing/57 or on new line/meson.build delete mode 100644 test cases/failing/57 or on new line/meson_options.txt delete mode 100644 test cases/failing/58 kwarg in module/meson.build create mode 100644 test cases/failing/58 link with executable/meson.build create mode 100644 test cases/failing/58 link with executable/module.c create mode 100644 test cases/failing/58 link with executable/prog.c create mode 100644 test cases/failing/59 assign custom target index/meson.build delete mode 100644 test cases/failing/59 link with executable/meson.build delete mode 100644 test cases/failing/59 link with executable/module.c delete mode 100644 test cases/failing/59 link with executable/prog.c delete mode 100644 test cases/failing/60 assign custom target index/meson.build create mode 100644 test cases/failing/60 getoption prefix/meson.build create mode 100644 test cases/failing/60 getoption prefix/subprojects/abc/meson.build create mode 100644 test cases/failing/60 getoption prefix/subprojects/abc/meson_options.txt create mode 100644 test cases/failing/61 bad option argument/meson.build create mode 100644 test cases/failing/61 bad option argument/meson_options.txt delete mode 100644 test cases/failing/61 getoption prefix/meson.build delete mode 100644 test cases/failing/61 getoption prefix/subprojects/abc/meson.build delete mode 100644 test cases/failing/61 getoption prefix/subprojects/abc/meson_options.txt delete mode 100644 test cases/failing/62 bad option argument/meson.build delete mode 100644 test cases/failing/62 bad option argument/meson_options.txt create mode 100644 test cases/failing/62 subproj filegrab/meson.build create mode 100644 test cases/failing/62 subproj filegrab/prog.c create mode 100644 test cases/failing/62 subproj filegrab/subprojects/a/meson.build create mode 100644 test cases/failing/63 grab subproj/meson.build create mode 100644 test cases/failing/63 grab subproj/subprojects/foo/meson.build create mode 100644 test cases/failing/63 grab subproj/subprojects/foo/sub.c delete mode 100644 test cases/failing/63 subproj filegrab/meson.build delete mode 100644 test cases/failing/63 subproj filegrab/prog.c delete mode 100644 test cases/failing/63 subproj filegrab/subprojects/a/meson.build create mode 100644 test cases/failing/64 grab sibling/meson.build create mode 100644 test cases/failing/64 grab sibling/subprojects/a/meson.build create mode 100644 test cases/failing/64 grab sibling/subprojects/b/meson.build create mode 100644 test cases/failing/64 grab sibling/subprojects/b/sneaky.c delete mode 100644 test cases/failing/64 grab subproj/meson.build delete mode 100644 test cases/failing/64 grab subproj/subprojects/foo/meson.build delete mode 100644 test cases/failing/64 grab subproj/subprojects/foo/sub.c delete mode 100644 test cases/failing/65 grab sibling/meson.build delete mode 100644 test cases/failing/65 grab sibling/subprojects/a/meson.build delete mode 100644 test cases/failing/65 grab sibling/subprojects/b/meson.build delete mode 100644 test cases/failing/65 grab sibling/subprojects/b/sneaky.c create mode 100644 test cases/failing/65 string as link target/meson.build create mode 100644 test cases/failing/65 string as link target/prog.c create mode 100644 test cases/failing/66 dependency not-found and required/meson.build delete mode 100644 test cases/failing/66 string as link target/meson.build delete mode 100644 test cases/failing/66 string as link target/prog.c delete mode 100644 test cases/failing/67 dependency not-found and required/meson.build create mode 100644 test cases/failing/67 subproj different versions/main.c create mode 100644 test cases/failing/67 subproj different versions/meson.build create mode 100644 test cases/failing/67 subproj different versions/subprojects/a/a.c create mode 100644 test cases/failing/67 subproj different versions/subprojects/a/a.h create mode 100644 test cases/failing/67 subproj different versions/subprojects/a/meson.build create mode 100644 test cases/failing/67 subproj different versions/subprojects/b/b.c create mode 100644 test cases/failing/67 subproj different versions/subprojects/b/b.h create mode 100644 test cases/failing/67 subproj different versions/subprojects/b/meson.build create mode 100644 test cases/failing/67 subproj different versions/subprojects/c/c.h create mode 100644 test cases/failing/67 subproj different versions/subprojects/c/meson.build delete mode 100644 test cases/failing/68 subproj different versions/main.c delete mode 100644 test cases/failing/68 subproj different versions/meson.build delete mode 100644 test cases/failing/68 subproj different versions/subprojects/a/a.c delete mode 100644 test cases/failing/68 subproj different versions/subprojects/a/a.h delete mode 100644 test cases/failing/68 subproj different versions/subprojects/a/meson.build delete mode 100644 test cases/failing/68 subproj different versions/subprojects/b/b.c delete mode 100644 test cases/failing/68 subproj different versions/subprojects/b/b.h delete mode 100644 test cases/failing/68 subproj different versions/subprojects/b/meson.build delete mode 100644 test cases/failing/68 subproj different versions/subprojects/c/c.h delete mode 100644 test cases/failing/68 subproj different versions/subprojects/c/meson.build create mode 100644 test cases/failing/68 wrong boost module/meson.build create mode 100644 test cases/failing/69 install_data rename bad size/file1.txt create mode 100644 test cases/failing/69 install_data rename bad size/file2.txt create mode 100644 test cases/failing/69 install_data rename bad size/meson.build delete mode 100644 test cases/failing/69 wrong boost module/meson.build delete mode 100644 test cases/failing/70 install_data rename bad size/file1.txt delete mode 100644 test cases/failing/70 install_data rename bad size/file2.txt delete mode 100644 test cases/failing/70 install_data rename bad size/meson.build create mode 100644 test cases/failing/70 skip only subdir/meson.build create mode 100644 test cases/failing/70 skip only subdir/subdir/meson.build create mode 100644 test cases/failing/71 invalid escape char/meson.build delete mode 100644 test cases/failing/71 skip only subdir/meson.build delete mode 100644 test cases/failing/71 skip only subdir/subdir/meson.build create mode 100644 test cases/failing/72 dual override/meson.build create mode 100644 test cases/failing/72 dual override/overrides.py delete mode 100644 test cases/failing/72 invalid escape char/meson.build delete mode 100644 test cases/failing/73 dual override/meson.build delete mode 100644 test cases/failing/73 dual override/overrides.py create mode 100644 test cases/failing/73 override used/meson.build create mode 100755 test cases/failing/73 override used/other.py create mode 100755 test cases/failing/73 override used/something.py delete mode 100644 test cases/failing/74 override used/meson.build delete mode 100755 test cases/failing/74 override used/other.py delete mode 100755 test cases/failing/74 override used/something.py create mode 100644 test cases/failing/74 run_command unclean exit/meson.build create mode 100755 test cases/failing/74 run_command unclean exit/returncode.py create mode 100644 test cases/failing/75 int literal leading zero/meson.build delete mode 100644 test cases/failing/75 run_command unclean exit/meson.build delete mode 100755 test cases/failing/75 run_command unclean exit/returncode.py create mode 100644 test cases/failing/76 configuration immutable/input create mode 100644 test cases/failing/76 configuration immutable/meson.build delete mode 100644 test cases/failing/76 int literal leading zero/meson.build delete mode 100644 test cases/failing/77 configuration immutable/input delete mode 100644 test cases/failing/77 configuration immutable/meson.build create mode 100644 test cases/failing/77 link with shared module on osx/meson.build create mode 100644 test cases/failing/77 link with shared module on osx/module.c create mode 100644 test cases/failing/77 link with shared module on osx/prog.c delete mode 100644 test cases/failing/78 link with shared module on osx/meson.build delete mode 100644 test cases/failing/78 link with shared module on osx/module.c delete mode 100644 test cases/failing/78 link with shared module on osx/prog.c create mode 100644 test cases/failing/78 non ascii in ascii encoded configure file/config9.h.in create mode 100644 test cases/failing/78 non ascii in ascii encoded configure file/meson.build delete mode 100644 test cases/failing/79 non ascii in ascii encoded configure file/config9.h.in delete mode 100644 test cases/failing/79 non ascii in ascii encoded configure file/meson.build create mode 100644 test cases/failing/79 subproj dependency not-found and required/meson.build delete mode 100644 test cases/failing/80 subproj dependency not-found and required/meson.build create mode 100644 test cases/failing/80 unfound run/meson.build delete mode 100644 test cases/failing/81 unfound run/meson.build create mode 100644 test cases/objc/4 c++ project objc subproject/master.cpp create mode 100644 test cases/objc/4 c++ project objc subproject/meson.build create mode 100644 test cases/objc/4 c++ project objc subproject/subprojects/foo/foo.m create mode 100644 test cases/objc/4 c++ project objc subproject/subprojects/foo/meson.build delete mode 100644 test cases/objc/6 c++ project objc subproject/master.cpp delete mode 100644 test cases/objc/6 c++ project objc subproject/meson.build delete mode 100644 test cases/objc/6 c++ project objc subproject/subprojects/foo/foo.m delete mode 100644 test cases/objc/6 c++ project objc subproject/subprojects/foo/meson.build create mode 100644 test cases/unit/10 build_rpath/meson.build create mode 100644 test cases/unit/10 build_rpath/prog.c create mode 100644 test cases/unit/10 build_rpath/prog.cc create mode 100644 test cases/unit/10 build_rpath/sub/meson.build create mode 100644 test cases/unit/10 build_rpath/sub/stuff.c delete mode 100644 test cases/unit/10 d dedup/meson.build delete mode 100644 test cases/unit/10 d dedup/prog.c delete mode 100644 test cases/unit/11 build_rpath/meson.build delete mode 100644 test cases/unit/11 build_rpath/prog.c delete mode 100644 test cases/unit/11 build_rpath/prog.cc delete mode 100644 test cases/unit/11 build_rpath/sub/meson.build delete mode 100644 test cases/unit/11 build_rpath/sub/stuff.c create mode 100644 test cases/unit/11 cross prog/meson.build create mode 100755 test cases/unit/11 cross prog/some_cross_tool.py create mode 100755 test cases/unit/11 cross prog/sometool.py delete mode 100644 test cases/unit/12 cross prog/meson.build delete mode 100755 test cases/unit/12 cross prog/some_cross_tool.py delete mode 100755 test cases/unit/12 cross prog/sometool.py create mode 100644 test cases/unit/12 promote/meson.build create mode 100644 test cases/unit/12 promote/subprojects/s1/meson.build create mode 100644 test cases/unit/12 promote/subprojects/s1/s1.c create mode 100644 test cases/unit/12 promote/subprojects/s1/subprojects/s3/meson.build create mode 100644 test cases/unit/12 promote/subprojects/s1/subprojects/s3/s3.c create mode 100644 test cases/unit/12 promote/subprojects/s1/subprojects/scommon/meson.build create mode 100644 test cases/unit/12 promote/subprojects/s1/subprojects/scommon/scommon_broken.c create mode 100644 test cases/unit/12 promote/subprojects/s2/meson.build create mode 100644 test cases/unit/12 promote/subprojects/s2/s2.c create mode 100644 test cases/unit/12 promote/subprojects/s2/subprojects/athing.wrap create mode 100644 test cases/unit/12 promote/subprojects/s2/subprojects/scommon/meson.build create mode 100644 test cases/unit/12 promote/subprojects/s2/subprojects/scommon/scommon_ok.c delete mode 100644 test cases/unit/13 promote/meson.build delete mode 100644 test cases/unit/13 promote/subprojects/s1/meson.build delete mode 100644 test cases/unit/13 promote/subprojects/s1/s1.c delete mode 100644 test cases/unit/13 promote/subprojects/s1/subprojects/s3/meson.build delete mode 100644 test cases/unit/13 promote/subprojects/s1/subprojects/s3/s3.c delete mode 100644 test cases/unit/13 promote/subprojects/s1/subprojects/scommon/meson.build delete mode 100644 test cases/unit/13 promote/subprojects/s1/subprojects/scommon/scommon_broken.c delete mode 100644 test cases/unit/13 promote/subprojects/s2/meson.build delete mode 100644 test cases/unit/13 promote/subprojects/s2/s2.c delete mode 100644 test cases/unit/13 promote/subprojects/s2/subprojects/athing.wrap delete mode 100644 test cases/unit/13 promote/subprojects/s2/subprojects/scommon/meson.build delete mode 100644 test cases/unit/13 promote/subprojects/s2/subprojects/scommon/scommon_ok.c delete mode 100644 test cases/unit/13 testsetup selection/main.c delete mode 100644 test cases/unit/13 testsetup selection/meson.build delete mode 100644 test cases/unit/13 testsetup selection/subprojects/bar/bar.c delete mode 100644 test cases/unit/13 testsetup selection/subprojects/bar/meson.build delete mode 100644 test cases/unit/13 testsetup selection/subprojects/foo/foo.c delete mode 100644 test cases/unit/13 testsetup selection/subprojects/foo/meson.build delete mode 100644 test cases/unit/14 prebuilt object/main.c delete mode 100644 test cases/unit/14 prebuilt object/meson.build delete mode 100644 test cases/unit/14 prebuilt object/source.c create mode 100644 test cases/unit/14 testsetup selection/main.c create mode 100644 test cases/unit/14 testsetup selection/meson.build create mode 100644 test cases/unit/14 testsetup selection/subprojects/bar/bar.c create mode 100644 test cases/unit/14 testsetup selection/subprojects/bar/meson.build create mode 100644 test cases/unit/14 testsetup selection/subprojects/foo/foo.c create mode 100644 test cases/unit/14 testsetup selection/subprojects/foo/meson.build create mode 100644 test cases/unit/15 prebuilt object/main.c create mode 100644 test cases/unit/15 prebuilt object/meson.build create mode 100644 test cases/unit/15 prebuilt object/source.c delete mode 100644 test cases/unit/15 prebuilt static/libdir/best.c delete mode 100644 test cases/unit/15 prebuilt static/libdir/best.h delete mode 100644 test cases/unit/15 prebuilt static/libdir/meson.build delete mode 100644 test cases/unit/15 prebuilt static/main.c delete mode 100644 test cases/unit/15 prebuilt static/meson.build delete mode 100644 test cases/unit/16 prebuilt shared/alexandria.c delete mode 100644 test cases/unit/16 prebuilt shared/alexandria.h delete mode 100644 test cases/unit/16 prebuilt shared/another_visitor.c delete mode 100644 test cases/unit/16 prebuilt shared/meson.build delete mode 100644 test cases/unit/16 prebuilt shared/patron.c create mode 100644 test cases/unit/16 prebuilt static/libdir/best.c create mode 100644 test cases/unit/16 prebuilt static/libdir/best.h create mode 100644 test cases/unit/16 prebuilt static/libdir/meson.build create mode 100644 test cases/unit/16 prebuilt static/main.c create mode 100644 test cases/unit/16 prebuilt static/meson.build delete mode 100644 test cases/unit/17 pkgconfig static/foo.c delete mode 100644 test cases/unit/17 pkgconfig static/foo.pc.in delete mode 100644 test cases/unit/17 pkgconfig static/include/foo.h delete mode 100644 test cases/unit/17 pkgconfig static/main.c delete mode 100644 test cases/unit/17 pkgconfig static/meson.build create mode 100644 test cases/unit/17 prebuilt shared/alexandria.c create mode 100644 test cases/unit/17 prebuilt shared/alexandria.h create mode 100644 test cases/unit/17 prebuilt shared/another_visitor.c create mode 100644 test cases/unit/17 prebuilt shared/meson.build create mode 100644 test cases/unit/17 prebuilt shared/patron.c delete mode 100644 test cases/unit/18 array option/meson.build delete mode 100644 test cases/unit/18 array option/meson_options.txt create mode 100644 test cases/unit/18 pkgconfig static/foo.c create mode 100644 test cases/unit/18 pkgconfig static/foo.pc.in create mode 100644 test cases/unit/18 pkgconfig static/include/foo.h create mode 100644 test cases/unit/18 pkgconfig static/main.c create mode 100644 test cases/unit/18 pkgconfig static/meson.build create mode 100644 test cases/unit/19 array option/meson.build create mode 100644 test cases/unit/19 array option/meson_options.txt delete mode 100644 test cases/unit/21 warning location/a.c delete mode 100644 test cases/unit/21 warning location/b.c delete mode 100644 test cases/unit/21 warning location/conf.in delete mode 100644 test cases/unit/21 warning location/main.c delete mode 100644 test cases/unit/21 warning location/meson.build delete mode 100644 test cases/unit/21 warning location/sub/c.c delete mode 100644 test cases/unit/21 warning location/sub/d.c delete mode 100644 test cases/unit/21 warning location/sub/meson.build delete mode 100644 test cases/unit/21 warning location/sub/sub.c delete mode 100644 test cases/unit/22 unfound pkgconfig/meson.build delete mode 100644 test cases/unit/22 unfound pkgconfig/some.c create mode 100644 test cases/unit/22 warning location/a.c create mode 100644 test cases/unit/22 warning location/b.c create mode 100644 test cases/unit/22 warning location/conf.in create mode 100644 test cases/unit/22 warning location/main.c create mode 100644 test cases/unit/22 warning location/meson.build create mode 100644 test cases/unit/22 warning location/sub/c.c create mode 100644 test cases/unit/22 warning location/sub/d.c create mode 100644 test cases/unit/22 warning location/sub/meson.build create mode 100644 test cases/unit/22 warning location/sub/sub.c delete mode 100644 test cases/unit/23 compiler run_command/meson.build delete mode 100644 test cases/unit/23 non-permitted kwargs/meson.build create mode 100644 test cases/unit/23 unfound pkgconfig/meson.build create mode 100644 test cases/unit/23 unfound pkgconfig/some.c create mode 100644 test cases/unit/24 compiler run_command/meson.build delete mode 100644 test cases/unit/24 install umask/datafile.cat delete mode 100644 test cases/unit/24 install umask/meson.build delete mode 100644 test cases/unit/24 install umask/myinstall.py delete mode 100644 test cases/unit/24 install umask/prog.1 delete mode 100644 test cases/unit/24 install umask/prog.c delete mode 100644 test cases/unit/24 install umask/sample.h delete mode 100644 test cases/unit/24 install umask/subdir/datafile.dog delete mode 100755 test cases/unit/24 install umask/subdir/sayhello delete mode 100644 test cases/unit/24 pkgconfig usage/dependee/meson.build delete mode 100644 test cases/unit/24 pkgconfig usage/dependee/pkguser.c delete mode 100644 test cases/unit/24 pkgconfig usage/dependency/meson.build delete mode 100644 test cases/unit/24 pkgconfig usage/dependency/pkgdep.c delete mode 100644 test cases/unit/24 pkgconfig usage/dependency/pkgdep.h delete mode 100644 test cases/unit/24 pkgconfig usage/dependency/privatelib.c delete mode 100644 test cases/unit/25 ndebug if-release/main.c delete mode 100644 test cases/unit/25 ndebug if-release/meson.build create mode 100644 test cases/unit/25 non-permitted kwargs/meson.build delete mode 100644 test cases/unit/26 guessed linker dependencies/exe/app.c delete mode 100644 test cases/unit/26 guessed linker dependencies/exe/meson.build delete mode 100644 test cases/unit/26 guessed linker dependencies/lib/lib.c delete mode 100644 test cases/unit/26 guessed linker dependencies/lib/meson.build delete mode 100644 test cases/unit/26 guessed linker dependencies/lib/meson_options.txt create mode 100644 test cases/unit/26 install umask/datafile.cat create mode 100644 test cases/unit/26 install umask/meson.build create mode 100644 test cases/unit/26 install umask/myinstall.py create mode 100644 test cases/unit/26 install umask/prog.1 create mode 100644 test cases/unit/26 install umask/prog.c create mode 100644 test cases/unit/26 install umask/sample.h create mode 100644 test cases/unit/26 install umask/subdir/datafile.dog create mode 100755 test cases/unit/26 install umask/subdir/sayhello delete mode 100644 test cases/unit/26 shared_mod linking/libfile.c delete mode 100644 test cases/unit/26 shared_mod linking/main.c delete mode 100644 test cases/unit/26 shared_mod linking/meson.build delete mode 100644 test cases/unit/27 forcefallback/meson.build delete mode 100644 test cases/unit/27 forcefallback/subprojects/notzlib/meson.build delete mode 100644 test cases/unit/27 forcefallback/subprojects/notzlib/notzlib.c delete mode 100644 test cases/unit/27 forcefallback/subprojects/notzlib/notzlib.h delete mode 100644 test cases/unit/27 forcefallback/test_not_zlib.c create mode 100644 test cases/unit/27 pkgconfig usage/dependee/meson.build create mode 100644 test cases/unit/27 pkgconfig usage/dependee/pkguser.c create mode 100644 test cases/unit/27 pkgconfig usage/dependency/meson.build create mode 100644 test cases/unit/27 pkgconfig usage/dependency/pkgdep.c create mode 100644 test cases/unit/27 pkgconfig usage/dependency/pkgdep.h create mode 100644 test cases/unit/27 pkgconfig usage/dependency/privatelib.c create mode 100644 test cases/unit/28 ndebug if-release/main.c create mode 100644 test cases/unit/28 ndebug if-release/meson.build delete mode 100644 test cases/unit/28 pkgconfig use libraries/app/app.c delete mode 100644 test cases/unit/28 pkgconfig use libraries/app/meson.build delete mode 100644 test cases/unit/28 pkgconfig use libraries/lib/liba.c delete mode 100644 test cases/unit/28 pkgconfig use libraries/lib/libb.c delete mode 100644 test cases/unit/28 pkgconfig use libraries/lib/meson.build delete mode 100644 test cases/unit/29 cross file overrides always args/meson.build delete mode 100644 test cases/unit/29 cross file overrides always args/test.c delete mode 100644 test cases/unit/29 cross file overrides always args/ubuntu-armhf-overrides.txt create mode 100644 test cases/unit/29 guessed linker dependencies/exe/app.c create mode 100644 test cases/unit/29 guessed linker dependencies/exe/meson.build create mode 100644 test cases/unit/29 guessed linker dependencies/lib/lib.c create mode 100644 test cases/unit/29 guessed linker dependencies/lib/meson.build create mode 100644 test cases/unit/29 guessed linker dependencies/lib/meson_options.txt delete mode 100644 test cases/unit/30 command line/meson.build delete mode 100644 test cases/unit/30 command line/meson_options.txt delete mode 100644 test cases/unit/30 command line/subprojects/subp/meson.build delete mode 100644 test cases/unit/30 command line/subprojects/subp/meson_options.txt delete mode 100644 test cases/unit/30 mixed command line args/meson.build delete mode 100644 test cases/unit/30 mixed command line args/meson_options.txt create mode 100644 test cases/unit/30 shared_mod linking/libfile.c create mode 100644 test cases/unit/30 shared_mod linking/main.c create mode 100644 test cases/unit/30 shared_mod linking/meson.build create mode 100644 test cases/unit/31 forcefallback/meson.build create mode 100644 test cases/unit/31 forcefallback/subprojects/notzlib/meson.build create mode 100644 test cases/unit/31 forcefallback/subprojects/notzlib/notzlib.c create mode 100644 test cases/unit/31 forcefallback/subprojects/notzlib/notzlib.h create mode 100644 test cases/unit/31 forcefallback/test_not_zlib.c delete mode 100644 test cases/unit/31 pkgconfig format/meson.build delete mode 100644 test cases/unit/31 pkgconfig format/somelib.c delete mode 100644 test cases/unit/31 pkgconfig format/someret.c create mode 100644 test cases/unit/32 pkgconfig use libraries/app/app.c create mode 100644 test cases/unit/32 pkgconfig use libraries/app/meson.build create mode 100644 test cases/unit/32 pkgconfig use libraries/lib/liba.c create mode 100644 test cases/unit/32 pkgconfig use libraries/lib/libb.c create mode 100644 test cases/unit/32 pkgconfig use libraries/lib/meson.build delete mode 100755 test cases/unit/32 python extmodule/blaster.py delete mode 100644 test cases/unit/32 python extmodule/ext/meson.build delete mode 100644 test cases/unit/32 python extmodule/ext/tachyon_module.c delete mode 100644 test cases/unit/32 python extmodule/meson.build delete mode 100644 test cases/unit/32 python extmodule/meson_options.txt create mode 100644 test cases/unit/33 cross file overrides always args/meson.build create mode 100644 test cases/unit/33 cross file overrides always args/test.c create mode 100644 test cases/unit/33 cross file overrides always args/ubuntu-armhf-overrides.txt delete mode 100644 test cases/unit/33 external, internal library rpath/built library/bar.c delete mode 100644 test cases/unit/33 external, internal library rpath/built library/meson.build delete mode 100644 test cases/unit/33 external, internal library rpath/built library/meson_options.txt delete mode 100644 test cases/unit/33 external, internal library rpath/built library/prog.c delete mode 100644 test cases/unit/33 external, internal library rpath/external library/faa.c delete mode 100644 test cases/unit/33 external, internal library rpath/external library/foo.c delete mode 100644 test cases/unit/33 external, internal library rpath/external library/meson.build create mode 100644 test cases/unit/34 command line/meson.build create mode 100644 test cases/unit/34 command line/meson_options.txt create mode 100644 test cases/unit/34 command line/subprojects/subp/meson.build create mode 100644 test cases/unit/34 command line/subprojects/subp/meson_options.txt delete mode 100644 test cases/unit/34 featurenew subprojects/meson.build delete mode 100644 test cases/unit/34 featurenew subprojects/subprojects/bar/meson.build delete mode 100644 test cases/unit/34 featurenew subprojects/subprojects/foo/meson.build create mode 100644 test cases/unit/35 mixed command line args/meson.build create mode 100644 test cases/unit/35 mixed command line args/meson_options.txt delete mode 100644 test cases/unit/35 rpath order/meson.build delete mode 100644 test cases/unit/35 rpath order/myexe.c delete mode 100644 test cases/unit/35 rpath order/subprojects/sub1/lib.c delete mode 100644 test cases/unit/35 rpath order/subprojects/sub1/meson.build delete mode 100644 test cases/unit/35 rpath order/subprojects/sub2/lib.c delete mode 100644 test cases/unit/35 rpath order/subprojects/sub2/meson.build delete mode 100644 test cases/unit/36 dep order/lib1.c delete mode 100644 test cases/unit/36 dep order/lib2.c delete mode 100644 test cases/unit/36 dep order/meson.build delete mode 100644 test cases/unit/36 dep order/myexe.c create mode 100644 test cases/unit/36 pkgconfig format/meson.build create mode 100644 test cases/unit/36 pkgconfig format/somelib.c create mode 100644 test cases/unit/36 pkgconfig format/someret.c create mode 100755 test cases/unit/37 python extmodule/blaster.py create mode 100644 test cases/unit/37 python extmodule/ext/meson.build create mode 100644 test cases/unit/37 python extmodule/ext/tachyon_module.c create mode 100644 test cases/unit/37 python extmodule/meson.build create mode 100644 test cases/unit/37 python extmodule/meson_options.txt create mode 100644 test cases/unit/38 external, internal library rpath/built library/bar.c create mode 100644 test cases/unit/38 external, internal library rpath/built library/meson.build create mode 100644 test cases/unit/38 external, internal library rpath/built library/meson_options.txt create mode 100644 test cases/unit/38 external, internal library rpath/built library/prog.c create mode 100644 test cases/unit/38 external, internal library rpath/external library/faa.c create mode 100644 test cases/unit/38 external, internal library rpath/external library/foo.c create mode 100644 test cases/unit/38 external, internal library rpath/external library/meson.build create mode 100644 test cases/unit/39 featurenew subprojects/meson.build create mode 100644 test cases/unit/39 featurenew subprojects/subprojects/bar/meson.build create mode 100644 test cases/unit/39 featurenew subprojects/subprojects/foo/meson.build create mode 100644 test cases/unit/40 rpath order/meson.build create mode 100644 test cases/unit/40 rpath order/myexe.c create mode 100644 test cases/unit/40 rpath order/subprojects/sub1/lib.c create mode 100644 test cases/unit/40 rpath order/subprojects/sub1/meson.build create mode 100644 test cases/unit/40 rpath order/subprojects/sub2/lib.c create mode 100644 test cases/unit/40 rpath order/subprojects/sub2/meson.build create mode 100644 test cases/unit/41 dep order/lib1.c create mode 100644 test cases/unit/41 dep order/lib2.c create mode 100644 test cases/unit/41 dep order/meson.build create mode 100644 test cases/unit/41 dep order/myexe.c create mode 100644 test cases/unit/8 -L -l order/first.pc create mode 100644 test cases/unit/8 -L -l order/meson.build create mode 100644 test cases/unit/8 -L -l order/prog.c create mode 100644 test cases/unit/8 -L -l order/second.pc delete mode 100644 test cases/unit/9 -L -l order/first.pc delete mode 100644 test cases/unit/9 -L -l order/meson.build delete mode 100644 test cases/unit/9 -L -l order/prog.c delete mode 100644 test cases/unit/9 -L -l order/second.pc create mode 100644 test cases/unit/9 d dedup/meson.build create mode 100644 test cases/unit/9 d dedup/prog.c create mode 100644 test cases/windows/10 vs module defs generated custom target/meson.build create mode 100644 test cases/windows/10 vs module defs generated custom target/prog.c create mode 100755 test cases/windows/10 vs module defs generated custom target/subdir/make_def.py create mode 100644 test cases/windows/10 vs module defs generated custom target/subdir/meson.build create mode 100644 test cases/windows/10 vs module defs generated custom target/subdir/somedll.c delete mode 100644 test cases/windows/10 vs module defs generated/meson.build delete mode 100644 test cases/windows/10 vs module defs generated/prog.c delete mode 100644 test cases/windows/10 vs module defs generated/subdir/meson.build delete mode 100644 test cases/windows/10 vs module defs generated/subdir/somedll.c delete mode 100644 test cases/windows/10 vs module defs generated/subdir/somedll.def.in create mode 100644 test cases/windows/11 exe implib/installed_files.txt create mode 100644 test cases/windows/11 exe implib/meson.build create mode 100644 test cases/windows/11 exe implib/prog.c delete mode 100644 test cases/windows/11 vs module defs generated custom target/meson.build delete mode 100644 test cases/windows/11 vs module defs generated custom target/prog.c delete mode 100755 test cases/windows/11 vs module defs generated custom target/subdir/make_def.py delete mode 100644 test cases/windows/11 vs module defs generated custom target/subdir/meson.build delete mode 100644 test cases/windows/11 vs module defs generated custom target/subdir/somedll.c delete mode 100644 test cases/windows/12 exe implib/installed_files.txt delete mode 100644 test cases/windows/12 exe implib/meson.build delete mode 100644 test cases/windows/12 exe implib/prog.c create mode 100644 test cases/windows/12 resources with custom targets/meson.build create mode 100644 test cases/windows/12 resources with custom targets/prog.c create mode 100755 test cases/windows/12 resources with custom targets/res/gen-res.py create mode 100644 test cases/windows/12 resources with custom targets/res/meson.build create mode 100644 test cases/windows/12 resources with custom targets/res/myres.rc.in create mode 100644 test cases/windows/12 resources with custom targets/res/myres_static.rc create mode 100644 test cases/windows/12 resources with custom targets/res/resource.h create mode 100644 test cases/windows/12 resources with custom targets/res/sample.ico delete mode 100644 test cases/windows/13 resources with custom targets/meson.build delete mode 100644 test cases/windows/13 resources with custom targets/prog.c delete mode 100755 test cases/windows/13 resources with custom targets/res/gen-res.py delete mode 100644 test cases/windows/13 resources with custom targets/res/meson.build delete mode 100644 test cases/windows/13 resources with custom targets/res/myres.rc.in delete mode 100644 test cases/windows/13 resources with custom targets/res/myres_static.rc delete mode 100644 test cases/windows/13 resources with custom targets/res/resource.h delete mode 100644 test cases/windows/13 resources with custom targets/res/sample.ico create mode 100644 test cases/windows/13 test argument extra paths/exe/main.c create mode 100644 test cases/windows/13 test argument extra paths/exe/meson.build create mode 100644 test cases/windows/13 test argument extra paths/lib/foo.c create mode 100644 test cases/windows/13 test argument extra paths/lib/foo.h create mode 100644 test cases/windows/13 test argument extra paths/lib/meson.build create mode 100644 test cases/windows/13 test argument extra paths/meson.build create mode 100644 test cases/windows/13 test argument extra paths/test/meson.build create mode 100644 test cases/windows/13 test argument extra paths/test/test_run_exe.py create mode 100755 test cases/windows/14 resources with custom target depend_files/ico/gen-ico.py create mode 100644 test cases/windows/14 resources with custom target depend_files/ico/meson.build create mode 100644 test cases/windows/14 resources with custom target depend_files/ico/sample.ico.in create mode 100644 test cases/windows/14 resources with custom target depend_files/meson.build create mode 100644 test cases/windows/14 resources with custom target depend_files/prog.c create mode 100644 test cases/windows/14 resources with custom target depend_files/res/meson.build create mode 100644 test cases/windows/14 resources with custom target depend_files/res/myres.rc delete mode 100644 test cases/windows/14 test argument extra paths/exe/main.c delete mode 100644 test cases/windows/14 test argument extra paths/exe/meson.build delete mode 100644 test cases/windows/14 test argument extra paths/lib/foo.c delete mode 100644 test cases/windows/14 test argument extra paths/lib/foo.h delete mode 100644 test cases/windows/14 test argument extra paths/lib/meson.build delete mode 100644 test cases/windows/14 test argument extra paths/meson.build delete mode 100644 test cases/windows/14 test argument extra paths/test/meson.build delete mode 100644 test cases/windows/14 test argument extra paths/test/test_run_exe.py create mode 100644 test cases/windows/15 resource scripts with duplicate filenames/a/meson.build create mode 100644 test cases/windows/15 resource scripts with duplicate filenames/a/rsrc.rc create mode 100644 test cases/windows/15 resource scripts with duplicate filenames/b/meson.build create mode 100644 test cases/windows/15 resource scripts with duplicate filenames/b/rsrc.rc create mode 100644 test cases/windows/15 resource scripts with duplicate filenames/c/meson.build create mode 100644 test cases/windows/15 resource scripts with duplicate filenames/c/rsrc.rc create mode 100644 test cases/windows/15 resource scripts with duplicate filenames/meson.build create mode 100644 test cases/windows/15 resource scripts with duplicate filenames/rsrc.rc create mode 100644 test cases/windows/15 resource scripts with duplicate filenames/verify.c delete mode 100755 test cases/windows/15 resources with custom target depend_files/ico/gen-ico.py delete mode 100644 test cases/windows/15 resources with custom target depend_files/ico/meson.build delete mode 100644 test cases/windows/15 resources with custom target depend_files/ico/sample.ico.in delete mode 100644 test cases/windows/15 resources with custom target depend_files/meson.build delete mode 100644 test cases/windows/15 resources with custom target depend_files/prog.c delete mode 100644 test cases/windows/15 resources with custom target depend_files/res/meson.build delete mode 100644 test cases/windows/15 resources with custom target depend_files/res/myres.rc delete mode 100644 test cases/windows/16 resource scripts with duplicate filenames/a/meson.build delete mode 100644 test cases/windows/16 resource scripts with duplicate filenames/a/rsrc.rc delete mode 100644 test cases/windows/16 resource scripts with duplicate filenames/b/meson.build delete mode 100644 test cases/windows/16 resource scripts with duplicate filenames/b/rsrc.rc delete mode 100644 test cases/windows/16 resource scripts with duplicate filenames/c/meson.build delete mode 100644 test cases/windows/16 resource scripts with duplicate filenames/c/rsrc.rc delete mode 100644 test cases/windows/16 resource scripts with duplicate filenames/meson.build delete mode 100644 test cases/windows/16 resource scripts with duplicate filenames/rsrc.rc delete mode 100644 test cases/windows/16 resource scripts with duplicate filenames/verify.c create mode 100644 test cases/windows/7 dll versioning/copyfile.py create mode 100644 test cases/windows/7 dll versioning/exe.orig.c create mode 100644 test cases/windows/7 dll versioning/installed_files.txt create mode 100644 test cases/windows/7 dll versioning/lib.c create mode 100644 test cases/windows/7 dll versioning/meson.build delete mode 100644 test cases/windows/8 dll versioning/copyfile.py delete mode 100644 test cases/windows/8 dll versioning/exe.orig.c delete mode 100644 test cases/windows/8 dll versioning/installed_files.txt delete mode 100644 test cases/windows/8 dll versioning/lib.c delete mode 100644 test cases/windows/8 dll versioning/meson.build create mode 100644 test cases/windows/8 find program/meson.build create mode 100644 test cases/windows/8 find program/test-script create mode 100644 test cases/windows/8 find program/test-script-ext.py delete mode 100644 test cases/windows/9 find program/meson.build delete mode 100644 test cases/windows/9 find program/test-script delete mode 100644 test cases/windows/9 find program/test-script-ext.py create mode 100644 test cases/windows/9 vs module defs generated/meson.build create mode 100644 test cases/windows/9 vs module defs generated/prog.c create mode 100644 test cases/windows/9 vs module defs generated/subdir/meson.build create mode 100644 test cases/windows/9 vs module defs generated/subdir/somedll.c create mode 100644 test cases/windows/9 vs module defs generated/subdir/somedll.def.in diff --git a/run_project_tests.py b/run_project_tests.py index 36b7655b9..1385a78af 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -294,16 +294,16 @@ def run_test(skipped, testdir, extra_args, compiler, backend, flags, commands, s mlog.shutdown() # Close the log file because otherwise Windows wets itself. def pass_prefix_to_test(dirname): - if '40 prefix absolute' in dirname: + if '39 prefix absolute' in dirname: return False return True def pass_libdir_to_test(dirname): if '8 install' in dirname: return False - if '39 libdir must be inside prefix' in dirname: + if '38 libdir must be inside prefix' in dirname: return False - if '201 install_mode' in dirname: + if '199 install_mode' in dirname: return False return True diff --git a/run_unittests.py b/run_unittests.py index 66d663af9..ace0ffab9 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -983,7 +983,7 @@ class AllPlatformTests(BasePlatformTests): dependent defaults for other options, and that those defaults can be overridden in default_options or by the command line. ''' - testdir = os.path.join(self.common_test_dir, '173 default options prefix dependent defaults') + testdir = os.path.join(self.common_test_dir, '172 default options prefix dependent defaults') expected = { '': {'prefix': '/usr', @@ -1108,7 +1108,7 @@ class AllPlatformTests(BasePlatformTests): self.assertPathDoesNotExist(exename) def test_forcefallback(self): - testdir = os.path.join(self.unit_test_dir, '27 forcefallback') + testdir = os.path.join(self.unit_test_dir, '31 forcefallback') self.init(testdir, ['--wrap-mode=forcefallback']) self.build() self.run_tests() @@ -1144,7 +1144,7 @@ class AllPlatformTests(BasePlatformTests): self._run(self.mtest_command + ['--setup=timeout']) def test_testsetup_selection(self): - testdir = os.path.join(self.unit_test_dir, '13 testsetup selection') + testdir = os.path.join(self.unit_test_dir, '14 testsetup selection') self.init(testdir) self.build() @@ -1648,7 +1648,7 @@ int main(int argc, char **argv) { self.assertTrue(rpath is None) def test_dash_d_dedup(self): - testdir = os.path.join(self.unit_test_dir, '10 d dedup') + testdir = os.path.join(self.unit_test_dir, '9 d dedup') self.init(testdir) cmd = self.get_compdb()[0]['command'] self.assertTrue('-D FOO -D BAR' in cmd or @@ -1658,10 +1658,10 @@ int main(int argc, char **argv) { def test_all_forbidden_targets_tested(self): ''' - Test that all forbidden targets are tested in the '159 reserved targets' + Test that all forbidden targets are tested in the '158 reserved targets' test. Needs to be a unit test because it accesses Meson internals. ''' - testdir = os.path.join(self.common_test_dir, '159 reserved targets') + testdir = os.path.join(self.common_test_dir, '158 reserved targets') targets = mesonbuild.coredata.forbidden_target_names # We don't actually define a target with this name targets.pop('build.ninja') @@ -1699,7 +1699,7 @@ int main(int argc, char **argv) { def test_prebuilt_object(self): (compiler, _, object_suffix, _) = self.detect_prebuild_env() - tdir = os.path.join(self.unit_test_dir, '14 prebuilt object') + tdir = os.path.join(self.unit_test_dir, '15 prebuilt object') source = os.path.join(tdir, 'source.c') objectfile = os.path.join(tdir, 'prebuilt.' + object_suffix) self.pbcompile(compiler, source, objectfile) @@ -1730,7 +1730,7 @@ int main(int argc, char **argv) { def test_prebuilt_static_lib(self): (cc, stlinker, object_suffix, _) = self.detect_prebuild_env() - tdir = os.path.join(self.unit_test_dir, '15 prebuilt static') + tdir = os.path.join(self.unit_test_dir, '16 prebuilt static') source = os.path.join(tdir, 'libdir/best.c') objectfile = os.path.join(tdir, 'libdir/best.' + object_suffix) stlibfile = os.path.join(tdir, 'libdir/libbest.a') @@ -1762,7 +1762,7 @@ int main(int argc, char **argv) { def test_prebuilt_shared_lib(self): (cc, _, object_suffix, shared_suffix) = self.detect_prebuild_env() - tdir = os.path.join(self.unit_test_dir, '16 prebuilt shared') + tdir = os.path.join(self.unit_test_dir, '17 prebuilt shared') source = os.path.join(tdir, 'alexandria.c') objectfile = os.path.join(tdir, 'alexandria.' + object_suffix) impfile = os.path.join(tdir, 'alexandria.lib') @@ -1799,7 +1799,7 @@ int main(int argc, char **argv) { https://github.com/mesonbuild/meson/issues/2785 ''' (cc, stlinker, objext, shext) = self.detect_prebuild_env() - testdir = os.path.join(self.unit_test_dir, '17 pkgconfig static') + testdir = os.path.join(self.unit_test_dir, '18 pkgconfig static') source = os.path.join(testdir, 'foo.c') objectfile = os.path.join(testdir, 'foo.' + objext) stlibfile = os.path.join(testdir, 'libfoo.a') @@ -1864,7 +1864,7 @@ int main(int argc, char **argv) { 'type': 'array', 'value': ['foo', 'bar'], } - tdir = os.path.join(self.unit_test_dir, '18 array option') + tdir = os.path.join(self.unit_test_dir, '19 array option') self.init(tdir) original = get_opt() self.assertDictEqual(original, expected) @@ -1888,7 +1888,7 @@ int main(int argc, char **argv) { 'type': 'array', 'value': ['foo', 'bar'], } - tdir = os.path.join(self.unit_test_dir, '18 array option') + tdir = os.path.join(self.unit_test_dir, '19 array option') self.init(tdir) original = get_opt() self.assertDictEqual(original, expected) @@ -1912,7 +1912,7 @@ int main(int argc, char **argv) { 'type': 'array', 'value': [], } - tdir = os.path.join(self.unit_test_dir, '18 array option') + tdir = os.path.join(self.unit_test_dir, '19 array option') self.init(tdir, extra_args='-Dlist=') original = get_opt() self.assertDictEqual(original, expected) @@ -1937,7 +1937,7 @@ int main(int argc, char **argv) { self.opt_has('free_array_opt', ['a,b', 'c,d']) def test_subproject_promotion(self): - testdir = os.path.join(self.unit_test_dir, '13 promote') + testdir = os.path.join(self.unit_test_dir, '12 promote') workdir = os.path.join(self.builddir, 'work') shutil.copytree(testdir, workdir) spdir = os.path.join(workdir, 'subprojects') @@ -1961,7 +1961,7 @@ int main(int argc, char **argv) { self.build() def test_warning_location(self): - tdir = os.path.join(self.unit_test_dir, '21 warning location') + tdir = os.path.join(self.unit_test_dir, '22 warning location') out = self.init(tdir) for expected in [ r'meson.build:4: WARNING: Keyword argument "link_with" defined multiple times.', @@ -1975,7 +1975,7 @@ int main(int argc, char **argv) { self.assertRegex(out, re.escape(expected)) def test_permitted_method_kwargs(self): - tdir = os.path.join(self.unit_test_dir, '23 non-permitted kwargs') + tdir = os.path.join(self.unit_test_dir, '25 non-permitted kwargs') out = self.init(tdir) for expected in [ r'WARNING: Passed invalid keyword argument "prefixxx".', @@ -2059,7 +2059,7 @@ int main(int argc, char **argv) { The test checks that the compiler object can be passed to run_command(). ''' - testdir = os.path.join(self.unit_test_dir, '23 compiler run_command') + testdir = os.path.join(self.unit_test_dir, '24 compiler run_command') self.init(testdir) def test_identical_target_name_in_subproject_flat_layout(self): @@ -2067,7 +2067,7 @@ int main(int argc, char **argv) { Test that identical targets in different subprojects do not collide if layout is flat. ''' - testdir = os.path.join(self.common_test_dir, '182 identical target name in subproject flat layout') + testdir = os.path.join(self.common_test_dir, '181 identical target name in subproject flat layout') self.init(testdir, extra_args=['--layout=flat']) self.build() @@ -2076,7 +2076,7 @@ int main(int argc, char **argv) { Test that identical targets in different subdirs do not collide if layout is flat. ''' - testdir = os.path.join(self.common_test_dir, '192 same target name flat layout') + testdir = os.path.join(self.common_test_dir, '190 same target name flat layout') self.init(testdir, extra_args=['--layout=flat']) self.build() @@ -2099,21 +2099,21 @@ int main(int argc, char **argv) { https://github.com/mesonbuild/meson/issues/2865 (That an error is raised on OSX is exercised by test failing/78) """ - tdir = os.path.join(self.unit_test_dir, '26 shared_mod linking') + tdir = os.path.join(self.unit_test_dir, '30 shared_mod linking') out = self.init(tdir) msg = ('''WARNING: target links against shared modules. This is not recommended as it is not supported on some platforms''') self.assertIn(msg, out) def test_ndebug_if_release_disabled(self): - testdir = os.path.join(self.unit_test_dir, '25 ndebug if-release') + testdir = os.path.join(self.unit_test_dir, '28 ndebug if-release') self.init(testdir, extra_args=['--buildtype=release', '-Db_ndebug=if-release']) self.build() exe = os.path.join(self.builddir, 'main') self.assertEqual(b'NDEBUG=1', subprocess.check_output(exe).strip()) def test_ndebug_if_release_enabled(self): - testdir = os.path.join(self.unit_test_dir, '25 ndebug if-release') + testdir = os.path.join(self.unit_test_dir, '28 ndebug if-release') self.init(testdir, extra_args=['--buildtype=debugoptimized', '-Db_ndebug=if-release']) self.build() exe = os.path.join(self.builddir, 'main') @@ -2125,7 +2125,7 @@ recommended as it is not supported on some platforms''') linker command line. ''' # build library - testdirbase = os.path.join(self.unit_test_dir, '26 guessed linker dependencies') + testdirbase = os.path.join(self.unit_test_dir, '29 guessed linker dependencies') testdirlib = os.path.join(testdirbase, 'lib') extra_args = None env = Environment(testdirlib, self.builddir, get_fake_options(self.prefix)) @@ -2168,14 +2168,14 @@ recommended as it is not supported on some platforms''') self.assertRebuiltTarget('app') def test_conflicting_d_dash_option(self): - testdir = os.path.join(self.unit_test_dir, '30 mixed command line args') + testdir = os.path.join(self.unit_test_dir, '35 mixed command line args') with self.assertRaises(subprocess.CalledProcessError) as e: self.init(testdir, extra_args=['-Dbindir=foo', '--bindir=bar']) # Just to ensure that we caught the correct error self.assertIn('passed as both', e.stderr) def _test_same_option_twice(self, arg, args): - testdir = os.path.join(self.unit_test_dir, '30 mixed command line args') + testdir = os.path.join(self.unit_test_dir, '35 mixed command line args') self.init(testdir, extra_args=args) opts = self.introspect('--buildoptions') for item in opts: @@ -2194,7 +2194,7 @@ recommended as it is not supported on some platforms''') self._test_same_option_twice('one', ['-Done=foo', '-Done=bar']) def _test_same_option_twice_configure(self, arg, args): - testdir = os.path.join(self.unit_test_dir, '30 mixed command line args') + testdir = os.path.join(self.unit_test_dir, '35 mixed command line args') self.init(testdir) self.setconf(args) opts = self.introspect('--buildoptions') @@ -2217,7 +2217,7 @@ recommended as it is not supported on some platforms''') 'one', ['-Done=foo', '-Done=bar']) def test_command_line(self): - testdir = os.path.join(self.unit_test_dir, '30 command line') + testdir = os.path.join(self.unit_test_dir, '34 command line') # Verify default values when passing no args self.init(testdir) @@ -2392,7 +2392,7 @@ recommended as it is not supported on some platforms''') self.assertIn(f, toc) def test_feature_check_usage_subprojects(self): - testdir = os.path.join(self.unit_test_dir, '34 featurenew subprojects') + testdir = os.path.join(self.unit_test_dir, '39 featurenew subprojects') out = self.init(testdir) # Parent project warns correctly self.assertRegex(out, "WARNING: Project targetting '>=0.45'.*'0.47.0': dict") @@ -2687,7 +2687,7 @@ class WindowsTests(BasePlatformTests): correctly. Cannot be an ordinary test because it involves manipulating PATH to point to a directory with Python scripts. ''' - testdir = os.path.join(self.platform_test_dir, '9 find program') + testdir = os.path.join(self.platform_test_dir, '8 find program') # Find `cmd` and `cmd.exe` prog1 = ExternalProgram('cmd') self.assertTrue(prog1.found(), msg='cmd not found') @@ -2755,7 +2755,7 @@ class WindowsTests(BasePlatformTests): self.wipe() if depfile_works: - testdir = os.path.join(self.platform_test_dir, '13 resources with custom targets') + testdir = os.path.join(self.platform_test_dir, '12 resources with custom targets') self.init(testdir) self.build() # Immediately rebuilding should not do anything @@ -2880,7 +2880,7 @@ class LinuxlikeTests(BasePlatformTests): self.assertEqual(sorted(out), sorted(['libexposed', 'libfoo >= 1.0', 'libhello'])) def test_pkg_unfound(self): - testdir = os.path.join(self.unit_test_dir, '22 unfound pkgconfig') + testdir = os.path.join(self.unit_test_dir, '23 unfound pkgconfig') self.init(testdir) with open(os.path.join(self.privatedir, 'somename.pc')) as f: pcfile = f.read() @@ -3154,7 +3154,7 @@ class LinuxlikeTests(BasePlatformTests): ''' Test that files are installed with correct permissions using install_mode. ''' - testdir = os.path.join(self.common_test_dir, '201 install_mode') + testdir = os.path.join(self.common_test_dir, '199 install_mode') self.init(testdir) self.build() self.install() @@ -3194,11 +3194,11 @@ class LinuxlikeTests(BasePlatformTests): ''' # Copy source tree to a temporary directory and change permissions # there to simulate a checkout with umask 002. - orig_testdir = os.path.join(self.unit_test_dir, '24 install umask') + orig_testdir = os.path.join(self.unit_test_dir, '26 install umask') # Create a new testdir under tmpdir. tmpdir = os.path.realpath(tempfile.mkdtemp()) self.addCleanup(windows_proof_rmtree, tmpdir) - testdir = os.path.join(tmpdir, '24 install umask') + testdir = os.path.join(tmpdir, '26 install umask') # Copy the tree using shutil.copyfile, which will use the current umask # instead of preserving permissions of the old tree. save_umask = os.umask(0o002) @@ -3306,7 +3306,7 @@ class LinuxlikeTests(BasePlatformTests): self.assertTrue('prog' in v or 'foo' in v) def test_order_of_l_arguments(self): - testdir = os.path.join(self.unit_test_dir, '9 -L -l order') + testdir = os.path.join(self.unit_test_dir, '8 -L -l order') os.environ['PKG_CONFIG_PATH'] = testdir self.init(testdir) # NOTE: .pc file has -Lfoo -lfoo -Lbar -lbar but pkg-config reorders @@ -3366,7 +3366,7 @@ class LinuxlikeTests(BasePlatformTests): def test_build_rpath(self): if is_cygwin(): raise unittest.SkipTest('Windows PE/COFF binaries do not use RPATH') - testdir = os.path.join(self.unit_test_dir, '11 build_rpath') + testdir = os.path.join(self.unit_test_dir, '10 build_rpath') self.init(testdir) self.build() # C program RPATH @@ -3409,7 +3409,7 @@ class LinuxlikeTests(BasePlatformTests): self.run_target('coverage-html') def test_cross_find_program(self): - testdir = os.path.join(self.unit_test_dir, '12 cross prog') + testdir = os.path.join(self.unit_test_dir, '11 cross prog') crossfile = tempfile.NamedTemporaryFile(mode='w') print(os.path.join(testdir, 'some_cross_tool.py')) crossfile.write('''[binaries] @@ -3472,8 +3472,8 @@ endian = 'little' @skipIfNoPkgconfig def test_pkgconfig_usage(self): - testdir1 = os.path.join(self.unit_test_dir, '24 pkgconfig usage/dependency') - testdir2 = os.path.join(self.unit_test_dir, '24 pkgconfig usage/dependee') + testdir1 = os.path.join(self.unit_test_dir, '27 pkgconfig usage/dependency') + testdir2 = os.path.join(self.unit_test_dir, '27 pkgconfig usage/dependee') if subprocess.call(['pkg-config', '--cflags', 'glib-2.0'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) != 0: @@ -3512,7 +3512,7 @@ endian = 'little' ''' with tempfile.TemporaryDirectory() as tempdirname: # build library - testdirbase = os.path.join(self.unit_test_dir, '28 pkgconfig use libraries') + testdirbase = os.path.join(self.unit_test_dir, '32 pkgconfig use libraries') testdirlib = os.path.join(testdirbase, 'lib') self.init(testdirlib, extra_args=['--prefix=' + tempdirname, '--libdir=lib', @@ -3529,7 +3529,7 @@ endian = 'little' @skipIfNoPkgconfig def test_pkgconfig_formatting(self): - testdir = os.path.join(self.unit_test_dir, '31 pkgconfig format') + testdir = os.path.join(self.unit_test_dir, '36 pkgconfig format') self.init(testdir) myenv = os.environ.copy() myenv['PKG_CONFIG_PATH'] = self.privatedir @@ -3591,7 +3591,7 @@ endian = 'little' ''' Test that the dependencies are always listed in a deterministic order. ''' - testdir = os.path.join(self.unit_test_dir, '36 dep order') + testdir = os.path.join(self.unit_test_dir, '41 dep order') self.init(testdir) with open(os.path.join(self.builddir, 'build.ninja')) as bfile: for line in bfile: @@ -3606,7 +3606,7 @@ endian = 'little' ''' if is_cygwin(): raise unittest.SkipTest('rpath are not used on Cygwin') - testdir = os.path.join(self.unit_test_dir, '35 rpath order') + testdir = os.path.join(self.unit_test_dir, '40 rpath order') self.init(testdir) if is_osx(): rpathre = re.compile('-rpath,.*/subprojects/sub1.*-rpath,.*/subprojects/sub2') @@ -3633,7 +3633,7 @@ endian = 'little' raise unittest.SkipTest('workflow currently only works on macOS') oldprefix = self.prefix # Install external library so we can find it - testdir = os.path.join(self.unit_test_dir, '33 external, internal library rpath', 'external library') + testdir = os.path.join(self.unit_test_dir, '38 external, internal library rpath', 'external library') # install into installdir without using DESTDIR installdir = self.installdir self.prefix = installdir @@ -3645,7 +3645,7 @@ endian = 'little' self.new_builddir() os.environ['LIBRARY_PATH'] = os.path.join(installdir, self.libdir) os.environ['PKG_CONFIG_PATH'] = os.path.join(installdir, self.libdir, 'pkgconfig') - testdir = os.path.join(self.unit_test_dir, '33 external, internal library rpath', 'built library') + testdir = os.path.join(self.unit_test_dir, '38 external, internal library rpath', 'built library') # install into installdir without using DESTDIR self.prefix = self.installdir self.init(testdir) @@ -3703,7 +3703,7 @@ class LinuxArmCrossCompileTests(BasePlatformTests): https://github.com/mesonbuild/meson/issues/3049 https://github.com/mesonbuild/meson/issues/3089 ''' - testdir = os.path.join(self.unit_test_dir, '29 cross file overrides always args') + testdir = os.path.join(self.unit_test_dir, '33 cross file overrides always args') self.meson_cross_file = os.path.join(testdir, 'ubuntu-armhf-overrides.txt') self.init(testdir) compdb = self.get_compdb() @@ -3719,7 +3719,7 @@ class PythonTests(BasePlatformTests): if self.backend is not Backend.ninja: raise unittest.SkipTest('Skipping python tests with {} backend'.format(self.backend.name)) - testdir = os.path.join(self.src_root, 'test cases', 'unit', '32 python extmodule') + testdir = os.path.join(self.src_root, 'test cases', 'unit', '37 python extmodule') # No python version specified, this will use meson's python self.init(testdir) diff --git a/test cases/common/157 dotinclude/dotproc.c b/test cases/common/157 dotinclude/dotproc.c new file mode 100644 index 000000000..5e65f7b43 --- /dev/null +++ b/test cases/common/157 dotinclude/dotproc.c @@ -0,0 +1,10 @@ +#include"stdio.h" + +#ifndef WRAPPER_INCLUDED +#error The wrapper stdio.h was not included. +#endif + +int main(int argc, char **argv) { + printf("Eventually I got printed.\n"); + return 0; +} diff --git a/test cases/common/157 dotinclude/meson.build b/test cases/common/157 dotinclude/meson.build new file mode 100644 index 000000000..e0c2cd7a0 --- /dev/null +++ b/test cases/common/157 dotinclude/meson.build @@ -0,0 +1,5 @@ +project('dotinclude', 'c') + +executable('dotproc', 'dotproc.c', + implicit_include_directories : false) + diff --git a/test cases/common/157 dotinclude/stdio.h b/test cases/common/157 dotinclude/stdio.h new file mode 100644 index 000000000..b6bd09fc4 --- /dev/null +++ b/test cases/common/157 dotinclude/stdio.h @@ -0,0 +1,6 @@ +// There is no #pragma once because we _want_ to cause an eternal loop +// if this wrapper invokes itself. + +#define WRAPPER_INCLUDED + +#include diff --git a/test cases/common/158 dotinclude/dotproc.c b/test cases/common/158 dotinclude/dotproc.c deleted file mode 100644 index 5e65f7b43..000000000 --- a/test cases/common/158 dotinclude/dotproc.c +++ /dev/null @@ -1,10 +0,0 @@ -#include"stdio.h" - -#ifndef WRAPPER_INCLUDED -#error The wrapper stdio.h was not included. -#endif - -int main(int argc, char **argv) { - printf("Eventually I got printed.\n"); - return 0; -} diff --git a/test cases/common/158 dotinclude/meson.build b/test cases/common/158 dotinclude/meson.build deleted file mode 100644 index e0c2cd7a0..000000000 --- a/test cases/common/158 dotinclude/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('dotinclude', 'c') - -executable('dotproc', 'dotproc.c', - implicit_include_directories : false) - diff --git a/test cases/common/158 dotinclude/stdio.h b/test cases/common/158 dotinclude/stdio.h deleted file mode 100644 index b6bd09fc4..000000000 --- a/test cases/common/158 dotinclude/stdio.h +++ /dev/null @@ -1,6 +0,0 @@ -// There is no #pragma once because we _want_ to cause an eternal loop -// if this wrapper invokes itself. - -#define WRAPPER_INCLUDED - -#include diff --git a/test cases/common/158 reserved targets/all/meson.build b/test cases/common/158 reserved targets/all/meson.build new file mode 100644 index 000000000..adee88214 --- /dev/null +++ b/test cases/common/158 reserved targets/all/meson.build @@ -0,0 +1 @@ +executable('test-all', '../test.c') diff --git a/test cases/common/158 reserved targets/benchmark/meson.build b/test cases/common/158 reserved targets/benchmark/meson.build new file mode 100644 index 000000000..242cc235d --- /dev/null +++ b/test cases/common/158 reserved targets/benchmark/meson.build @@ -0,0 +1 @@ +executable('test-benchmark', '../test.c') diff --git a/test cases/common/158 reserved targets/clean-ctlist/meson.build b/test cases/common/158 reserved targets/clean-ctlist/meson.build new file mode 100644 index 000000000..75eb207db --- /dev/null +++ b/test cases/common/158 reserved targets/clean-ctlist/meson.build @@ -0,0 +1 @@ +executable('test-clean-ctlist', '../test.c') diff --git a/test cases/common/158 reserved targets/clean-gcda/meson.build b/test cases/common/158 reserved targets/clean-gcda/meson.build new file mode 100644 index 000000000..488a527fc --- /dev/null +++ b/test cases/common/158 reserved targets/clean-gcda/meson.build @@ -0,0 +1 @@ +executable('test-clean-gcda', '../test.c') diff --git a/test cases/common/158 reserved targets/clean-gcno/meson.build b/test cases/common/158 reserved targets/clean-gcno/meson.build new file mode 100644 index 000000000..eec789ac2 --- /dev/null +++ b/test cases/common/158 reserved targets/clean-gcno/meson.build @@ -0,0 +1 @@ +executable('test-clean-gcno', '../test.c') diff --git a/test cases/common/158 reserved targets/clean/meson.build b/test cases/common/158 reserved targets/clean/meson.build new file mode 100644 index 000000000..4e27b6c27 --- /dev/null +++ b/test cases/common/158 reserved targets/clean/meson.build @@ -0,0 +1 @@ +executable('test-clean', '../test.c') diff --git a/test cases/common/158 reserved targets/coverage-html/meson.build b/test cases/common/158 reserved targets/coverage-html/meson.build new file mode 100644 index 000000000..10a4cc89b --- /dev/null +++ b/test cases/common/158 reserved targets/coverage-html/meson.build @@ -0,0 +1 @@ +executable('test-coverage-html', '../test.c') diff --git a/test cases/common/158 reserved targets/coverage-text/meson.build b/test cases/common/158 reserved targets/coverage-text/meson.build new file mode 100644 index 000000000..21dcae5fe --- /dev/null +++ b/test cases/common/158 reserved targets/coverage-text/meson.build @@ -0,0 +1 @@ +executable('test-coverage-text', '../test.c') diff --git a/test cases/common/158 reserved targets/coverage-xml/meson.build b/test cases/common/158 reserved targets/coverage-xml/meson.build new file mode 100644 index 000000000..44d7bfbe3 --- /dev/null +++ b/test cases/common/158 reserved targets/coverage-xml/meson.build @@ -0,0 +1 @@ +executable('test-coverage-xml', '../test.c') diff --git a/test cases/common/158 reserved targets/coverage/meson.build b/test cases/common/158 reserved targets/coverage/meson.build new file mode 100644 index 000000000..b40105550 --- /dev/null +++ b/test cases/common/158 reserved targets/coverage/meson.build @@ -0,0 +1 @@ +executable('test-coverage', '../test.c') diff --git a/test cases/common/158 reserved targets/dist/meson.build b/test cases/common/158 reserved targets/dist/meson.build new file mode 100644 index 000000000..951bbb4da --- /dev/null +++ b/test cases/common/158 reserved targets/dist/meson.build @@ -0,0 +1 @@ +executable('test-dist', '../test.c') diff --git a/test cases/common/158 reserved targets/distcheck/meson.build b/test cases/common/158 reserved targets/distcheck/meson.build new file mode 100644 index 000000000..12b9328ad --- /dev/null +++ b/test cases/common/158 reserved targets/distcheck/meson.build @@ -0,0 +1 @@ +executable('test-distcheck', '../test.c') diff --git a/test cases/common/158 reserved targets/install/meson.build b/test cases/common/158 reserved targets/install/meson.build new file mode 100644 index 000000000..483990186 --- /dev/null +++ b/test cases/common/158 reserved targets/install/meson.build @@ -0,0 +1 @@ +executable('test-install', '../test.c') diff --git a/test cases/common/158 reserved targets/meson.build b/test cases/common/158 reserved targets/meson.build new file mode 100644 index 000000000..24fd937bc --- /dev/null +++ b/test cases/common/158 reserved targets/meson.build @@ -0,0 +1,34 @@ +project('reserved target names', 'c') + # FIXME: Setting this causes it to leak to all other tests + #default_options : ['b_coverage=true'] + +subdir('all') +subdir('benchmark') +subdir('clean') +subdir('clean-ctlist') +subdir('clean-gcda') +subdir('clean-gcno') +subdir('coverage') +subdir('coverage-html') +subdir('coverage-text') +subdir('coverage-xml') +subdir('dist') +subdir('distcheck') +subdir('install') +# We don't have a 'PHONY' directory because Windows and OSX +# choke horribly when there are two entries with the same +# name but different case. +subdir('phony') +subdir('reconfigure') +subdir('scan-build') +subdir('test') +subdir('uninstall') + +subdir('runtarget') + +py3 = import('python3').find_python() + +custom_target('ctlist-test', output : 'out.txt', + command : [py3, '-c', 'print("")'], + capture : true, + build_by_default : true) diff --git a/test cases/common/158 reserved targets/phony/meson.build b/test cases/common/158 reserved targets/phony/meson.build new file mode 100644 index 000000000..6710fc124 --- /dev/null +++ b/test cases/common/158 reserved targets/phony/meson.build @@ -0,0 +1 @@ +executable('test-phony', '../test.c') diff --git a/test cases/common/158 reserved targets/reconfigure/meson.build b/test cases/common/158 reserved targets/reconfigure/meson.build new file mode 100644 index 000000000..c3ea3da8a --- /dev/null +++ b/test cases/common/158 reserved targets/reconfigure/meson.build @@ -0,0 +1 @@ +executable('test-reconfigure', '../test.c') diff --git a/test cases/common/158 reserved targets/runtarget/meson.build b/test cases/common/158 reserved targets/runtarget/meson.build new file mode 100644 index 000000000..52c371b5d --- /dev/null +++ b/test cases/common/158 reserved targets/runtarget/meson.build @@ -0,0 +1,2 @@ +configure_file(output : 'config.h', configuration: configuration_data()) +run_target('runtarget', command : ['echo']) diff --git a/test cases/common/158 reserved targets/scan-build/meson.build b/test cases/common/158 reserved targets/scan-build/meson.build new file mode 100644 index 000000000..100205346 --- /dev/null +++ b/test cases/common/158 reserved targets/scan-build/meson.build @@ -0,0 +1 @@ +executable('test-scan-build', '../test.c') diff --git a/test cases/common/158 reserved targets/test.c b/test cases/common/158 reserved targets/test.c new file mode 100644 index 000000000..0fb4389f7 --- /dev/null +++ b/test cases/common/158 reserved targets/test.c @@ -0,0 +1,3 @@ +int main(int argc, char *argv[]) { + return 0; +} diff --git a/test cases/common/158 reserved targets/test/meson.build b/test cases/common/158 reserved targets/test/meson.build new file mode 100644 index 000000000..4ab123cdd --- /dev/null +++ b/test cases/common/158 reserved targets/test/meson.build @@ -0,0 +1 @@ +executable('test-test', '../test.c') diff --git a/test cases/common/158 reserved targets/uninstall/meson.build b/test cases/common/158 reserved targets/uninstall/meson.build new file mode 100644 index 000000000..21c6ca60d --- /dev/null +++ b/test cases/common/158 reserved targets/uninstall/meson.build @@ -0,0 +1 @@ +executable('test-uninstall', '../test.c') diff --git a/test cases/common/159 duplicate source names/dir1/file.c b/test cases/common/159 duplicate source names/dir1/file.c new file mode 100644 index 000000000..094e18713 --- /dev/null +++ b/test cases/common/159 duplicate source names/dir1/file.c @@ -0,0 +1,16 @@ +extern int dir2; +extern int dir2_dir1; +extern int dir3; +extern int dir3_dir1; + +int main() { + if (dir2 != 20) + return 1; + if (dir2_dir1 != 21) + return 1; + if (dir3 != 30) + return 1; + if (dir3_dir1 != 31) + return 1; + return 0; +} diff --git a/test cases/common/159 duplicate source names/dir1/meson.build b/test cases/common/159 duplicate source names/dir1/meson.build new file mode 100644 index 000000000..00bc85daf --- /dev/null +++ b/test cases/common/159 duplicate source names/dir1/meson.build @@ -0,0 +1 @@ +sources += files('file.c') diff --git a/test cases/common/159 duplicate source names/dir2/dir1/file.c b/test cases/common/159 duplicate source names/dir2/dir1/file.c new file mode 100644 index 000000000..5aac8e53f --- /dev/null +++ b/test cases/common/159 duplicate source names/dir2/dir1/file.c @@ -0,0 +1 @@ +int dir2_dir1 = 21; diff --git a/test cases/common/159 duplicate source names/dir2/file.c b/test cases/common/159 duplicate source names/dir2/file.c new file mode 100644 index 000000000..6cf8d6602 --- /dev/null +++ b/test cases/common/159 duplicate source names/dir2/file.c @@ -0,0 +1 @@ +int dir2 = 20; diff --git a/test cases/common/159 duplicate source names/dir2/meson.build b/test cases/common/159 duplicate source names/dir2/meson.build new file mode 100644 index 000000000..f116a0200 --- /dev/null +++ b/test cases/common/159 duplicate source names/dir2/meson.build @@ -0,0 +1 @@ +sources += files('file.c', 'dir1/file.c') diff --git a/test cases/common/159 duplicate source names/dir3/dir1/file.c b/test cases/common/159 duplicate source names/dir3/dir1/file.c new file mode 100644 index 000000000..04667c2ff --- /dev/null +++ b/test cases/common/159 duplicate source names/dir3/dir1/file.c @@ -0,0 +1 @@ +int dir3_dir1 = 31; diff --git a/test cases/common/159 duplicate source names/dir3/file.c b/test cases/common/159 duplicate source names/dir3/file.c new file mode 100644 index 000000000..d16d0a8cf --- /dev/null +++ b/test cases/common/159 duplicate source names/dir3/file.c @@ -0,0 +1 @@ +int dir3 = 30; diff --git a/test cases/common/159 duplicate source names/dir3/meson.build b/test cases/common/159 duplicate source names/dir3/meson.build new file mode 100644 index 000000000..70ddbf2d0 --- /dev/null +++ b/test cases/common/159 duplicate source names/dir3/meson.build @@ -0,0 +1 @@ +lib = static_library('lib', 'file.c', 'dir1/file.c') diff --git a/test cases/common/159 duplicate source names/meson.build b/test cases/common/159 duplicate source names/meson.build new file mode 100644 index 000000000..cac519401 --- /dev/null +++ b/test cases/common/159 duplicate source names/meson.build @@ -0,0 +1,7 @@ +project('proj', 'c') + +sources = [] +subdir('dir1') +subdir('dir2') +subdir('dir3') +executable('a.out', sources : sources, objects : lib.extract_all_objects()) diff --git a/test cases/common/159 reserved targets/all/meson.build b/test cases/common/159 reserved targets/all/meson.build deleted file mode 100644 index adee88214..000000000 --- a/test cases/common/159 reserved targets/all/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-all', '../test.c') diff --git a/test cases/common/159 reserved targets/benchmark/meson.build b/test cases/common/159 reserved targets/benchmark/meson.build deleted file mode 100644 index 242cc235d..000000000 --- a/test cases/common/159 reserved targets/benchmark/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-benchmark', '../test.c') diff --git a/test cases/common/159 reserved targets/clean-ctlist/meson.build b/test cases/common/159 reserved targets/clean-ctlist/meson.build deleted file mode 100644 index 75eb207db..000000000 --- a/test cases/common/159 reserved targets/clean-ctlist/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-clean-ctlist', '../test.c') diff --git a/test cases/common/159 reserved targets/clean-gcda/meson.build b/test cases/common/159 reserved targets/clean-gcda/meson.build deleted file mode 100644 index 488a527fc..000000000 --- a/test cases/common/159 reserved targets/clean-gcda/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-clean-gcda', '../test.c') diff --git a/test cases/common/159 reserved targets/clean-gcno/meson.build b/test cases/common/159 reserved targets/clean-gcno/meson.build deleted file mode 100644 index eec789ac2..000000000 --- a/test cases/common/159 reserved targets/clean-gcno/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-clean-gcno', '../test.c') diff --git a/test cases/common/159 reserved targets/clean/meson.build b/test cases/common/159 reserved targets/clean/meson.build deleted file mode 100644 index 4e27b6c27..000000000 --- a/test cases/common/159 reserved targets/clean/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-clean', '../test.c') diff --git a/test cases/common/159 reserved targets/coverage-html/meson.build b/test cases/common/159 reserved targets/coverage-html/meson.build deleted file mode 100644 index 10a4cc89b..000000000 --- a/test cases/common/159 reserved targets/coverage-html/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-coverage-html', '../test.c') diff --git a/test cases/common/159 reserved targets/coverage-text/meson.build b/test cases/common/159 reserved targets/coverage-text/meson.build deleted file mode 100644 index 21dcae5fe..000000000 --- a/test cases/common/159 reserved targets/coverage-text/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-coverage-text', '../test.c') diff --git a/test cases/common/159 reserved targets/coverage-xml/meson.build b/test cases/common/159 reserved targets/coverage-xml/meson.build deleted file mode 100644 index 44d7bfbe3..000000000 --- a/test cases/common/159 reserved targets/coverage-xml/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-coverage-xml', '../test.c') diff --git a/test cases/common/159 reserved targets/coverage/meson.build b/test cases/common/159 reserved targets/coverage/meson.build deleted file mode 100644 index b40105550..000000000 --- a/test cases/common/159 reserved targets/coverage/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-coverage', '../test.c') diff --git a/test cases/common/159 reserved targets/dist/meson.build b/test cases/common/159 reserved targets/dist/meson.build deleted file mode 100644 index 951bbb4da..000000000 --- a/test cases/common/159 reserved targets/dist/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-dist', '../test.c') diff --git a/test cases/common/159 reserved targets/distcheck/meson.build b/test cases/common/159 reserved targets/distcheck/meson.build deleted file mode 100644 index 12b9328ad..000000000 --- a/test cases/common/159 reserved targets/distcheck/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-distcheck', '../test.c') diff --git a/test cases/common/159 reserved targets/install/meson.build b/test cases/common/159 reserved targets/install/meson.build deleted file mode 100644 index 483990186..000000000 --- a/test cases/common/159 reserved targets/install/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-install', '../test.c') diff --git a/test cases/common/159 reserved targets/meson.build b/test cases/common/159 reserved targets/meson.build deleted file mode 100644 index 24fd937bc..000000000 --- a/test cases/common/159 reserved targets/meson.build +++ /dev/null @@ -1,34 +0,0 @@ -project('reserved target names', 'c') - # FIXME: Setting this causes it to leak to all other tests - #default_options : ['b_coverage=true'] - -subdir('all') -subdir('benchmark') -subdir('clean') -subdir('clean-ctlist') -subdir('clean-gcda') -subdir('clean-gcno') -subdir('coverage') -subdir('coverage-html') -subdir('coverage-text') -subdir('coverage-xml') -subdir('dist') -subdir('distcheck') -subdir('install') -# We don't have a 'PHONY' directory because Windows and OSX -# choke horribly when there are two entries with the same -# name but different case. -subdir('phony') -subdir('reconfigure') -subdir('scan-build') -subdir('test') -subdir('uninstall') - -subdir('runtarget') - -py3 = import('python3').find_python() - -custom_target('ctlist-test', output : 'out.txt', - command : [py3, '-c', 'print("")'], - capture : true, - build_by_default : true) diff --git a/test cases/common/159 reserved targets/phony/meson.build b/test cases/common/159 reserved targets/phony/meson.build deleted file mode 100644 index 6710fc124..000000000 --- a/test cases/common/159 reserved targets/phony/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-phony', '../test.c') diff --git a/test cases/common/159 reserved targets/reconfigure/meson.build b/test cases/common/159 reserved targets/reconfigure/meson.build deleted file mode 100644 index c3ea3da8a..000000000 --- a/test cases/common/159 reserved targets/reconfigure/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-reconfigure', '../test.c') diff --git a/test cases/common/159 reserved targets/runtarget/meson.build b/test cases/common/159 reserved targets/runtarget/meson.build deleted file mode 100644 index 52c371b5d..000000000 --- a/test cases/common/159 reserved targets/runtarget/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -configure_file(output : 'config.h', configuration: configuration_data()) -run_target('runtarget', command : ['echo']) diff --git a/test cases/common/159 reserved targets/scan-build/meson.build b/test cases/common/159 reserved targets/scan-build/meson.build deleted file mode 100644 index 100205346..000000000 --- a/test cases/common/159 reserved targets/scan-build/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-scan-build', '../test.c') diff --git a/test cases/common/159 reserved targets/test.c b/test cases/common/159 reserved targets/test.c deleted file mode 100644 index 0fb4389f7..000000000 --- a/test cases/common/159 reserved targets/test.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(int argc, char *argv[]) { - return 0; -} diff --git a/test cases/common/159 reserved targets/test/meson.build b/test cases/common/159 reserved targets/test/meson.build deleted file mode 100644 index 4ab123cdd..000000000 --- a/test cases/common/159 reserved targets/test/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-test', '../test.c') diff --git a/test cases/common/159 reserved targets/uninstall/meson.build b/test cases/common/159 reserved targets/uninstall/meson.build deleted file mode 100644 index 21c6ca60d..000000000 --- a/test cases/common/159 reserved targets/uninstall/meson.build +++ /dev/null @@ -1 +0,0 @@ -executable('test-uninstall', '../test.c') diff --git a/test cases/common/160 duplicate source names/dir1/file.c b/test cases/common/160 duplicate source names/dir1/file.c deleted file mode 100644 index 094e18713..000000000 --- a/test cases/common/160 duplicate source names/dir1/file.c +++ /dev/null @@ -1,16 +0,0 @@ -extern int dir2; -extern int dir2_dir1; -extern int dir3; -extern int dir3_dir1; - -int main() { - if (dir2 != 20) - return 1; - if (dir2_dir1 != 21) - return 1; - if (dir3 != 30) - return 1; - if (dir3_dir1 != 31) - return 1; - return 0; -} diff --git a/test cases/common/160 duplicate source names/dir1/meson.build b/test cases/common/160 duplicate source names/dir1/meson.build deleted file mode 100644 index 00bc85daf..000000000 --- a/test cases/common/160 duplicate source names/dir1/meson.build +++ /dev/null @@ -1 +0,0 @@ -sources += files('file.c') diff --git a/test cases/common/160 duplicate source names/dir2/dir1/file.c b/test cases/common/160 duplicate source names/dir2/dir1/file.c deleted file mode 100644 index 5aac8e53f..000000000 --- a/test cases/common/160 duplicate source names/dir2/dir1/file.c +++ /dev/null @@ -1 +0,0 @@ -int dir2_dir1 = 21; diff --git a/test cases/common/160 duplicate source names/dir2/file.c b/test cases/common/160 duplicate source names/dir2/file.c deleted file mode 100644 index 6cf8d6602..000000000 --- a/test cases/common/160 duplicate source names/dir2/file.c +++ /dev/null @@ -1 +0,0 @@ -int dir2 = 20; diff --git a/test cases/common/160 duplicate source names/dir2/meson.build b/test cases/common/160 duplicate source names/dir2/meson.build deleted file mode 100644 index f116a0200..000000000 --- a/test cases/common/160 duplicate source names/dir2/meson.build +++ /dev/null @@ -1 +0,0 @@ -sources += files('file.c', 'dir1/file.c') diff --git a/test cases/common/160 duplicate source names/dir3/dir1/file.c b/test cases/common/160 duplicate source names/dir3/dir1/file.c deleted file mode 100644 index 04667c2ff..000000000 --- a/test cases/common/160 duplicate source names/dir3/dir1/file.c +++ /dev/null @@ -1 +0,0 @@ -int dir3_dir1 = 31; diff --git a/test cases/common/160 duplicate source names/dir3/file.c b/test cases/common/160 duplicate source names/dir3/file.c deleted file mode 100644 index d16d0a8cf..000000000 --- a/test cases/common/160 duplicate source names/dir3/file.c +++ /dev/null @@ -1 +0,0 @@ -int dir3 = 30; diff --git a/test cases/common/160 duplicate source names/dir3/meson.build b/test cases/common/160 duplicate source names/dir3/meson.build deleted file mode 100644 index 70ddbf2d0..000000000 --- a/test cases/common/160 duplicate source names/dir3/meson.build +++ /dev/null @@ -1 +0,0 @@ -lib = static_library('lib', 'file.c', 'dir1/file.c') diff --git a/test cases/common/160 duplicate source names/meson.build b/test cases/common/160 duplicate source names/meson.build deleted file mode 100644 index cac519401..000000000 --- a/test cases/common/160 duplicate source names/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('proj', 'c') - -sources = [] -subdir('dir1') -subdir('dir2') -subdir('dir3') -executable('a.out', sources : sources, objects : lib.extract_all_objects()) diff --git a/test cases/common/160 index customtarget/check_args.py b/test cases/common/160 index customtarget/check_args.py new file mode 100644 index 000000000..8663a6fe2 --- /dev/null +++ b/test cases/common/160 index customtarget/check_args.py @@ -0,0 +1,18 @@ +#!python3 + +import sys +from pathlib import Path + +def main(): + if len(sys.argv) != 2: + print(sys.argv) + return 1 + if sys.argv[1] != 'gen.c': + print(sys.argv) + return 2 + Path('foo').touch() + + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/test cases/common/160 index customtarget/gen_sources.py b/test cases/common/160 index customtarget/gen_sources.py new file mode 100644 index 000000000..0bdb529cd --- /dev/null +++ b/test cases/common/160 index customtarget/gen_sources.py @@ -0,0 +1,49 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import textwrap + +HEADER = textwrap.dedent('''\ + void stringify(int foo, char * buffer); + ''') + +CODE = textwrap.dedent('''\ + #include + + #ifndef WORKS + # error "This shouldn't have been included" + #endif + + void stringify(int foo, char * buffer) { + sprintf(buffer, "%i", foo); + } + ''') + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--header') + parser.add_argument('--code') + args = parser.parse_args() + + with open(args.header, 'w') as f: + f.write(HEADER) + + with open(args.code, 'w') as f: + f.write(CODE) + + +if __name__ == '__main__': + main() diff --git a/test cases/common/160 index customtarget/lib.c b/test cases/common/160 index customtarget/lib.c new file mode 100644 index 000000000..17117d54c --- /dev/null +++ b/test cases/common/160 index customtarget/lib.c @@ -0,0 +1,20 @@ +/* Copyright © 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "gen.h" + +void func(char * buffer) { + stringify(1, buffer); +} diff --git a/test cases/common/160 index customtarget/meson.build b/test cases/common/160 index customtarget/meson.build new file mode 100644 index 000000000..27d28b56a --- /dev/null +++ b/test cases/common/160 index customtarget/meson.build @@ -0,0 +1,39 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('custom_target_index', 'c', default_options : 'c_std=c89') + +py_mod = import('python3') +prog_python = py_mod.find_python() + +gen = custom_target( + 'gen.[ch]', + input : 'gen_sources.py', + output : ['gen.c', 'gen.h'], + command : [prog_python, '@INPUT@', '--header', '@OUTPUT1@', '--code', '@OUTPUT0@'], +) + +lib = static_library( + 'libfoo', + ['lib.c', gen[1]], +) + +custom_target( + 'foo', + input: gen[0], + output: 'foo', + command: [find_program('check_args.py'), '@INPUT@'], +) + +subdir('subdir') diff --git a/test cases/common/160 index customtarget/subdir/foo.c b/test cases/common/160 index customtarget/subdir/foo.c new file mode 100644 index 000000000..c620a1183 --- /dev/null +++ b/test cases/common/160 index customtarget/subdir/foo.c @@ -0,0 +1,22 @@ +/* Copyright © 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "gen.h" + +int main(void) { + char buf[50]; + stringify(10, buf); + return 0; +} diff --git a/test cases/common/160 index customtarget/subdir/meson.build b/test cases/common/160 index customtarget/subdir/meson.build new file mode 100644 index 000000000..47bcd322a --- /dev/null +++ b/test cases/common/160 index customtarget/subdir/meson.build @@ -0,0 +1,19 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +foo = executable( + 'foo', + ['foo.c', gen[0], gen[1]], + c_args : '-DWORKS', +) diff --git a/test cases/common/161 index customtarget/check_args.py b/test cases/common/161 index customtarget/check_args.py deleted file mode 100644 index 8663a6fe2..000000000 --- a/test cases/common/161 index customtarget/check_args.py +++ /dev/null @@ -1,18 +0,0 @@ -#!python3 - -import sys -from pathlib import Path - -def main(): - if len(sys.argv) != 2: - print(sys.argv) - return 1 - if sys.argv[1] != 'gen.c': - print(sys.argv) - return 2 - Path('foo').touch() - - return 0 - -if __name__ == '__main__': - sys.exit(main()) diff --git a/test cases/common/161 index customtarget/gen_sources.py b/test cases/common/161 index customtarget/gen_sources.py deleted file mode 100644 index 0bdb529cd..000000000 --- a/test cases/common/161 index customtarget/gen_sources.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import argparse -import textwrap - -HEADER = textwrap.dedent('''\ - void stringify(int foo, char * buffer); - ''') - -CODE = textwrap.dedent('''\ - #include - - #ifndef WORKS - # error "This shouldn't have been included" - #endif - - void stringify(int foo, char * buffer) { - sprintf(buffer, "%i", foo); - } - ''') - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('--header') - parser.add_argument('--code') - args = parser.parse_args() - - with open(args.header, 'w') as f: - f.write(HEADER) - - with open(args.code, 'w') as f: - f.write(CODE) - - -if __name__ == '__main__': - main() diff --git a/test cases/common/161 index customtarget/lib.c b/test cases/common/161 index customtarget/lib.c deleted file mode 100644 index 17117d54c..000000000 --- a/test cases/common/161 index customtarget/lib.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright © 2017 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gen.h" - -void func(char * buffer) { - stringify(1, buffer); -} diff --git a/test cases/common/161 index customtarget/meson.build b/test cases/common/161 index customtarget/meson.build deleted file mode 100644 index 27d28b56a..000000000 --- a/test cases/common/161 index customtarget/meson.build +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('custom_target_index', 'c', default_options : 'c_std=c89') - -py_mod = import('python3') -prog_python = py_mod.find_python() - -gen = custom_target( - 'gen.[ch]', - input : 'gen_sources.py', - output : ['gen.c', 'gen.h'], - command : [prog_python, '@INPUT@', '--header', '@OUTPUT1@', '--code', '@OUTPUT0@'], -) - -lib = static_library( - 'libfoo', - ['lib.c', gen[1]], -) - -custom_target( - 'foo', - input: gen[0], - output: 'foo', - command: [find_program('check_args.py'), '@INPUT@'], -) - -subdir('subdir') diff --git a/test cases/common/161 index customtarget/subdir/foo.c b/test cases/common/161 index customtarget/subdir/foo.c deleted file mode 100644 index c620a1183..000000000 --- a/test cases/common/161 index customtarget/subdir/foo.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright © 2017 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gen.h" - -int main(void) { - char buf[50]; - stringify(10, buf); - return 0; -} diff --git a/test cases/common/161 index customtarget/subdir/meson.build b/test cases/common/161 index customtarget/subdir/meson.build deleted file mode 100644 index 47bcd322a..000000000 --- a/test cases/common/161 index customtarget/subdir/meson.build +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -foo = executable( - 'foo', - ['foo.c', gen[0], gen[1]], - c_args : '-DWORKS', -) diff --git a/test cases/common/161 wrap file should not failed/meson.build b/test cases/common/161 wrap file should not failed/meson.build new file mode 100644 index 000000000..9cf4e9a6b --- /dev/null +++ b/test cases/common/161 wrap file should not failed/meson.build @@ -0,0 +1,7 @@ +project('mainproj', 'c') + +subproject('zlib') + +executable('grabprog', files('src/subprojects/prog.c')) +executable('grabprog2', files('src/subprojects/foo/prog2.c')) +subdir('src') diff --git a/test cases/common/161 wrap file should not failed/src/meson.build b/test cases/common/161 wrap file should not failed/src/meson.build new file mode 100644 index 000000000..69f666d1a --- /dev/null +++ b/test cases/common/161 wrap file should not failed/src/meson.build @@ -0,0 +1,2 @@ +executable('grabprog3', files('subprojects/prog.c')) +executable('grabprog4', files('subprojects/foo/prog2.c')) diff --git a/test cases/common/161 wrap file should not failed/src/subprojects/foo/prog2.c b/test cases/common/161 wrap file should not failed/src/subprojects/foo/prog2.c new file mode 100644 index 000000000..56f61a81a --- /dev/null +++ b/test cases/common/161 wrap file should not failed/src/subprojects/foo/prog2.c @@ -0,0 +1,7 @@ +#include + +int main(int argc, char **argv) { + 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/161 wrap file should not failed/src/subprojects/prog.c b/test cases/common/161 wrap file should not failed/src/subprojects/prog.c new file mode 100644 index 000000000..56f61a81a --- /dev/null +++ b/test cases/common/161 wrap file should not failed/src/subprojects/prog.c @@ -0,0 +1,7 @@ +#include + +int main(int argc, char **argv) { + 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/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip b/test cases/common/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip new file mode 100644 index 000000000..421376db9 --- /dev/null +++ b/test cases/common/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip @@ -0,0 +1 @@ +dummy diff --git a/test cases/common/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz b/test cases/common/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz new file mode 100644 index 000000000..421376db9 --- /dev/null +++ b/test cases/common/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz @@ -0,0 +1 @@ +dummy diff --git a/test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/foo.c b/test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/foo.c new file mode 100644 index 000000000..019f2bab1 --- /dev/null +++ b/test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/foo.c @@ -0,0 +1,3 @@ +int dummy_func() { + return 42; +} diff --git a/test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/meson.build b/test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/meson.build new file mode 100644 index 000000000..8d8008e47 --- /dev/null +++ b/test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/meson.build @@ -0,0 +1,2 @@ +project('shared lib', 'c') +shared_library('foo', 'foo.c') diff --git a/test cases/common/161 wrap file should not failed/subprojects/zlib.wrap b/test cases/common/161 wrap file should not failed/subprojects/zlib.wrap new file mode 100644 index 000000000..6d5896f79 --- /dev/null +++ b/test cases/common/161 wrap file should not failed/subprojects/zlib.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = zlib-1.2.8 + +source_url = http://zlib.net/fossils/zlib-1.2.8.tar.gz +source_filename = zlib-1.2.8.tar.gz +source_hash = 36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.8/8/get_zip +patch_filename = zlib-1.2.8-8-wrap.zip +patch_hash = 17c52a0e0c59ce926d3959005d5cd8178c6c7e2c9a4a1304279a8320c955ac60 diff --git a/test cases/common/162 includedir subproj/meson.build b/test cases/common/162 includedir subproj/meson.build new file mode 100644 index 000000000..b3de5af6c --- /dev/null +++ b/test cases/common/162 includedir subproj/meson.build @@ -0,0 +1,9 @@ +project('include dir in subproj test', 'c') + + +subproject('inctest') + + +exe = executable('prog', 'prog.c') + +test('dummy', exe) diff --git a/test cases/common/162 includedir subproj/prog.c b/test cases/common/162 includedir subproj/prog.c new file mode 100644 index 000000000..772681ea8 --- /dev/null +++ b/test cases/common/162 includedir subproj/prog.c @@ -0,0 +1,4 @@ + +int main(int argc, char **argv) { + return 0; +} diff --git a/test cases/common/162 includedir subproj/subprojects/inctest/include/incfile.h b/test cases/common/162 includedir subproj/subprojects/inctest/include/incfile.h new file mode 100644 index 000000000..ec740dab0 --- /dev/null +++ b/test cases/common/162 includedir subproj/subprojects/inctest/include/incfile.h @@ -0,0 +1,2 @@ + +/* file which is used in the subproject */ diff --git a/test cases/common/162 includedir subproj/subprojects/inctest/meson.build b/test cases/common/162 includedir subproj/subprojects/inctest/meson.build new file mode 100644 index 000000000..74aabcb6d --- /dev/null +++ b/test cases/common/162 includedir subproj/subprojects/inctest/meson.build @@ -0,0 +1,13 @@ + +project('subproj with includedir', 'c') + + + +compile_check = ''' +#include "incfile.h" +''' + +if not meson.get_compiler('c').compiles(compile_check, name : 'include in subproj', + include_directories: include_directories('include')) + error('failed') +endif diff --git a/test cases/common/162 wrap file should not failed/meson.build b/test cases/common/162 wrap file should not failed/meson.build deleted file mode 100644 index 9cf4e9a6b..000000000 --- a/test cases/common/162 wrap file should not failed/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('mainproj', 'c') - -subproject('zlib') - -executable('grabprog', files('src/subprojects/prog.c')) -executable('grabprog2', files('src/subprojects/foo/prog2.c')) -subdir('src') diff --git a/test cases/common/162 wrap file should not failed/src/meson.build b/test cases/common/162 wrap file should not failed/src/meson.build deleted file mode 100644 index 69f666d1a..000000000 --- a/test cases/common/162 wrap file should not failed/src/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -executable('grabprog3', files('subprojects/prog.c')) -executable('grabprog4', files('subprojects/foo/prog2.c')) diff --git a/test cases/common/162 wrap file should not failed/src/subprojects/foo/prog2.c b/test cases/common/162 wrap file should not failed/src/subprojects/foo/prog2.c deleted file mode 100644 index 56f61a81a..000000000 --- a/test cases/common/162 wrap file should not failed/src/subprojects/foo/prog2.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main(int argc, char **argv) { - 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/162 wrap file should not failed/src/subprojects/prog.c b/test cases/common/162 wrap file should not failed/src/subprojects/prog.c deleted file mode 100644 index 56f61a81a..000000000 --- a/test cases/common/162 wrap file should not failed/src/subprojects/prog.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main(int argc, char **argv) { - 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/162 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip b/test cases/common/162 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip deleted file mode 100644 index 421376db9..000000000 --- a/test cases/common/162 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip +++ /dev/null @@ -1 +0,0 @@ -dummy diff --git a/test cases/common/162 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz b/test cases/common/162 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz deleted file mode 100644 index 421376db9..000000000 --- a/test cases/common/162 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz +++ /dev/null @@ -1 +0,0 @@ -dummy diff --git a/test cases/common/162 wrap file should not failed/subprojects/zlib-1.2.8/foo.c b/test cases/common/162 wrap file should not failed/subprojects/zlib-1.2.8/foo.c deleted file mode 100644 index 019f2bab1..000000000 --- a/test cases/common/162 wrap file should not failed/subprojects/zlib-1.2.8/foo.c +++ /dev/null @@ -1,3 +0,0 @@ -int dummy_func() { - return 42; -} diff --git a/test cases/common/162 wrap file should not failed/subprojects/zlib-1.2.8/meson.build b/test cases/common/162 wrap file should not failed/subprojects/zlib-1.2.8/meson.build deleted file mode 100644 index 8d8008e47..000000000 --- a/test cases/common/162 wrap file should not failed/subprojects/zlib-1.2.8/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('shared lib', 'c') -shared_library('foo', 'foo.c') diff --git a/test cases/common/162 wrap file should not failed/subprojects/zlib.wrap b/test cases/common/162 wrap file should not failed/subprojects/zlib.wrap deleted file mode 100644 index 6d5896f79..000000000 --- a/test cases/common/162 wrap file should not failed/subprojects/zlib.wrap +++ /dev/null @@ -1,10 +0,0 @@ -[wrap-file] -directory = zlib-1.2.8 - -source_url = http://zlib.net/fossils/zlib-1.2.8.tar.gz -source_filename = zlib-1.2.8.tar.gz -source_hash = 36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d - -patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.8/8/get_zip -patch_filename = zlib-1.2.8-8-wrap.zip -patch_hash = 17c52a0e0c59ce926d3959005d5cd8178c6c7e2c9a4a1304279a8320c955ac60 diff --git a/test cases/common/163 includedir subproj/meson.build b/test cases/common/163 includedir subproj/meson.build deleted file mode 100644 index b3de5af6c..000000000 --- a/test cases/common/163 includedir subproj/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -project('include dir in subproj test', 'c') - - -subproject('inctest') - - -exe = executable('prog', 'prog.c') - -test('dummy', exe) diff --git a/test cases/common/163 includedir subproj/prog.c b/test cases/common/163 includedir subproj/prog.c deleted file mode 100644 index 772681ea8..000000000 --- a/test cases/common/163 includedir subproj/prog.c +++ /dev/null @@ -1,4 +0,0 @@ - -int main(int argc, char **argv) { - return 0; -} diff --git a/test cases/common/163 includedir subproj/subprojects/inctest/include/incfile.h b/test cases/common/163 includedir subproj/subprojects/inctest/include/incfile.h deleted file mode 100644 index ec740dab0..000000000 --- a/test cases/common/163 includedir subproj/subprojects/inctest/include/incfile.h +++ /dev/null @@ -1,2 +0,0 @@ - -/* file which is used in the subproject */ diff --git a/test cases/common/163 includedir subproj/subprojects/inctest/meson.build b/test cases/common/163 includedir subproj/subprojects/inctest/meson.build deleted file mode 100644 index 74aabcb6d..000000000 --- a/test cases/common/163 includedir subproj/subprojects/inctest/meson.build +++ /dev/null @@ -1,13 +0,0 @@ - -project('subproj with includedir', 'c') - - - -compile_check = ''' -#include "incfile.h" -''' - -if not meson.get_compiler('c').compiles(compile_check, name : 'include in subproj', - include_directories: include_directories('include')) - error('failed') -endif diff --git a/test cases/common/163 subproject dir name collision/a.c b/test cases/common/163 subproject dir name collision/a.c new file mode 100644 index 000000000..6ed96fa05 --- /dev/null +++ b/test cases/common/163 subproject dir name collision/a.c @@ -0,0 +1,13 @@ +#include +char func_b(); +char func_c(); + +int main(int argc, char **argv) { + if(func_b() != 'b') { + return 1; + } + if(func_c() != 'c') { + return 2; + } + return 0; +} diff --git a/test cases/common/163 subproject dir name collision/custom_subproject_dir/B/b.c b/test cases/common/163 subproject dir name collision/custom_subproject_dir/B/b.c new file mode 100644 index 000000000..4c94ee95f --- /dev/null +++ b/test cases/common/163 subproject dir name collision/custom_subproject_dir/B/b.c @@ -0,0 +1,20 @@ +#include +char func_c(); + +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_b() { + if(func_c() != 'c') { + exit(3); + } + return 'b'; +} diff --git a/test cases/common/163 subproject dir name collision/custom_subproject_dir/B/meson.build b/test cases/common/163 subproject dir name collision/custom_subproject_dir/B/meson.build new file mode 100644 index 000000000..280c60ce2 --- /dev/null +++ b/test cases/common/163 subproject dir name collision/custom_subproject_dir/B/meson.build @@ -0,0 +1,4 @@ +project('B', 'c') +C = subproject('C') +c = C.get_variable('c') +b = shared_library('b', 'b.c', link_with : c) diff --git a/test cases/common/163 subproject dir name collision/custom_subproject_dir/C/c.c b/test cases/common/163 subproject dir name collision/custom_subproject_dir/C/c.c new file mode 100644 index 000000000..eebfb9fba --- /dev/null +++ b/test cases/common/163 subproject dir name collision/custom_subproject_dir/C/c.c @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_c() { + return 'c'; +} diff --git a/test cases/common/163 subproject dir name collision/custom_subproject_dir/C/meson.build b/test cases/common/163 subproject dir name collision/custom_subproject_dir/C/meson.build new file mode 100644 index 000000000..abf0b1e26 --- /dev/null +++ b/test cases/common/163 subproject dir name collision/custom_subproject_dir/C/meson.build @@ -0,0 +1,2 @@ +project('C', 'c') +c = shared_library('c', 'c.c') diff --git a/test cases/common/163 subproject dir name collision/meson.build b/test cases/common/163 subproject dir name collision/meson.build new file mode 100644 index 000000000..55312175e --- /dev/null +++ b/test cases/common/163 subproject dir name collision/meson.build @@ -0,0 +1,12 @@ +project('A', 'c', subproject_dir:'custom_subproject_dir') + +B = subproject('B') +b = B.get_variable('b') + +C = subproject('C') +c = C.get_variable('c') + +subdir('other_subdir') + +a = executable('a', 'a.c', link_with : [b, c]) +test('a test', a) diff --git a/test cases/common/163 subproject dir name collision/other_subdir/custom_subproject_dir/other.c b/test cases/common/163 subproject dir name collision/other_subdir/custom_subproject_dir/other.c new file mode 100644 index 000000000..0c27f8431 --- /dev/null +++ b/test cases/common/163 subproject dir name collision/other_subdir/custom_subproject_dir/other.c @@ -0,0 +1,19 @@ +#include + +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_b() { + if('c' != 'c') { + exit(3); + } + return 'b'; +} diff --git a/test cases/common/163 subproject dir name collision/other_subdir/meson.build b/test cases/common/163 subproject dir name collision/other_subdir/meson.build new file mode 100644 index 000000000..90cb67a63 --- /dev/null +++ b/test cases/common/163 subproject dir name collision/other_subdir/meson.build @@ -0,0 +1 @@ +other = shared_library('other', 'custom_subproject_dir/other.c') diff --git a/test cases/common/164 config tool variable/meson.build b/test cases/common/164 config tool variable/meson.build new file mode 100644 index 000000000..0643042d8 --- /dev/null +++ b/test cases/common/164 config tool variable/meson.build @@ -0,0 +1,31 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('config tool variable', 'cpp') + + +dep_llvm = dependency('llvm', required : false) +if not dep_llvm.found() + error('MESON_SKIP_TEST LLVM not installed.') +endif + +includedir = dep_llvm.get_configtool_variable('includedir') +includedir = join_paths(includedir, 'llvm') +if host_machine.system() == 'windows' + cmd = run_command(['dir', includedir]) +else + cmd = run_command(['ls', includedir]) +endif + +assert(cmd.returncode() == 0, 'did not run successfully') diff --git a/test cases/common/164 subproject dir name collision/a.c b/test cases/common/164 subproject dir name collision/a.c deleted file mode 100644 index 6ed96fa05..000000000 --- a/test cases/common/164 subproject dir name collision/a.c +++ /dev/null @@ -1,13 +0,0 @@ -#include -char func_b(); -char func_c(); - -int main(int argc, char **argv) { - if(func_b() != 'b') { - return 1; - } - if(func_c() != 'c') { - return 2; - } - return 0; -} diff --git a/test cases/common/164 subproject dir name collision/custom_subproject_dir/B/b.c b/test cases/common/164 subproject dir name collision/custom_subproject_dir/B/b.c deleted file mode 100644 index 4c94ee95f..000000000 --- a/test cases/common/164 subproject dir name collision/custom_subproject_dir/B/b.c +++ /dev/null @@ -1,20 +0,0 @@ -#include -char func_c(); - -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_b() { - if(func_c() != 'c') { - exit(3); - } - return 'b'; -} diff --git a/test cases/common/164 subproject dir name collision/custom_subproject_dir/B/meson.build b/test cases/common/164 subproject dir name collision/custom_subproject_dir/B/meson.build deleted file mode 100644 index 280c60ce2..000000000 --- a/test cases/common/164 subproject dir name collision/custom_subproject_dir/B/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('B', 'c') -C = subproject('C') -c = C.get_variable('c') -b = shared_library('b', 'b.c', link_with : c) diff --git a/test cases/common/164 subproject dir name collision/custom_subproject_dir/C/c.c b/test cases/common/164 subproject dir name collision/custom_subproject_dir/C/c.c deleted file mode 100644 index eebfb9fba..000000000 --- a/test cases/common/164 subproject dir name collision/custom_subproject_dir/C/c.c +++ /dev/null @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_c() { - return 'c'; -} diff --git a/test cases/common/164 subproject dir name collision/custom_subproject_dir/C/meson.build b/test cases/common/164 subproject dir name collision/custom_subproject_dir/C/meson.build deleted file mode 100644 index abf0b1e26..000000000 --- a/test cases/common/164 subproject dir name collision/custom_subproject_dir/C/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('C', 'c') -c = shared_library('c', 'c.c') diff --git a/test cases/common/164 subproject dir name collision/meson.build b/test cases/common/164 subproject dir name collision/meson.build deleted file mode 100644 index 55312175e..000000000 --- a/test cases/common/164 subproject dir name collision/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -project('A', 'c', subproject_dir:'custom_subproject_dir') - -B = subproject('B') -b = B.get_variable('b') - -C = subproject('C') -c = C.get_variable('c') - -subdir('other_subdir') - -a = executable('a', 'a.c', link_with : [b, c]) -test('a test', a) diff --git a/test cases/common/164 subproject dir name collision/other_subdir/custom_subproject_dir/other.c b/test cases/common/164 subproject dir name collision/other_subdir/custom_subproject_dir/other.c deleted file mode 100644 index 0c27f8431..000000000 --- a/test cases/common/164 subproject dir name collision/other_subdir/custom_subproject_dir/other.c +++ /dev/null @@ -1,19 +0,0 @@ -#include - -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_b() { - if('c' != 'c') { - exit(3); - } - return 'b'; -} diff --git a/test cases/common/164 subproject dir name collision/other_subdir/meson.build b/test cases/common/164 subproject dir name collision/other_subdir/meson.build deleted file mode 100644 index 90cb67a63..000000000 --- a/test cases/common/164 subproject dir name collision/other_subdir/meson.build +++ /dev/null @@ -1 +0,0 @@ -other = shared_library('other', 'custom_subproject_dir/other.c') diff --git a/test cases/common/165 config tool variable/meson.build b/test cases/common/165 config tool variable/meson.build deleted file mode 100644 index 0643042d8..000000000 --- a/test cases/common/165 config tool variable/meson.build +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('config tool variable', 'cpp') - - -dep_llvm = dependency('llvm', required : false) -if not dep_llvm.found() - error('MESON_SKIP_TEST LLVM not installed.') -endif - -includedir = dep_llvm.get_configtool_variable('includedir') -includedir = join_paths(includedir, 'llvm') -if host_machine.system() == 'windows' - cmd = run_command(['dir', includedir]) -else - cmd = run_command(['ls', includedir]) -endif - -assert(cmd.returncode() == 0, 'did not run successfully') diff --git a/test cases/common/165 custom target subdir depend files/copyfile.py b/test cases/common/165 custom target subdir depend files/copyfile.py new file mode 100644 index 000000000..ff42ac359 --- /dev/null +++ b/test cases/common/165 custom target subdir depend files/copyfile.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +shutil.copyfile(sys.argv[1], sys.argv[2]) diff --git a/test cases/common/165 custom target subdir depend files/meson.build b/test cases/common/165 custom target subdir depend files/meson.build new file mode 100644 index 000000000..44f5c7157 --- /dev/null +++ b/test cases/common/165 custom target subdir depend files/meson.build @@ -0,0 +1,7 @@ +project('custom target subdir depend files', 'c') + +copy = find_program('copyfile.py') + +subdir('subdir') + +executable('foo', foo_src) diff --git a/test cases/common/165 custom target subdir depend files/subdir/dep.dat b/test cases/common/165 custom target subdir depend files/subdir/dep.dat new file mode 100644 index 000000000..5daee496d --- /dev/null +++ b/test cases/common/165 custom target subdir depend files/subdir/dep.dat @@ -0,0 +1 @@ +You can depend on this file. \ No newline at end of file diff --git a/test cases/common/165 custom target subdir depend files/subdir/foo.c.in b/test cases/common/165 custom target subdir depend files/subdir/foo.c.in new file mode 100644 index 000000000..d53846f52 --- /dev/null +++ b/test cases/common/165 custom target subdir depend files/subdir/foo.c.in @@ -0,0 +1,6 @@ +#include + +int main() { + printf("foo is working.\n"); + return 0; +} diff --git a/test cases/common/165 custom target subdir depend files/subdir/meson.build b/test cases/common/165 custom target subdir depend files/subdir/meson.build new file mode 100644 index 000000000..f9d31c4c7 --- /dev/null +++ b/test cases/common/165 custom target subdir depend files/subdir/meson.build @@ -0,0 +1,6 @@ +foo_src = custom_target('foo_src', + depend_files : 'dep.dat', + input : 'foo.c.in', + output : 'foo.c', + command : [copy, '@INPUT@', '@OUTPUT@'] +) diff --git a/test cases/common/166 custom target subdir depend files/copyfile.py b/test cases/common/166 custom target subdir depend files/copyfile.py deleted file mode 100644 index ff42ac359..000000000 --- a/test cases/common/166 custom target subdir depend files/copyfile.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -shutil.copyfile(sys.argv[1], sys.argv[2]) diff --git a/test cases/common/166 custom target subdir depend files/meson.build b/test cases/common/166 custom target subdir depend files/meson.build deleted file mode 100644 index 44f5c7157..000000000 --- a/test cases/common/166 custom target subdir depend files/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('custom target subdir depend files', 'c') - -copy = find_program('copyfile.py') - -subdir('subdir') - -executable('foo', foo_src) diff --git a/test cases/common/166 custom target subdir depend files/subdir/dep.dat b/test cases/common/166 custom target subdir depend files/subdir/dep.dat deleted file mode 100644 index 5daee496d..000000000 --- a/test cases/common/166 custom target subdir depend files/subdir/dep.dat +++ /dev/null @@ -1 +0,0 @@ -You can depend on this file. \ No newline at end of file diff --git a/test cases/common/166 custom target subdir depend files/subdir/foo.c.in b/test cases/common/166 custom target subdir depend files/subdir/foo.c.in deleted file mode 100644 index d53846f52..000000000 --- a/test cases/common/166 custom target subdir depend files/subdir/foo.c.in +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - printf("foo is working.\n"); - return 0; -} diff --git a/test cases/common/166 custom target subdir depend files/subdir/meson.build b/test cases/common/166 custom target subdir depend files/subdir/meson.build deleted file mode 100644 index f9d31c4c7..000000000 --- a/test cases/common/166 custom target subdir depend files/subdir/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -foo_src = custom_target('foo_src', - depend_files : 'dep.dat', - input : 'foo.c.in', - output : 'foo.c', - command : [copy, '@INPUT@', '@OUTPUT@'] -) diff --git a/test cases/common/166 external program shebang parsing/input.txt b/test cases/common/166 external program shebang parsing/input.txt new file mode 100644 index 000000000..40e30d4b2 --- /dev/null +++ b/test cases/common/166 external program shebang parsing/input.txt @@ -0,0 +1 @@ +some stuff here diff --git a/test cases/common/166 external program shebang parsing/main.c b/test cases/common/166 external program shebang parsing/main.c new file mode 100644 index 000000000..a90206bc7 --- /dev/null +++ b/test cases/common/166 external program shebang parsing/main.c @@ -0,0 +1,72 @@ +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 + #include + #include +#else + #include +#endif + +/* Who cares about stack sizes in test programs anyway */ +#define LINE_LENGTH 4096 + +static int +intrp_copyfile (char * src, char * dest) +{ +#ifdef _WIN32 + if (!CopyFile (src, dest, FALSE)) + return 1; + return 0; +#else + return execlp ("cp", "copyfile", src, dest, NULL); +#endif +} + +static void +parser_get_line (FILE * f, char line[LINE_LENGTH]) +{ + if (!fgets (line, LINE_LENGTH, f)) + fprintf (stderr, "%s\n", strerror (errno)); +} + +int +main (int argc, char * argv[]) +{ + FILE *f = NULL; + char line[LINE_LENGTH]; + + if (argc != 4) { + fprintf (stderr, "Invalid number of arguments: %i\n", argc); + goto err; + } + + if ((f = fopen (argv[1], "r")) == NULL) { + fprintf (stderr, "%s\n", strerror (errno)); + goto err; + } + + parser_get_line (f, line); + + if (!line || line[0] != '#' || line[1] != '!') { + fprintf (stderr, "Invalid script\n"); + goto err; + } + + parser_get_line (f, line); + + if (!line || strncmp (line, "copy", 4) != 0) { + fprintf (stderr, "Syntax error: %s\n", line); + goto err; + } + + return intrp_copyfile (argv[2], argv[3]); + +err: + fclose (f); + return 1; +} diff --git a/test cases/common/166 external program shebang parsing/meson.build b/test cases/common/166 external program shebang parsing/meson.build new file mode 100644 index 000000000..c1cc5af9d --- /dev/null +++ b/test cases/common/166 external program shebang parsing/meson.build @@ -0,0 +1,21 @@ +project('shebang parsing', 'c') + +interpreter = executable('aninterp', 'main.c', native : true) + +cdata = configuration_data() +cdata.set('INTRP', interpreter.full_path()) + +f = configure_file(input : 'script.int.in', + output : 'script.int', + configuration : cdata) + +# Test that parsing a shebang with spaces works properly. See `man execve`, +# specifically the section on "Interpreter scripts" and the one under "NOTES". +script = find_program(f) + +custom_target('interpthis', + input : 'input.txt', + output : 'output.txt', + depends : interpreter, + command : [script, '@INPUT@', '@OUTPUT@'], + build_by_default : true) diff --git a/test cases/common/166 external program shebang parsing/script.int.in b/test cases/common/166 external program shebang parsing/script.int.in new file mode 100644 index 000000000..77ff90907 --- /dev/null +++ b/test cases/common/166 external program shebang parsing/script.int.in @@ -0,0 +1,2 @@ +#!/usr/bin/env @INTRP@ +copy diff --git a/test cases/common/167 disabler/meson.build b/test cases/common/167 disabler/meson.build new file mode 100644 index 000000000..1956cd38a --- /dev/null +++ b/test cases/common/167 disabler/meson.build @@ -0,0 +1,34 @@ +project('dolphin option', 'c') + +d = disabler() + +d2 = dependency(d) +d3 = (d == d2) +d4 = d + 0 +d5 = d2 or true + +assert(d, 'Disabler did not cause this to be skipped.') +assert(d2, 'Function laundered disabler did not cause this to be skipped.') +assert(d3, 'Disabler comparison should yield disabler and thus this would not be called.') +assert(d4, 'Disabler addition should yield disabler and thus this would not be called.') +assert(d5, 'Disabler logic op should yield disabler and thus this would not be called.') + +number = 0 + +if d + number = 1 +else + number = 2 +endif + +assert(number == 0, 'Plain if handled incorrectly, value should be 0 but is @0@'.format(number)) + +if d.found() + number = 1 +else + number = 2 +endif + +assert(number == 2, 'If found handled incorrectly, value should be 2 but is @0@'.format(number)) + + diff --git a/test cases/common/167 external program shebang parsing/input.txt b/test cases/common/167 external program shebang parsing/input.txt deleted file mode 100644 index 40e30d4b2..000000000 --- a/test cases/common/167 external program shebang parsing/input.txt +++ /dev/null @@ -1 +0,0 @@ -some stuff here diff --git a/test cases/common/167 external program shebang parsing/main.c b/test cases/common/167 external program shebang parsing/main.c deleted file mode 100644 index a90206bc7..000000000 --- a/test cases/common/167 external program shebang parsing/main.c +++ /dev/null @@ -1,72 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#ifdef _WIN32 - #include - #include -#else - #include -#endif - -/* Who cares about stack sizes in test programs anyway */ -#define LINE_LENGTH 4096 - -static int -intrp_copyfile (char * src, char * dest) -{ -#ifdef _WIN32 - if (!CopyFile (src, dest, FALSE)) - return 1; - return 0; -#else - return execlp ("cp", "copyfile", src, dest, NULL); -#endif -} - -static void -parser_get_line (FILE * f, char line[LINE_LENGTH]) -{ - if (!fgets (line, LINE_LENGTH, f)) - fprintf (stderr, "%s\n", strerror (errno)); -} - -int -main (int argc, char * argv[]) -{ - FILE *f = NULL; - char line[LINE_LENGTH]; - - if (argc != 4) { - fprintf (stderr, "Invalid number of arguments: %i\n", argc); - goto err; - } - - if ((f = fopen (argv[1], "r")) == NULL) { - fprintf (stderr, "%s\n", strerror (errno)); - goto err; - } - - parser_get_line (f, line); - - if (!line || line[0] != '#' || line[1] != '!') { - fprintf (stderr, "Invalid script\n"); - goto err; - } - - parser_get_line (f, line); - - if (!line || strncmp (line, "copy", 4) != 0) { - fprintf (stderr, "Syntax error: %s\n", line); - goto err; - } - - return intrp_copyfile (argv[2], argv[3]); - -err: - fclose (f); - return 1; -} diff --git a/test cases/common/167 external program shebang parsing/meson.build b/test cases/common/167 external program shebang parsing/meson.build deleted file mode 100644 index c1cc5af9d..000000000 --- a/test cases/common/167 external program shebang parsing/meson.build +++ /dev/null @@ -1,21 +0,0 @@ -project('shebang parsing', 'c') - -interpreter = executable('aninterp', 'main.c', native : true) - -cdata = configuration_data() -cdata.set('INTRP', interpreter.full_path()) - -f = configure_file(input : 'script.int.in', - output : 'script.int', - configuration : cdata) - -# Test that parsing a shebang with spaces works properly. See `man execve`, -# specifically the section on "Interpreter scripts" and the one under "NOTES". -script = find_program(f) - -custom_target('interpthis', - input : 'input.txt', - output : 'output.txt', - depends : interpreter, - command : [script, '@INPUT@', '@OUTPUT@'], - build_by_default : true) diff --git a/test cases/common/167 external program shebang parsing/script.int.in b/test cases/common/167 external program shebang parsing/script.int.in deleted file mode 100644 index 77ff90907..000000000 --- a/test cases/common/167 external program shebang parsing/script.int.in +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env @INTRP@ -copy diff --git a/test cases/common/168 array option/meson.build b/test cases/common/168 array option/meson.build new file mode 100644 index 000000000..034b9a545 --- /dev/null +++ b/test cases/common/168 array option/meson.build @@ -0,0 +1,17 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('array default options') + +assert(get_option('array') == ['foo', 'bar'], 'Default value for array is not equal to choices') diff --git a/test cases/common/168 array option/meson_options.txt b/test cases/common/168 array option/meson_options.txt new file mode 100644 index 000000000..7ed0ac14d --- /dev/null +++ b/test cases/common/168 array option/meson_options.txt @@ -0,0 +1,19 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +option( + 'array', + type : 'array', + choices : ['foo', 'bar'], +) diff --git a/test cases/common/168 disabler/meson.build b/test cases/common/168 disabler/meson.build deleted file mode 100644 index 1956cd38a..000000000 --- a/test cases/common/168 disabler/meson.build +++ /dev/null @@ -1,34 +0,0 @@ -project('dolphin option', 'c') - -d = disabler() - -d2 = dependency(d) -d3 = (d == d2) -d4 = d + 0 -d5 = d2 or true - -assert(d, 'Disabler did not cause this to be skipped.') -assert(d2, 'Function laundered disabler did not cause this to be skipped.') -assert(d3, 'Disabler comparison should yield disabler and thus this would not be called.') -assert(d4, 'Disabler addition should yield disabler and thus this would not be called.') -assert(d5, 'Disabler logic op should yield disabler and thus this would not be called.') - -number = 0 - -if d - number = 1 -else - number = 2 -endif - -assert(number == 0, 'Plain if handled incorrectly, value should be 0 but is @0@'.format(number)) - -if d.found() - number = 1 -else - number = 2 -endif - -assert(number == 2, 'If found handled incorrectly, value should be 2 but is @0@'.format(number)) - - diff --git a/test cases/common/169 array option/meson.build b/test cases/common/169 array option/meson.build deleted file mode 100644 index 034b9a545..000000000 --- a/test cases/common/169 array option/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('array default options') - -assert(get_option('array') == ['foo', 'bar'], 'Default value for array is not equal to choices') diff --git a/test cases/common/169 array option/meson_options.txt b/test cases/common/169 array option/meson_options.txt deleted file mode 100644 index 7ed0ac14d..000000000 --- a/test cases/common/169 array option/meson_options.txt +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -option( - 'array', - type : 'array', - choices : ['foo', 'bar'], -) diff --git a/test cases/common/169 custom target template substitution/checkcopy.py b/test cases/common/169 custom target template substitution/checkcopy.py new file mode 100644 index 000000000..ab9f436ce --- /dev/null +++ b/test cases/common/169 custom target template substitution/checkcopy.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +if '@INPUT1@' in sys.argv[1]: + shutil.copyfile(sys.argv[2], sys.argv[3]) +else: + sys.exit('String @INPUT1@ not found in "{}"'.format(sys.argv[1])) diff --git a/test cases/common/169 custom target template substitution/foo.c.in b/test cases/common/169 custom target template substitution/foo.c.in new file mode 100644 index 000000000..d53846f52 --- /dev/null +++ b/test cases/common/169 custom target template substitution/foo.c.in @@ -0,0 +1,6 @@ +#include + +int main() { + printf("foo is working.\n"); + return 0; +} diff --git a/test cases/common/169 custom target template substitution/meson.build b/test cases/common/169 custom target template substitution/meson.build new file mode 100644 index 000000000..737408ebf --- /dev/null +++ b/test cases/common/169 custom target template substitution/meson.build @@ -0,0 +1,17 @@ +project('custom target template substitution', 'c') + +check = find_program('checkcopy.py') + +config = configuration_data() + +config_file = configure_file(configuration : config, output : 'x@IN') + +# Check that substitution does not find @FOO@ and then misses @INPUT0@. +# Check the resulting x@INPUT1@ is not replaced. +foo = custom_target('runcheck', + input : [config_file, 'foo.c.in'], + output : 'foo.c', + command : [check, '-D@FOO@INPUT0@PUT1@', '@INPUT1@', '@OUTPUT@'] +) + +executable('foo', foo) diff --git a/test cases/common/170 custom target template substitution/checkcopy.py b/test cases/common/170 custom target template substitution/checkcopy.py deleted file mode 100644 index ab9f436ce..000000000 --- a/test cases/common/170 custom target template substitution/checkcopy.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -if '@INPUT1@' in sys.argv[1]: - shutil.copyfile(sys.argv[2], sys.argv[3]) -else: - sys.exit('String @INPUT1@ not found in "{}"'.format(sys.argv[1])) diff --git a/test cases/common/170 custom target template substitution/foo.c.in b/test cases/common/170 custom target template substitution/foo.c.in deleted file mode 100644 index d53846f52..000000000 --- a/test cases/common/170 custom target template substitution/foo.c.in +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - printf("foo is working.\n"); - return 0; -} diff --git a/test cases/common/170 custom target template substitution/meson.build b/test cases/common/170 custom target template substitution/meson.build deleted file mode 100644 index 737408ebf..000000000 --- a/test cases/common/170 custom target template substitution/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -project('custom target template substitution', 'c') - -check = find_program('checkcopy.py') - -config = configuration_data() - -config_file = configure_file(configuration : config, output : 'x@IN') - -# Check that substitution does not find @FOO@ and then misses @INPUT0@. -# Check the resulting x@INPUT1@ is not replaced. -foo = custom_target('runcheck', - input : [config_file, 'foo.c.in'], - output : 'foo.c', - command : [check, '-D@FOO@INPUT0@PUT1@', '@INPUT1@', '@OUTPUT@'] -) - -executable('foo', foo) diff --git a/test cases/common/170 not-found dependency/meson.build b/test cases/common/170 not-found dependency/meson.build new file mode 100644 index 000000000..02072b6a0 --- /dev/null +++ b/test cases/common/170 not-found dependency/meson.build @@ -0,0 +1,14 @@ +project('dep-test', 'c') + +dep = dependency('', required:false) +if dep.found() + error('not-found dependency was found') +endif + +assert(dep.type_name() == 'not-found', 'dependency should be of type "not-found" not ' + dep.type_name()) + +library('testlib', 'testlib.c', dependencies: [dep]) +subdir('sub', if_found: dep) + +subdep = dependency('', fallback: ['trivial', 'trivial_dep']) +missing = dependency('', fallback: ['missing', 'missing_dep'], required: false) diff --git a/test cases/common/170 not-found dependency/sub/meson.build b/test cases/common/170 not-found dependency/sub/meson.build new file mode 100644 index 000000000..2a33cae06 --- /dev/null +++ b/test cases/common/170 not-found dependency/sub/meson.build @@ -0,0 +1 @@ +error('should be disabled by subdir(if_found:)') diff --git a/test cases/common/170 not-found dependency/subprojects/trivial/meson.build b/test cases/common/170 not-found dependency/subprojects/trivial/meson.build new file mode 100644 index 000000000..8769c7008 --- /dev/null +++ b/test cases/common/170 not-found dependency/subprojects/trivial/meson.build @@ -0,0 +1,3 @@ +project('trivial subproject', 'c') +trivial_lib = static_library('trivial', 'trivial.c', install: false) +trivial_dep = declare_dependency(link_with: trivial_lib) diff --git a/test cases/common/170 not-found dependency/subprojects/trivial/trivial.c b/test cases/common/170 not-found dependency/subprojects/trivial/trivial.c new file mode 100644 index 000000000..35b21e0ce --- /dev/null +++ b/test cases/common/170 not-found dependency/subprojects/trivial/trivial.c @@ -0,0 +1,3 @@ +int subfunc() { + return 42; +} diff --git a/test cases/common/170 not-found dependency/testlib.c b/test cases/common/170 not-found dependency/testlib.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/common/171 not-found dependency/meson.build b/test cases/common/171 not-found dependency/meson.build deleted file mode 100644 index 02072b6a0..000000000 --- a/test cases/common/171 not-found dependency/meson.build +++ /dev/null @@ -1,14 +0,0 @@ -project('dep-test', 'c') - -dep = dependency('', required:false) -if dep.found() - error('not-found dependency was found') -endif - -assert(dep.type_name() == 'not-found', 'dependency should be of type "not-found" not ' + dep.type_name()) - -library('testlib', 'testlib.c', dependencies: [dep]) -subdir('sub', if_found: dep) - -subdep = dependency('', fallback: ['trivial', 'trivial_dep']) -missing = dependency('', fallback: ['missing', 'missing_dep'], required: false) diff --git a/test cases/common/171 not-found dependency/sub/meson.build b/test cases/common/171 not-found dependency/sub/meson.build deleted file mode 100644 index 2a33cae06..000000000 --- a/test cases/common/171 not-found dependency/sub/meson.build +++ /dev/null @@ -1 +0,0 @@ -error('should be disabled by subdir(if_found:)') diff --git a/test cases/common/171 not-found dependency/subprojects/trivial/meson.build b/test cases/common/171 not-found dependency/subprojects/trivial/meson.build deleted file mode 100644 index 8769c7008..000000000 --- a/test cases/common/171 not-found dependency/subprojects/trivial/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('trivial subproject', 'c') -trivial_lib = static_library('trivial', 'trivial.c', install: false) -trivial_dep = declare_dependency(link_with: trivial_lib) diff --git a/test cases/common/171 not-found dependency/subprojects/trivial/trivial.c b/test cases/common/171 not-found dependency/subprojects/trivial/trivial.c deleted file mode 100644 index 35b21e0ce..000000000 --- a/test cases/common/171 not-found dependency/subprojects/trivial/trivial.c +++ /dev/null @@ -1,3 +0,0 @@ -int subfunc() { - return 42; -} diff --git a/test cases/common/171 not-found dependency/testlib.c b/test cases/common/171 not-found dependency/testlib.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/common/171 subdir if_found/meson.build b/test cases/common/171 subdir if_found/meson.build new file mode 100644 index 000000000..2c640cfad --- /dev/null +++ b/test cases/common/171 subdir if_found/meson.build @@ -0,0 +1,11 @@ +project('subdir if found', 'c') + +found_dep = declare_dependency() +not_found_dep = dependency('nonexisting', required : false) + +subdir('nonexisting_dir', if_found : not_found_dep) + +variable = 3 + +subdir('subdir', if_found : found_dep) +assert(variable == 5, 'Subdir was not properly entered.') diff --git a/test cases/common/171 subdir if_found/subdir/meson.build b/test cases/common/171 subdir if_found/subdir/meson.build new file mode 100644 index 000000000..1030e2551 --- /dev/null +++ b/test cases/common/171 subdir if_found/subdir/meson.build @@ -0,0 +1 @@ +variable = 5 diff --git a/test cases/common/172 default options prefix dependent defaults/meson.build b/test cases/common/172 default options prefix dependent defaults/meson.build new file mode 100644 index 000000000..9ca4ec552 --- /dev/null +++ b/test cases/common/172 default options prefix dependent defaults/meson.build @@ -0,0 +1 @@ +project('default options prefix dependent defaults ', 'c', default_options : ['sharedstatedir=/sharedstate', 'prefix=/usr']) diff --git a/test cases/common/172 subdir if_found/meson.build b/test cases/common/172 subdir if_found/meson.build deleted file mode 100644 index 2c640cfad..000000000 --- a/test cases/common/172 subdir if_found/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('subdir if found', 'c') - -found_dep = declare_dependency() -not_found_dep = dependency('nonexisting', required : false) - -subdir('nonexisting_dir', if_found : not_found_dep) - -variable = 3 - -subdir('subdir', if_found : found_dep) -assert(variable == 5, 'Subdir was not properly entered.') diff --git a/test cases/common/172 subdir if_found/subdir/meson.build b/test cases/common/172 subdir if_found/subdir/meson.build deleted file mode 100644 index 1030e2551..000000000 --- a/test cases/common/172 subdir if_found/subdir/meson.build +++ /dev/null @@ -1 +0,0 @@ -variable = 5 diff --git a/test cases/common/173 default options prefix dependent defaults/meson.build b/test cases/common/173 default options prefix dependent defaults/meson.build deleted file mode 100644 index 9ca4ec552..000000000 --- a/test cases/common/173 default options prefix dependent defaults/meson.build +++ /dev/null @@ -1 +0,0 @@ -project('default options prefix dependent defaults ', 'c', default_options : ['sharedstatedir=/sharedstate', 'prefix=/usr']) diff --git a/test cases/common/173 dependency factory/meson.build b/test cases/common/173 dependency factory/meson.build new file mode 100644 index 000000000..1b8ed176b --- /dev/null +++ b/test cases/common/173 dependency factory/meson.build @@ -0,0 +1,51 @@ +project('dependency factory', meson_version : '>=0.40') + +dep = dependency('gl', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('SDL2', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('SDL2', method: 'config-tool', required: false) +if dep.found() and dep.type_name() == 'configtool' + dep.get_configtool_variable('prefix') +endif + +dep = dependency('Vulkan', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('pcap', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('pcap', method: 'config-tool', required: false) +if dep.found() and dep.type_name() == 'configtool' + dep.get_configtool_variable('prefix') +endif + +dep = dependency('cups', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('cups', method: 'config-tool', required: false) +if dep.found() and dep.type_name() == 'configtool' + dep.get_configtool_variable('prefix') +endif + +dep = dependency('libwmf', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('libwmf', method: 'config-tool', required: false) +if dep.found() and dep.type_name() == 'configtool' + dep.get_configtool_variable('prefix') +endif diff --git a/test cases/common/174 dependency factory/meson.build b/test cases/common/174 dependency factory/meson.build deleted file mode 100644 index 1b8ed176b..000000000 --- a/test cases/common/174 dependency factory/meson.build +++ /dev/null @@ -1,51 +0,0 @@ -project('dependency factory', meson_version : '>=0.40') - -dep = dependency('gl', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('SDL2', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('SDL2', method: 'config-tool', required: false) -if dep.found() and dep.type_name() == 'configtool' - dep.get_configtool_variable('prefix') -endif - -dep = dependency('Vulkan', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('pcap', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('pcap', method: 'config-tool', required: false) -if dep.found() and dep.type_name() == 'configtool' - dep.get_configtool_variable('prefix') -endif - -dep = dependency('cups', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('cups', method: 'config-tool', required: false) -if dep.found() and dep.type_name() == 'configtool' - dep.get_configtool_variable('prefix') -endif - -dep = dependency('libwmf', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('libwmf', method: 'config-tool', required: false) -if dep.found() and dep.type_name() == 'configtool' - dep.get_configtool_variable('prefix') -endif diff --git a/test cases/common/174 get project license/bar.c b/test cases/common/174 get project license/bar.c new file mode 100644 index 000000000..864869b4f --- /dev/null +++ b/test cases/common/174 get project license/bar.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I'm a main project bar.\n"); + return 0; +} diff --git a/test cases/common/174 get project license/meson.build b/test cases/common/174 get project license/meson.build new file mode 100644 index 000000000..37303e372 --- /dev/null +++ b/test cases/common/174 get project license/meson.build @@ -0,0 +1,8 @@ +project('bar', 'c', license: 'Apache') + +executable('bar', 'bar.c') + +license = meson.project_license()[0] +if license != 'Apache' + error('The license should be Apache, but it is: ' + license) +endif diff --git a/test cases/common/175 get project license/bar.c b/test cases/common/175 get project license/bar.c deleted file mode 100644 index 864869b4f..000000000 --- a/test cases/common/175 get project license/bar.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I'm a main project bar.\n"); - return 0; -} diff --git a/test cases/common/175 get project license/meson.build b/test cases/common/175 get project license/meson.build deleted file mode 100644 index 37303e372..000000000 --- a/test cases/common/175 get project license/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -project('bar', 'c', license: 'Apache') - -executable('bar', 'bar.c') - -license = meson.project_license()[0] -if license != 'Apache' - error('The license should be Apache, but it is: ' + license) -endif diff --git a/test cases/common/175 yield/meson.build b/test cases/common/175 yield/meson.build new file mode 100644 index 000000000..ba3e426b1 --- /dev/null +++ b/test cases/common/175 yield/meson.build @@ -0,0 +1,6 @@ +project('yield_options', 'c') + +subproject('sub') + +assert(get_option('unshared_option') == 'one', 'Unshared option has wrong value in superproject.') +assert(get_option('shared_option') == 'two', 'Unshared option has wrong value in superproject..') diff --git a/test cases/common/175 yield/meson_options.txt b/test cases/common/175 yield/meson_options.txt new file mode 100644 index 000000000..36bad4bd7 --- /dev/null +++ b/test cases/common/175 yield/meson_options.txt @@ -0,0 +1,2 @@ +option('unshared_option', type : 'string', value : 'one') +option('shared_option', type : 'string', value : 'two') diff --git a/test cases/common/175 yield/subprojects/sub/meson.build b/test cases/common/175 yield/subprojects/sub/meson.build new file mode 100644 index 000000000..3a506e07e --- /dev/null +++ b/test cases/common/175 yield/subprojects/sub/meson.build @@ -0,0 +1,4 @@ +project('subbie', 'c') + +assert(get_option('unshared_option') == 'three', 'Unshared option has wrong value in subproject.') +assert(get_option('shared_option') == 'two', 'Shared option has wrong value in subproject.') diff --git a/test cases/common/175 yield/subprojects/sub/meson_options.txt b/test cases/common/175 yield/subprojects/sub/meson_options.txt new file mode 100644 index 000000000..a96c3073c --- /dev/null +++ b/test cases/common/175 yield/subprojects/sub/meson_options.txt @@ -0,0 +1,2 @@ +option('unshared_option', type : 'string', value : 'three', yield : false) +option('shared_option', type : 'string', value : 'four', yield : true) diff --git a/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/a.c b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/a.c new file mode 100644 index 000000000..7ac3e5e57 --- /dev/null +++ b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/a.c @@ -0,0 +1,15 @@ +int func2(); + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func() { return func2(); } + diff --git a/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build new file mode 100644 index 000000000..12f656427 --- /dev/null +++ b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build @@ -0,0 +1,4 @@ +project('alpha project', 'c', subproject_dir: 'var/subprojects') + +b = subproject('beta') +l = shared_library('a', 'a.c', link_with : b.get_variable('lb')) diff --git a/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here @@ -0,0 +1 @@ + diff --git a/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/b.c b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/b.c new file mode 100644 index 000000000..a95651bc0 --- /dev/null +++ b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/b.c @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func2() { + return 42; +} diff --git a/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/meson.build b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/meson.build new file mode 100644 index 000000000..ea4cc9bdf --- /dev/null +++ b/test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/meson.build @@ -0,0 +1,3 @@ +project('beta project', 'c') + +lb = shared_library('b', 'b.c') diff --git a/test cases/common/176 subproject nested subproject dirs/meson.build b/test cases/common/176 subproject nested subproject dirs/meson.build new file mode 100644 index 000000000..a4d0a9716 --- /dev/null +++ b/test cases/common/176 subproject nested subproject dirs/meson.build @@ -0,0 +1,7 @@ +project('gamma project', 'c', subproject_dir: 'contrib/subprojects') + +a = subproject('alpha') +lib = a.get_variable('l') + +exe = executable('prog', 'prog.c', link_with : lib) +test('basic', exe) diff --git a/test cases/common/176 subproject nested subproject dirs/prog.c b/test cases/common/176 subproject nested subproject dirs/prog.c new file mode 100644 index 000000000..394f139eb --- /dev/null +++ b/test cases/common/176 subproject nested subproject dirs/prog.c @@ -0,0 +1,5 @@ +int func(); + +int main(int argc, char **argv) { + return func() == 42 ? 0 : 1; +} diff --git a/test cases/common/176 yield/meson.build b/test cases/common/176 yield/meson.build deleted file mode 100644 index ba3e426b1..000000000 --- a/test cases/common/176 yield/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('yield_options', 'c') - -subproject('sub') - -assert(get_option('unshared_option') == 'one', 'Unshared option has wrong value in superproject.') -assert(get_option('shared_option') == 'two', 'Unshared option has wrong value in superproject..') diff --git a/test cases/common/176 yield/meson_options.txt b/test cases/common/176 yield/meson_options.txt deleted file mode 100644 index 36bad4bd7..000000000 --- a/test cases/common/176 yield/meson_options.txt +++ /dev/null @@ -1,2 +0,0 @@ -option('unshared_option', type : 'string', value : 'one') -option('shared_option', type : 'string', value : 'two') diff --git a/test cases/common/176 yield/subprojects/sub/meson.build b/test cases/common/176 yield/subprojects/sub/meson.build deleted file mode 100644 index 3a506e07e..000000000 --- a/test cases/common/176 yield/subprojects/sub/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('subbie', 'c') - -assert(get_option('unshared_option') == 'three', 'Unshared option has wrong value in subproject.') -assert(get_option('shared_option') == 'two', 'Shared option has wrong value in subproject.') diff --git a/test cases/common/176 yield/subprojects/sub/meson_options.txt b/test cases/common/176 yield/subprojects/sub/meson_options.txt deleted file mode 100644 index a96c3073c..000000000 --- a/test cases/common/176 yield/subprojects/sub/meson_options.txt +++ /dev/null @@ -1,2 +0,0 @@ -option('unshared_option', type : 'string', value : 'three', yield : false) -option('shared_option', type : 'string', value : 'four', yield : true) diff --git a/test cases/common/177 preserve gendir/base.inp b/test cases/common/177 preserve gendir/base.inp new file mode 100644 index 000000000..df967b96a --- /dev/null +++ b/test cases/common/177 preserve gendir/base.inp @@ -0,0 +1 @@ +base diff --git a/test cases/common/177 preserve gendir/com/mesonbuild/subbie.inp b/test cases/common/177 preserve gendir/com/mesonbuild/subbie.inp new file mode 100644 index 000000000..df0f4e9ae --- /dev/null +++ b/test cases/common/177 preserve gendir/com/mesonbuild/subbie.inp @@ -0,0 +1 @@ +subbie diff --git a/test cases/common/177 preserve gendir/genprog.py b/test cases/common/177 preserve gendir/genprog.py new file mode 100755 index 000000000..1e10998ee --- /dev/null +++ b/test cases/common/177 preserve gendir/genprog.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +import os, sys, argparse + +h_templ = '''#pragma once + +int %s(); +''' + +c_templ = '''#include"%s.h" + +int %s() { + return 0; +} +''' + +parser = argparse.ArgumentParser() +parser.add_argument('--searchdir', required=True) +parser.add_argument('--outdir', required=True) +parser.add_argument('ifiles', nargs='+') + +options = parser.parse_args() + +searchdir = options.searchdir +outdir = options.outdir +ifiles = options.ifiles + +rel_ofiles = [] + +for ifile in ifiles: + if not ifile.startswith(options.searchdir): + sys.exit('Input file %s does not start with search dir %s.' % (ifile, searchdir)) + rel_ofile = ifile[len(searchdir):] + if rel_ofile[0] == '/' or rel_ofile[0] == '\\': + rel_ofile = rel_ofile[1:] + rel_ofiles.append(os.path.splitext(rel_ofile)[0]) + +ofile_bases = [os.path.join(outdir, i) for i in rel_ofiles] + +for i, ifile_name in enumerate(ifiles): + proto_name = open(ifile_name).readline().strip() + h_out = ofile_bases[i] + '.h' + c_out = ofile_bases[i] + '.c' + os.makedirs(os.path.split(ofile_bases[i])[0], exist_ok=True) + open(h_out, 'w').write(h_templ % (proto_name)) + open(c_out, 'w').write(c_templ % (proto_name, proto_name)) diff --git a/test cases/common/177 preserve gendir/meson.build b/test cases/common/177 preserve gendir/meson.build new file mode 100644 index 000000000..ce219f0d8 --- /dev/null +++ b/test cases/common/177 preserve gendir/meson.build @@ -0,0 +1,13 @@ +project('preserve subdir', 'c') + +gprog = find_program('genprog.py') + +gen = generator(gprog, \ + output : ['@BASENAME@.c', '@BASENAME@.h'], + arguments : ['--searchdir=@CURRENT_SOURCE_DIR@', '--outdir=@BUILD_DIR@', '@INPUT@']) + +generated = gen.process('base.inp', 'com/mesonbuild/subbie.inp', + preserve_path_from : meson.current_source_dir()) + +e = executable('testprog', 'testprog.c', generated) +test('testprog', e) diff --git a/test cases/common/177 preserve gendir/testprog.c b/test cases/common/177 preserve gendir/testprog.c new file mode 100644 index 000000000..46b460257 --- /dev/null +++ b/test cases/common/177 preserve gendir/testprog.c @@ -0,0 +1,6 @@ +#include"base.h" +#include"com/mesonbuild/subbie.h" + +int main(int argc, char **argv) { + return base() + subbie(); +} diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/a.c b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/a.c deleted file mode 100644 index 7ac3e5e57..000000000 --- a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/a.c +++ /dev/null @@ -1,15 +0,0 @@ -int func2(); - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC func() { return func2(); } - diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build deleted file mode 100644 index 12f656427..000000000 --- a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('alpha project', 'c', subproject_dir: 'var/subprojects') - -b = subproject('beta') -l = shared_library('a', 'a.c', link_with : b.get_variable('lb')) diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here deleted file mode 100644 index 8d1c8b69c..000000000 --- a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/b.c b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/b.c deleted file mode 100644 index a95651bc0..000000000 --- a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/b.c +++ /dev/null @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC func2() { - return 42; -} diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/meson.build b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/meson.build deleted file mode 100644 index ea4cc9bdf..000000000 --- a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('beta project', 'c') - -lb = shared_library('b', 'b.c') diff --git a/test cases/common/177 subproject nested subproject dirs/meson.build b/test cases/common/177 subproject nested subproject dirs/meson.build deleted file mode 100644 index a4d0a9716..000000000 --- a/test cases/common/177 subproject nested subproject dirs/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('gamma project', 'c', subproject_dir: 'contrib/subprojects') - -a = subproject('alpha') -lib = a.get_variable('l') - -exe = executable('prog', 'prog.c', link_with : lib) -test('basic', exe) diff --git a/test cases/common/177 subproject nested subproject dirs/prog.c b/test cases/common/177 subproject nested subproject dirs/prog.c deleted file mode 100644 index 394f139eb..000000000 --- a/test cases/common/177 subproject nested subproject dirs/prog.c +++ /dev/null @@ -1,5 +0,0 @@ -int func(); - -int main(int argc, char **argv) { - return func() == 42 ? 0 : 1; -} diff --git a/test cases/common/178 preserve gendir/base.inp b/test cases/common/178 preserve gendir/base.inp deleted file mode 100644 index df967b96a..000000000 --- a/test cases/common/178 preserve gendir/base.inp +++ /dev/null @@ -1 +0,0 @@ -base diff --git a/test cases/common/178 preserve gendir/com/mesonbuild/subbie.inp b/test cases/common/178 preserve gendir/com/mesonbuild/subbie.inp deleted file mode 100644 index df0f4e9ae..000000000 --- a/test cases/common/178 preserve gendir/com/mesonbuild/subbie.inp +++ /dev/null @@ -1 +0,0 @@ -subbie diff --git a/test cases/common/178 preserve gendir/genprog.py b/test cases/common/178 preserve gendir/genprog.py deleted file mode 100755 index 1e10998ee..000000000 --- a/test cases/common/178 preserve gendir/genprog.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 - -import os, sys, argparse - -h_templ = '''#pragma once - -int %s(); -''' - -c_templ = '''#include"%s.h" - -int %s() { - return 0; -} -''' - -parser = argparse.ArgumentParser() -parser.add_argument('--searchdir', required=True) -parser.add_argument('--outdir', required=True) -parser.add_argument('ifiles', nargs='+') - -options = parser.parse_args() - -searchdir = options.searchdir -outdir = options.outdir -ifiles = options.ifiles - -rel_ofiles = [] - -for ifile in ifiles: - if not ifile.startswith(options.searchdir): - sys.exit('Input file %s does not start with search dir %s.' % (ifile, searchdir)) - rel_ofile = ifile[len(searchdir):] - if rel_ofile[0] == '/' or rel_ofile[0] == '\\': - rel_ofile = rel_ofile[1:] - rel_ofiles.append(os.path.splitext(rel_ofile)[0]) - -ofile_bases = [os.path.join(outdir, i) for i in rel_ofiles] - -for i, ifile_name in enumerate(ifiles): - proto_name = open(ifile_name).readline().strip() - h_out = ofile_bases[i] + '.h' - c_out = ofile_bases[i] + '.c' - os.makedirs(os.path.split(ofile_bases[i])[0], exist_ok=True) - open(h_out, 'w').write(h_templ % (proto_name)) - open(c_out, 'w').write(c_templ % (proto_name, proto_name)) diff --git a/test cases/common/178 preserve gendir/meson.build b/test cases/common/178 preserve gendir/meson.build deleted file mode 100644 index ce219f0d8..000000000 --- a/test cases/common/178 preserve gendir/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -project('preserve subdir', 'c') - -gprog = find_program('genprog.py') - -gen = generator(gprog, \ - output : ['@BASENAME@.c', '@BASENAME@.h'], - arguments : ['--searchdir=@CURRENT_SOURCE_DIR@', '--outdir=@BUILD_DIR@', '@INPUT@']) - -generated = gen.process('base.inp', 'com/mesonbuild/subbie.inp', - preserve_path_from : meson.current_source_dir()) - -e = executable('testprog', 'testprog.c', generated) -test('testprog', e) diff --git a/test cases/common/178 preserve gendir/testprog.c b/test cases/common/178 preserve gendir/testprog.c deleted file mode 100644 index 46b460257..000000000 --- a/test cases/common/178 preserve gendir/testprog.c +++ /dev/null @@ -1,6 +0,0 @@ -#include"base.h" -#include"com/mesonbuild/subbie.h" - -int main(int argc, char **argv) { - return base() + subbie(); -} diff --git a/test cases/common/178 source in dep/bar.cpp b/test cases/common/178 source in dep/bar.cpp new file mode 100644 index 000000000..bda8cb6ec --- /dev/null +++ b/test cases/common/178 source in dep/bar.cpp @@ -0,0 +1,5 @@ +extern "C" int foo(); + +int main(int, char**) { + return foo() != 42; +} diff --git a/test cases/common/178 source in dep/foo.c b/test cases/common/178 source in dep/foo.c new file mode 100644 index 000000000..1ecfa8c79 --- /dev/null +++ b/test cases/common/178 source in dep/foo.c @@ -0,0 +1,3 @@ +int foo() { + return 42; +} diff --git a/test cases/common/178 source in dep/generated/funname b/test cases/common/178 source in dep/generated/funname new file mode 100644 index 000000000..79f3c867f --- /dev/null +++ b/test cases/common/178 source in dep/generated/funname @@ -0,0 +1 @@ +my_wonderful_function diff --git a/test cases/common/178 source in dep/generated/genheader.py b/test cases/common/178 source in dep/generated/genheader.py new file mode 100755 index 000000000..eafc07545 --- /dev/null +++ b/test cases/common/178 source in dep/generated/genheader.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import sys + +ifile = sys.argv[1] +ofile = sys.argv[2] + +templ = '''#pragma once + +int %s() { + return 42; +} +''' + +funname = open(ifile).readline().strip() + +open(ofile, 'w').write(templ % funname) diff --git a/test cases/common/178 source in dep/generated/main.c b/test cases/common/178 source in dep/generated/main.c new file mode 100644 index 000000000..07e7c932e --- /dev/null +++ b/test cases/common/178 source in dep/generated/main.c @@ -0,0 +1,5 @@ +#include"funheader.h" + +int main(int argc, char **argv) { + return my_wonderful_function() != 42; +} diff --git a/test cases/common/178 source in dep/generated/meson.build b/test cases/common/178 source in dep/generated/meson.build new file mode 100644 index 000000000..286270901 --- /dev/null +++ b/test cases/common/178 source in dep/generated/meson.build @@ -0,0 +1,12 @@ +fp = find_program('genheader.py') + +genh = custom_target('genh', + input : 'funname', + output : 'funheader.h', + command : [fp, '@INPUT@', '@OUTPUT@']) + +dep = declare_dependency(sources : [genh]) + +e = executable('genuser', 'main.c', + dependencies : dep) +test('genuser', e) diff --git a/test cases/common/178 source in dep/meson.build b/test cases/common/178 source in dep/meson.build new file mode 100644 index 000000000..7111ba11f --- /dev/null +++ b/test cases/common/178 source in dep/meson.build @@ -0,0 +1,8 @@ +project('foo', 'c', 'cpp') + +dep = declare_dependency(sources : 'foo.c') + +executable('bar', 'bar.cpp', + dependencies : dep) + +subdir('generated') diff --git a/test cases/common/179 generator link whole/export.h b/test cases/common/179 generator link whole/export.h new file mode 100644 index 000000000..f4f6f451b --- /dev/null +++ b/test cases/common/179 generator link whole/export.h @@ -0,0 +1,18 @@ +#pragma once + +#if defined BUILDING_EMBEDDED + #define DLL_PUBLIC +#elif defined _WIN32 || defined __CYGWIN__ + #if defined BUILDING_DLL + #define DLL_PUBLIC __declspec(dllexport) + #else + #define DLL_PUBLIC __declspec(dllimport) + #endif +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif diff --git a/test cases/common/179 generator link whole/generator.py b/test cases/common/179 generator link whole/generator.py new file mode 100755 index 000000000..0076b7499 --- /dev/null +++ b/test cases/common/179 generator link whole/generator.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 + +import os +import os.path +import sys + + +def main(): + name = os.path.splitext(os.path.basename(sys.argv[1]))[0] + out = sys.argv[2] + hname = os.path.join(out, name + '.h') + cname = os.path.join(out, name + '.c') + print(os.getcwd(), hname) + with open(hname, 'w') as hfile: + hfile.write(''' +#pragma once +#include "export.h" +int DLL_PUBLIC {name}(); +'''.format(name=name)) + with open(cname, 'w') as cfile: + cfile.write(''' +#include "{name}.h" +int {name}() {{ + return {size}; +}} +'''.format(name=name, size=len(name))) + + +if __name__ == '__main__': + main() diff --git a/test cases/common/179 generator link whole/main.c b/test cases/common/179 generator link whole/main.c new file mode 100644 index 000000000..acf871782 --- /dev/null +++ b/test cases/common/179 generator link whole/main.c @@ -0,0 +1,11 @@ +#include "meson_test_function.h" + +#include + +int main() { + if (meson_test_function() != 19) { + printf("Bad meson_test_function()\n"); + return 1; + } + return 0; +} diff --git a/test cases/common/179 generator link whole/meson.build b/test cases/common/179 generator link whole/meson.build new file mode 100644 index 000000000..30ae9c62c --- /dev/null +++ b/test cases/common/179 generator link whole/meson.build @@ -0,0 +1,65 @@ +project('generator link_whole', 'c') + +cc = meson.get_compiler('c') +if cc.get_id() == 'msvc' + if cc.version().version_compare('<19') + error('MESON_SKIP_TEST link_whole only works on VS2015 or newer.') + endif +endif + +# This just generates foo.h and foo.c with int foo() defined. +gen_py = find_program('generator.py') +gen = generator(gen_py, + output: ['@BASENAME@.h', '@BASENAME@.c'], + arguments : ['@INPUT@', '@BUILD_DIR@']) + +# Test 1: link directly into executable +srcs = gen.process('meson_test_function.tmpl') +exe = executable('exe1', [srcs, 'main.c'], c_args : '-DBUILDING_EMBEDDED') +test('test1', exe) + +# Test 2: link into shared library and access from executable +srcs = gen.process('meson_test_function.tmpl') +shlib2 = shared_library('shlib2', [srcs], c_args : '-DBUILDING_DLL') +exe = executable('exe2', 'main.c', + link_with : shlib2, + include_directories : shlib2.private_dir_include(), +) +test('test2', exe) + +# Test 3: link into static library and access from executable +srcs = gen.process('meson_test_function.tmpl') +stlib3 = static_library('stlib3', [srcs], c_args : '-DBUILDING_EMBEDDED') +exe = executable('exe3', 'main.c', + c_args : '-DBUILDING_EMBEDDED', + link_with : stlib3, + include_directories : stlib3.private_dir_include(), +) +test('test3', exe) + +# Test 4: link into static library, link into shared +# and access from executable. To make sure static_library +# is not dropped use pull_meson_test_function helper. +srcs = gen.process('meson_test_function.tmpl') +stlib4 = static_library('stlib4', [srcs], c_args : '-DBUILDING_DLL') +shlib4 = shared_library('shlib4', 'pull_meson_test_function.c', + c_args : '-DBUILDING_DLL', + link_with : stlib4, + include_directories : stlib4.private_dir_include(), +) +exe = executable('exe4', 'main.c', + link_with : shlib4, + include_directories : stlib4.private_dir_include(), +) +test('test4', exe) + +# Test 5: link into static library, link_whole into shared +# and access from executable +srcs = gen.process('meson_test_function.tmpl') +stlib5 = static_library('stlib5', [srcs], c_args : '-DBUILDING_DLL') +shlib5 = shared_library('shlib5', link_whole : stlib5) +exe = executable('exe5', 'main.c', + link_with : shlib5, + include_directories : stlib5.private_dir_include(), +) +test('test5', exe) diff --git a/test cases/common/179 generator link whole/meson_test_function.tmpl b/test cases/common/179 generator link whole/meson_test_function.tmpl new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/common/179 generator link whole/pull_meson_test_function.c b/test cases/common/179 generator link whole/pull_meson_test_function.c new file mode 100644 index 000000000..c54dda6d7 --- /dev/null +++ b/test cases/common/179 generator link whole/pull_meson_test_function.c @@ -0,0 +1,6 @@ +#include "export.h" +#include "meson_test_function.h" + +int DLL_PUBLIC function_puller() { + return meson_test_function(); +} diff --git a/test cases/common/179 source in dep/bar.cpp b/test cases/common/179 source in dep/bar.cpp deleted file mode 100644 index bda8cb6ec..000000000 --- a/test cases/common/179 source in dep/bar.cpp +++ /dev/null @@ -1,5 +0,0 @@ -extern "C" int foo(); - -int main(int, char**) { - return foo() != 42; -} diff --git a/test cases/common/179 source in dep/foo.c b/test cases/common/179 source in dep/foo.c deleted file mode 100644 index 1ecfa8c79..000000000 --- a/test cases/common/179 source in dep/foo.c +++ /dev/null @@ -1,3 +0,0 @@ -int foo() { - return 42; -} diff --git a/test cases/common/179 source in dep/generated/funname b/test cases/common/179 source in dep/generated/funname deleted file mode 100644 index 79f3c867f..000000000 --- a/test cases/common/179 source in dep/generated/funname +++ /dev/null @@ -1 +0,0 @@ -my_wonderful_function diff --git a/test cases/common/179 source in dep/generated/genheader.py b/test cases/common/179 source in dep/generated/genheader.py deleted file mode 100755 index eafc07545..000000000 --- a/test cases/common/179 source in dep/generated/genheader.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -ifile = sys.argv[1] -ofile = sys.argv[2] - -templ = '''#pragma once - -int %s() { - return 42; -} -''' - -funname = open(ifile).readline().strip() - -open(ofile, 'w').write(templ % funname) diff --git a/test cases/common/179 source in dep/generated/main.c b/test cases/common/179 source in dep/generated/main.c deleted file mode 100644 index 07e7c932e..000000000 --- a/test cases/common/179 source in dep/generated/main.c +++ /dev/null @@ -1,5 +0,0 @@ -#include"funheader.h" - -int main(int argc, char **argv) { - return my_wonderful_function() != 42; -} diff --git a/test cases/common/179 source in dep/generated/meson.build b/test cases/common/179 source in dep/generated/meson.build deleted file mode 100644 index 286270901..000000000 --- a/test cases/common/179 source in dep/generated/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -fp = find_program('genheader.py') - -genh = custom_target('genh', - input : 'funname', - output : 'funheader.h', - command : [fp, '@INPUT@', '@OUTPUT@']) - -dep = declare_dependency(sources : [genh]) - -e = executable('genuser', 'main.c', - dependencies : dep) -test('genuser', e) diff --git a/test cases/common/179 source in dep/meson.build b/test cases/common/179 source in dep/meson.build deleted file mode 100644 index 7111ba11f..000000000 --- a/test cases/common/179 source in dep/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -project('foo', 'c', 'cpp') - -dep = declare_dependency(sources : 'foo.c') - -executable('bar', 'bar.cpp', - dependencies : dep) - -subdir('generated') diff --git a/test cases/common/180 generator link whole/export.h b/test cases/common/180 generator link whole/export.h deleted file mode 100644 index f4f6f451b..000000000 --- a/test cases/common/180 generator link whole/export.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#if defined BUILDING_EMBEDDED - #define DLL_PUBLIC -#elif defined _WIN32 || defined __CYGWIN__ - #if defined BUILDING_DLL - #define DLL_PUBLIC __declspec(dllexport) - #else - #define DLL_PUBLIC __declspec(dllimport) - #endif -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif diff --git a/test cases/common/180 generator link whole/generator.py b/test cases/common/180 generator link whole/generator.py deleted file mode 100755 index 0076b7499..000000000 --- a/test cases/common/180 generator link whole/generator.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python3 - -import os -import os.path -import sys - - -def main(): - name = os.path.splitext(os.path.basename(sys.argv[1]))[0] - out = sys.argv[2] - hname = os.path.join(out, name + '.h') - cname = os.path.join(out, name + '.c') - print(os.getcwd(), hname) - with open(hname, 'w') as hfile: - hfile.write(''' -#pragma once -#include "export.h" -int DLL_PUBLIC {name}(); -'''.format(name=name)) - with open(cname, 'w') as cfile: - cfile.write(''' -#include "{name}.h" -int {name}() {{ - return {size}; -}} -'''.format(name=name, size=len(name))) - - -if __name__ == '__main__': - main() diff --git a/test cases/common/180 generator link whole/main.c b/test cases/common/180 generator link whole/main.c deleted file mode 100644 index acf871782..000000000 --- a/test cases/common/180 generator link whole/main.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "meson_test_function.h" - -#include - -int main() { - if (meson_test_function() != 19) { - printf("Bad meson_test_function()\n"); - return 1; - } - return 0; -} diff --git a/test cases/common/180 generator link whole/meson.build b/test cases/common/180 generator link whole/meson.build deleted file mode 100644 index 30ae9c62c..000000000 --- a/test cases/common/180 generator link whole/meson.build +++ /dev/null @@ -1,65 +0,0 @@ -project('generator link_whole', 'c') - -cc = meson.get_compiler('c') -if cc.get_id() == 'msvc' - if cc.version().version_compare('<19') - error('MESON_SKIP_TEST link_whole only works on VS2015 or newer.') - endif -endif - -# This just generates foo.h and foo.c with int foo() defined. -gen_py = find_program('generator.py') -gen = generator(gen_py, - output: ['@BASENAME@.h', '@BASENAME@.c'], - arguments : ['@INPUT@', '@BUILD_DIR@']) - -# Test 1: link directly into executable -srcs = gen.process('meson_test_function.tmpl') -exe = executable('exe1', [srcs, 'main.c'], c_args : '-DBUILDING_EMBEDDED') -test('test1', exe) - -# Test 2: link into shared library and access from executable -srcs = gen.process('meson_test_function.tmpl') -shlib2 = shared_library('shlib2', [srcs], c_args : '-DBUILDING_DLL') -exe = executable('exe2', 'main.c', - link_with : shlib2, - include_directories : shlib2.private_dir_include(), -) -test('test2', exe) - -# Test 3: link into static library and access from executable -srcs = gen.process('meson_test_function.tmpl') -stlib3 = static_library('stlib3', [srcs], c_args : '-DBUILDING_EMBEDDED') -exe = executable('exe3', 'main.c', - c_args : '-DBUILDING_EMBEDDED', - link_with : stlib3, - include_directories : stlib3.private_dir_include(), -) -test('test3', exe) - -# Test 4: link into static library, link into shared -# and access from executable. To make sure static_library -# is not dropped use pull_meson_test_function helper. -srcs = gen.process('meson_test_function.tmpl') -stlib4 = static_library('stlib4', [srcs], c_args : '-DBUILDING_DLL') -shlib4 = shared_library('shlib4', 'pull_meson_test_function.c', - c_args : '-DBUILDING_DLL', - link_with : stlib4, - include_directories : stlib4.private_dir_include(), -) -exe = executable('exe4', 'main.c', - link_with : shlib4, - include_directories : stlib4.private_dir_include(), -) -test('test4', exe) - -# Test 5: link into static library, link_whole into shared -# and access from executable -srcs = gen.process('meson_test_function.tmpl') -stlib5 = static_library('stlib5', [srcs], c_args : '-DBUILDING_DLL') -shlib5 = shared_library('shlib5', link_whole : stlib5) -exe = executable('exe5', 'main.c', - link_with : shlib5, - include_directories : stlib5.private_dir_include(), -) -test('test5', exe) diff --git a/test cases/common/180 generator link whole/meson_test_function.tmpl b/test cases/common/180 generator link whole/meson_test_function.tmpl deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/common/180 generator link whole/pull_meson_test_function.c b/test cases/common/180 generator link whole/pull_meson_test_function.c deleted file mode 100644 index c54dda6d7..000000000 --- a/test cases/common/180 generator link whole/pull_meson_test_function.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "export.h" -#include "meson_test_function.h" - -int DLL_PUBLIC function_puller() { - return meson_test_function(); -} diff --git a/test cases/common/180 initial c_args/meson.build b/test cases/common/180 initial c_args/meson.build new file mode 100644 index 000000000..169d2bd51 --- /dev/null +++ b/test cases/common/180 initial c_args/meson.build @@ -0,0 +1,7 @@ +project('options', 'c') + +# Test passing c_args and c_link_args options from the command line. +assert(get_option('c_args') == ['-funroll-loops'], + 'Incorrect value for c_args option.') +assert(get_option('c_link_args') == ['-random_linker_option'], + 'Incorrect value for c_link_args option.') diff --git a/test cases/common/180 initial c_args/test_args.txt b/test cases/common/180 initial c_args/test_args.txt new file mode 100644 index 000000000..9a6da068a --- /dev/null +++ b/test cases/common/180 initial c_args/test_args.txt @@ -0,0 +1,4 @@ +# This file is not read by meson itself, but by the test framework. +# It is not possible to pass arguments to meson from a file. +['-Dc_args=-march=native', '-Dc_args=-funroll-loops', + '-Dc_link_args=-random_linker_option'] diff --git a/test cases/common/181 identical target name in subproject flat layout/foo.c b/test cases/common/181 identical target name in subproject flat layout/foo.c new file mode 100644 index 000000000..ed427899a --- /dev/null +++ b/test cases/common/181 identical target name in subproject flat layout/foo.c @@ -0,0 +1 @@ +int meson_test_main_foo(void) { return 10; } diff --git a/test cases/common/181 identical target name in subproject flat layout/main.c b/test cases/common/181 identical target name in subproject flat layout/main.c new file mode 100644 index 000000000..6f02aeb82 --- /dev/null +++ b/test cases/common/181 identical target name in subproject flat layout/main.c @@ -0,0 +1,16 @@ +#include + +int meson_test_main_foo(void); +int meson_test_subproj_foo(void); + +int main(void) { + if (meson_test_main_foo() != 10) { + printf("Failed meson_test_main_foo\n"); + return 1; + } + if (meson_test_subproj_foo() != 20) { + printf("Failed meson_test_subproj_foo\n"); + return 1; + } + return 0; +} diff --git a/test cases/common/181 identical target name in subproject flat layout/meson.build b/test cases/common/181 identical target name in subproject flat layout/meson.build new file mode 100644 index 000000000..d859fda3e --- /dev/null +++ b/test cases/common/181 identical target name in subproject flat layout/meson.build @@ -0,0 +1,11 @@ +project('subproject targets', 'c') + +# Idea behind this test is to create targets with identical name +# but different output files. We can do this by choosing different +# name_prefix of libraries. Target id does not depend on name_prefix. + +main_foo = static_library('foo', 'foo.c', name_prefix : 'main') +subproj_foo = subproject('subproj').get_variable('foo') + +exe = executable('prog', 'main.c', link_with : [main_foo, subproj_foo]) +test('main test', exe) diff --git a/test cases/common/181 identical target name in subproject flat layout/subprojects/subproj/foo.c b/test cases/common/181 identical target name in subproject flat layout/subprojects/subproj/foo.c new file mode 100644 index 000000000..f33429229 --- /dev/null +++ b/test cases/common/181 identical target name in subproject flat layout/subprojects/subproj/foo.c @@ -0,0 +1 @@ +int meson_test_subproj_foo(void) { return 20; } diff --git a/test cases/common/181 identical target name in subproject flat layout/subprojects/subproj/meson.build b/test cases/common/181 identical target name in subproject flat layout/subprojects/subproj/meson.build new file mode 100644 index 000000000..c92719469 --- /dev/null +++ b/test cases/common/181 identical target name in subproject flat layout/subprojects/subproj/meson.build @@ -0,0 +1,3 @@ +project('subproj', 'c') + +foo = static_library('foo', 'foo.c', name_prefix : 'subproj') diff --git a/test cases/common/181 initial c_args/meson.build b/test cases/common/181 initial c_args/meson.build deleted file mode 100644 index 169d2bd51..000000000 --- a/test cases/common/181 initial c_args/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('options', 'c') - -# Test passing c_args and c_link_args options from the command line. -assert(get_option('c_args') == ['-funroll-loops'], - 'Incorrect value for c_args option.') -assert(get_option('c_link_args') == ['-random_linker_option'], - 'Incorrect value for c_link_args option.') diff --git a/test cases/common/181 initial c_args/test_args.txt b/test cases/common/181 initial c_args/test_args.txt deleted file mode 100644 index 9a6da068a..000000000 --- a/test cases/common/181 initial c_args/test_args.txt +++ /dev/null @@ -1,4 +0,0 @@ -# This file is not read by meson itself, but by the test framework. -# It is not possible to pass arguments to meson from a file. -['-Dc_args=-march=native', '-Dc_args=-funroll-loops', - '-Dc_link_args=-random_linker_option'] diff --git a/test cases/common/182 as-needed/config.h b/test cases/common/182 as-needed/config.h new file mode 100644 index 000000000..b8fb60fe4 --- /dev/null +++ b/test cases/common/182 as-needed/config.h @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #if defined BUILDING_DLL + #define DLL_PUBLIC __declspec(dllexport) + #else + #define DLL_PUBLIC __declspec(dllimport) + #endif +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif diff --git a/test cases/common/182 as-needed/libA.cpp b/test cases/common/182 as-needed/libA.cpp new file mode 100644 index 000000000..5f45bc077 --- /dev/null +++ b/test cases/common/182 as-needed/libA.cpp @@ -0,0 +1,7 @@ +#define BUILDING_DLL + +#include "libA.h" + +namespace meson_test_as_needed { + DLL_PUBLIC bool linked = false; +} diff --git a/test cases/common/182 as-needed/libA.h b/test cases/common/182 as-needed/libA.h new file mode 100644 index 000000000..8e76d22fa --- /dev/null +++ b/test cases/common/182 as-needed/libA.h @@ -0,0 +1,5 @@ +#include "config.h" + +namespace meson_test_as_needed { + DLL_PUBLIC extern bool linked; +} diff --git a/test cases/common/182 as-needed/libB.cpp b/test cases/common/182 as-needed/libB.cpp new file mode 100644 index 000000000..a8723941b --- /dev/null +++ b/test cases/common/182 as-needed/libB.cpp @@ -0,0 +1,19 @@ +#include "libA.h" + +#undef DLL_PUBLIC +#define BUILDING_DLL +#include "config.h" + +namespace meson_test_as_needed { + namespace { + bool set_linked() { + linked = true; + return true; + } + bool stub = set_linked(); + } + + DLL_PUBLIC int libB_unused_func() { + return 0; + } +} diff --git a/test cases/common/182 as-needed/main.cpp b/test cases/common/182 as-needed/main.cpp new file mode 100644 index 000000000..191d15c4d --- /dev/null +++ b/test cases/common/182 as-needed/main.cpp @@ -0,0 +1,7 @@ +#include + +#include "libA.h" + +int main() { + return !meson_test_as_needed::linked ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/test cases/common/182 as-needed/meson.build b/test cases/common/182 as-needed/meson.build new file mode 100644 index 000000000..3b54aaa02 --- /dev/null +++ b/test cases/common/182 as-needed/meson.build @@ -0,0 +1,13 @@ +project('as-needed test', 'cpp') + +# Idea behind this test is to have -Wl,--as-needed prune +# away unneeded linkages, which would otherwise cause global +# static initialiser side-effects to set a boolean to true. + +# Credits for portable ISO C++ idea go to sarum9in + +libA = library('A', 'libA.cpp') +libB = library('B', 'libB.cpp', link_with : libA) + +main_exe = executable('C', 'main.cpp', link_with : [libA, libB]) +test('main test', main_exe) diff --git a/test cases/common/182 identical target name in subproject flat layout/foo.c b/test cases/common/182 identical target name in subproject flat layout/foo.c deleted file mode 100644 index ed427899a..000000000 --- a/test cases/common/182 identical target name in subproject flat layout/foo.c +++ /dev/null @@ -1 +0,0 @@ -int meson_test_main_foo(void) { return 10; } diff --git a/test cases/common/182 identical target name in subproject flat layout/main.c b/test cases/common/182 identical target name in subproject flat layout/main.c deleted file mode 100644 index 6f02aeb82..000000000 --- a/test cases/common/182 identical target name in subproject flat layout/main.c +++ /dev/null @@ -1,16 +0,0 @@ -#include - -int meson_test_main_foo(void); -int meson_test_subproj_foo(void); - -int main(void) { - if (meson_test_main_foo() != 10) { - printf("Failed meson_test_main_foo\n"); - return 1; - } - if (meson_test_subproj_foo() != 20) { - printf("Failed meson_test_subproj_foo\n"); - return 1; - } - return 0; -} diff --git a/test cases/common/182 identical target name in subproject flat layout/meson.build b/test cases/common/182 identical target name in subproject flat layout/meson.build deleted file mode 100644 index d859fda3e..000000000 --- a/test cases/common/182 identical target name in subproject flat layout/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('subproject targets', 'c') - -# Idea behind this test is to create targets with identical name -# but different output files. We can do this by choosing different -# name_prefix of libraries. Target id does not depend on name_prefix. - -main_foo = static_library('foo', 'foo.c', name_prefix : 'main') -subproj_foo = subproject('subproj').get_variable('foo') - -exe = executable('prog', 'main.c', link_with : [main_foo, subproj_foo]) -test('main test', exe) diff --git a/test cases/common/182 identical target name in subproject flat layout/subprojects/subproj/foo.c b/test cases/common/182 identical target name in subproject flat layout/subprojects/subproj/foo.c deleted file mode 100644 index f33429229..000000000 --- a/test cases/common/182 identical target name in subproject flat layout/subprojects/subproj/foo.c +++ /dev/null @@ -1 +0,0 @@ -int meson_test_subproj_foo(void) { return 20; } diff --git a/test cases/common/182 identical target name in subproject flat layout/subprojects/subproj/meson.build b/test cases/common/182 identical target name in subproject flat layout/subprojects/subproj/meson.build deleted file mode 100644 index c92719469..000000000 --- a/test cases/common/182 identical target name in subproject flat layout/subprojects/subproj/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('subproj', 'c') - -foo = static_library('foo', 'foo.c', name_prefix : 'subproj') diff --git a/test cases/common/183 ndebug if-release enabled/main.c b/test cases/common/183 ndebug if-release enabled/main.c new file mode 100644 index 000000000..984ebcabe --- /dev/null +++ b/test cases/common/183 ndebug if-release enabled/main.c @@ -0,0 +1,15 @@ +#include +#include + +int meson_test_side_effect = EXIT_FAILURE; + +int meson_test_set_side_effect(void) { + meson_test_side_effect = EXIT_SUCCESS; + return 1; +} + +int main(void) { + // meson_test_side_effect is set only if assert is executed + assert(meson_test_set_side_effect()); + return meson_test_side_effect; +} diff --git a/test cases/common/183 ndebug if-release enabled/meson.build b/test cases/common/183 ndebug if-release enabled/meson.build new file mode 100644 index 000000000..be263752a --- /dev/null +++ b/test cases/common/183 ndebug if-release enabled/meson.build @@ -0,0 +1,7 @@ +project('ndebug enabled', 'c', + default_options : [ + 'buildtype=debugoptimized', + 'b_ndebug=if-release', + ]) + +test('exe', executable('main', 'main.c')) diff --git a/test cases/common/184 as-needed/config.h b/test cases/common/184 as-needed/config.h deleted file mode 100644 index b8fb60fe4..000000000 --- a/test cases/common/184 as-needed/config.h +++ /dev/null @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #if defined BUILDING_DLL - #define DLL_PUBLIC __declspec(dllexport) - #else - #define DLL_PUBLIC __declspec(dllimport) - #endif -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif diff --git a/test cases/common/184 as-needed/libA.cpp b/test cases/common/184 as-needed/libA.cpp deleted file mode 100644 index 5f45bc077..000000000 --- a/test cases/common/184 as-needed/libA.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#define BUILDING_DLL - -#include "libA.h" - -namespace meson_test_as_needed { - DLL_PUBLIC bool linked = false; -} diff --git a/test cases/common/184 as-needed/libA.h b/test cases/common/184 as-needed/libA.h deleted file mode 100644 index 8e76d22fa..000000000 --- a/test cases/common/184 as-needed/libA.h +++ /dev/null @@ -1,5 +0,0 @@ -#include "config.h" - -namespace meson_test_as_needed { - DLL_PUBLIC extern bool linked; -} diff --git a/test cases/common/184 as-needed/libB.cpp b/test cases/common/184 as-needed/libB.cpp deleted file mode 100644 index a8723941b..000000000 --- a/test cases/common/184 as-needed/libB.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "libA.h" - -#undef DLL_PUBLIC -#define BUILDING_DLL -#include "config.h" - -namespace meson_test_as_needed { - namespace { - bool set_linked() { - linked = true; - return true; - } - bool stub = set_linked(); - } - - DLL_PUBLIC int libB_unused_func() { - return 0; - } -} diff --git a/test cases/common/184 as-needed/main.cpp b/test cases/common/184 as-needed/main.cpp deleted file mode 100644 index 191d15c4d..000000000 --- a/test cases/common/184 as-needed/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -#include "libA.h" - -int main() { - return !meson_test_as_needed::linked ? EXIT_SUCCESS : EXIT_FAILURE; -} diff --git a/test cases/common/184 as-needed/meson.build b/test cases/common/184 as-needed/meson.build deleted file mode 100644 index 3b54aaa02..000000000 --- a/test cases/common/184 as-needed/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -project('as-needed test', 'cpp') - -# Idea behind this test is to have -Wl,--as-needed prune -# away unneeded linkages, which would otherwise cause global -# static initialiser side-effects to set a boolean to true. - -# Credits for portable ISO C++ idea go to sarum9in - -libA = library('A', 'libA.cpp') -libB = library('B', 'libB.cpp', link_with : libA) - -main_exe = executable('C', 'main.cpp', link_with : [libA, libB]) -test('main test', main_exe) diff --git a/test cases/common/184 ndebug if-release disabled/main.c b/test cases/common/184 ndebug if-release disabled/main.c new file mode 100644 index 000000000..cb3ec3f65 --- /dev/null +++ b/test cases/common/184 ndebug if-release disabled/main.c @@ -0,0 +1,7 @@ +#include +#include + +int main(void) { + assert(0); + return EXIT_SUCCESS; +} diff --git a/test cases/common/184 ndebug if-release disabled/meson.build b/test cases/common/184 ndebug if-release disabled/meson.build new file mode 100644 index 000000000..a9a79ea9b --- /dev/null +++ b/test cases/common/184 ndebug if-release disabled/meson.build @@ -0,0 +1,7 @@ +project('ndebug disabled', 'c', + default_options : [ + 'buildtype=release', + 'b_ndebug=if-release', + ]) + +test('exe', executable('main', 'main.c')) diff --git a/test cases/common/185 ndebug if-release enabled/main.c b/test cases/common/185 ndebug if-release enabled/main.c deleted file mode 100644 index 984ebcabe..000000000 --- a/test cases/common/185 ndebug if-release enabled/main.c +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -int meson_test_side_effect = EXIT_FAILURE; - -int meson_test_set_side_effect(void) { - meson_test_side_effect = EXIT_SUCCESS; - return 1; -} - -int main(void) { - // meson_test_side_effect is set only if assert is executed - assert(meson_test_set_side_effect()); - return meson_test_side_effect; -} diff --git a/test cases/common/185 ndebug if-release enabled/meson.build b/test cases/common/185 ndebug if-release enabled/meson.build deleted file mode 100644 index be263752a..000000000 --- a/test cases/common/185 ndebug if-release enabled/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('ndebug enabled', 'c', - default_options : [ - 'buildtype=debugoptimized', - 'b_ndebug=if-release', - ]) - -test('exe', executable('main', 'main.c')) diff --git a/test cases/common/185 subproject version/meson.build b/test cases/common/185 subproject version/meson.build new file mode 100644 index 000000000..bd8fc0392 --- /dev/null +++ b/test cases/common/185 subproject version/meson.build @@ -0,0 +1,10 @@ +project('subproject version', 'c', + version : '2.3.4', + license: 'mylicense') + +subproject('a') + +liba_dep = dependency('a', + fallback: ['a', 'liba_dep'], + version: ['>= 0.30.0', '!= 0.99.0']) + diff --git a/test cases/common/185 subproject version/subprojects/a/meson.build b/test cases/common/185 subproject version/subprojects/a/meson.build new file mode 100644 index 000000000..dae31300f --- /dev/null +++ b/test cases/common/185 subproject version/subprojects/a/meson.build @@ -0,0 +1,5 @@ +project('mysubproject', 'c', + version : '1.0.0', + license : 'sublicense') + +liba_dep = declare_dependency (version : '1.0.0') diff --git a/test cases/common/186 ndebug if-release disabled/main.c b/test cases/common/186 ndebug if-release disabled/main.c deleted file mode 100644 index cb3ec3f65..000000000 --- a/test cases/common/186 ndebug if-release disabled/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -int main(void) { - assert(0); - return EXIT_SUCCESS; -} diff --git a/test cases/common/186 ndebug if-release disabled/meson.build b/test cases/common/186 ndebug if-release disabled/meson.build deleted file mode 100644 index a9a79ea9b..000000000 --- a/test cases/common/186 ndebug if-release disabled/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('ndebug disabled', 'c', - default_options : [ - 'buildtype=release', - 'b_ndebug=if-release', - ]) - -test('exe', executable('main', 'main.c')) diff --git a/test cases/common/186 subdir_done/meson.build b/test cases/common/186 subdir_done/meson.build new file mode 100644 index 000000000..457e613b1 --- /dev/null +++ b/test cases/common/186 subdir_done/meson.build @@ -0,0 +1,12 @@ +# Should run, even though main.cpp does not exist and we call error in the last line. +# subdir_done jumps to end, so both lines are not executed. + +project('example exit', 'cpp') + +if true + subdir_done() +endif + +executable('main', 'main.cpp') +error('Unreachable') + diff --git a/test cases/common/187 bothlibraries/libfile.c b/test cases/common/187 bothlibraries/libfile.c new file mode 100644 index 000000000..085ef3b87 --- /dev/null +++ b/test cases/common/187 bothlibraries/libfile.c @@ -0,0 +1,7 @@ +#include "mylib.h" + +DO_EXPORT int retval = 42; + +DO_EXPORT int func() { + return retval; +} diff --git a/test cases/common/187 bothlibraries/main.c b/test cases/common/187 bothlibraries/main.c new file mode 100644 index 000000000..03a8e02b8 --- /dev/null +++ b/test cases/common/187 bothlibraries/main.c @@ -0,0 +1,8 @@ +#include "mylib.h" + +DO_IMPORT int func(); +DO_IMPORT int retval; + +int main(int argc, char **arg) { + return func() == retval ? 0 : 1; +} diff --git a/test cases/common/187 bothlibraries/meson.build b/test cases/common/187 bothlibraries/meson.build new file mode 100644 index 000000000..3a13d6259 --- /dev/null +++ b/test cases/common/187 bothlibraries/meson.build @@ -0,0 +1,12 @@ +project('both libraries linking test', 'c') + +both_libs = both_libraries('mylib', 'libfile.c') +exe_shared = executable('prog-shared', 'main.c', link_with : both_libs.get_shared_lib()) +exe_static = executable('prog-static', 'main.c', + c_args : ['-DSTATIC_COMPILATION'], + link_with : both_libs.get_static_lib()) +exe_both = executable('prog-both', 'main.c', link_with : both_libs) + +test('runtest-shared', exe_shared) +test('runtest-static', exe_static) +test('runtest-both', exe_both) diff --git a/test cases/common/187 bothlibraries/mylib.h b/test cases/common/187 bothlibraries/mylib.h new file mode 100644 index 000000000..1038a0142 --- /dev/null +++ b/test cases/common/187 bothlibraries/mylib.h @@ -0,0 +1,13 @@ +#pragma once + +#ifdef _WIN32 + #ifdef STATIC_COMPILATION + #define DO_IMPORT extern + #else + #define DO_IMPORT __declspec(dllimport) + #endif + #define DO_EXPORT __declspec(dllexport) +#else + #define DO_IMPORT extern + #define DO_EXPORT +#endif diff --git a/test cases/common/187 subproject version/meson.build b/test cases/common/187 subproject version/meson.build deleted file mode 100644 index bd8fc0392..000000000 --- a/test cases/common/187 subproject version/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -project('subproject version', 'c', - version : '2.3.4', - license: 'mylicense') - -subproject('a') - -liba_dep = dependency('a', - fallback: ['a', 'liba_dep'], - version: ['>= 0.30.0', '!= 0.99.0']) - diff --git a/test cases/common/187 subproject version/subprojects/a/meson.build b/test cases/common/187 subproject version/subprojects/a/meson.build deleted file mode 100644 index dae31300f..000000000 --- a/test cases/common/187 subproject version/subprojects/a/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('mysubproject', 'c', - version : '1.0.0', - license : 'sublicense') - -liba_dep = declare_dependency (version : '1.0.0') diff --git a/test cases/common/188 escape and unicode/file.c.in b/test cases/common/188 escape and unicode/file.c.in new file mode 100644 index 000000000..413ed4297 --- /dev/null +++ b/test cases/common/188 escape and unicode/file.c.in @@ -0,0 +1,5 @@ +#include +const char* does_it_work() { + printf("{NAME}\n"); + return "yes it does"; +} diff --git a/test cases/common/188 escape and unicode/file.py b/test cases/common/188 escape and unicode/file.py new file mode 100644 index 000000000..af67a0950 --- /dev/null +++ b/test cases/common/188 escape and unicode/file.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +import sys +import os + +with open(sys.argv[1]) as fh: + content = fh.read().replace("{NAME}", sys.argv[2]) + +with open(os.path.join(sys.argv[3]), 'w') as fh: + fh.write(content) diff --git a/test cases/common/188 escape and unicode/find.py b/test cases/common/188 escape and unicode/find.py new file mode 100644 index 000000000..34a3eb835 --- /dev/null +++ b/test cases/common/188 escape and unicode/find.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import os +import sys + +for fh in os.listdir('.'): + if os.path.isfile(fh): + if fh.endswith('.c'): + sys.stdout.write(fh + '\0') diff --git a/test cases/common/188 escape and unicode/fun.c b/test cases/common/188 escape and unicode/fun.c new file mode 100644 index 000000000..8eeb8ea00 --- /dev/null +++ b/test cases/common/188 escape and unicode/fun.c @@ -0,0 +1,3 @@ +int a_fun() { + return 1; +} diff --git a/test cases/common/188 escape and unicode/main.c b/test cases/common/188 escape and unicode/main.c new file mode 100644 index 000000000..0bcde169c --- /dev/null +++ b/test cases/common/188 escape and unicode/main.c @@ -0,0 +1,12 @@ +#include + +const char* does_it_work(); + +int a_fun(); + +int main() { + if(strcmp(does_it_work(), "yes it does") != 0) { + return -a_fun(); + } + return 0; +} diff --git a/test cases/common/188 escape and unicode/meson.build b/test cases/common/188 escape and unicode/meson.build new file mode 100644 index 000000000..65377b6a3 --- /dev/null +++ b/test cases/common/188 escape and unicode/meson.build @@ -0,0 +1,24 @@ +project('180 escape', 'c') + +gen = generator(find_program('file.py'), arguments:['@INPUT@', 'erd\u0151', '@OUTPUT@'], output: '@BASENAME@') + +gen_file = gen.process('file.c.in') + +find_file_list = run_command(find_program('find.py')) +assert(find_file_list.returncode() == 0, 'Didn\'t find any files.') + +# Strings should support both octal \ooo and hex \xhh encodings + +found_files_oct = [] +foreach l : find_file_list.stdout().strip('\0').split('\000') + found_files_oct += [files(l)] +endforeach + +test('first', executable('first', found_files_oct + [gen_file])) + +found_files_hex = [] +foreach l : find_file_list.stdout().strip('\x00').split('\x00') + found_files_hex += [files(l)] +endforeach + +test('second', executable('second', found_files_hex + [gen_file])) diff --git a/test cases/common/188 subdir_done/meson.build b/test cases/common/188 subdir_done/meson.build deleted file mode 100644 index 457e613b1..000000000 --- a/test cases/common/188 subdir_done/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -# Should run, even though main.cpp does not exist and we call error in the last line. -# subdir_done jumps to end, so both lines are not executed. - -project('example exit', 'cpp') - -if true - subdir_done() -endif - -executable('main', 'main.cpp') -error('Unreachable') - diff --git a/test cases/common/189 bothlibraries/libfile.c b/test cases/common/189 bothlibraries/libfile.c deleted file mode 100644 index 085ef3b87..000000000 --- a/test cases/common/189 bothlibraries/libfile.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "mylib.h" - -DO_EXPORT int retval = 42; - -DO_EXPORT int func() { - return retval; -} diff --git a/test cases/common/189 bothlibraries/main.c b/test cases/common/189 bothlibraries/main.c deleted file mode 100644 index 03a8e02b8..000000000 --- a/test cases/common/189 bothlibraries/main.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "mylib.h" - -DO_IMPORT int func(); -DO_IMPORT int retval; - -int main(int argc, char **arg) { - return func() == retval ? 0 : 1; -} diff --git a/test cases/common/189 bothlibraries/meson.build b/test cases/common/189 bothlibraries/meson.build deleted file mode 100644 index 3a13d6259..000000000 --- a/test cases/common/189 bothlibraries/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -project('both libraries linking test', 'c') - -both_libs = both_libraries('mylib', 'libfile.c') -exe_shared = executable('prog-shared', 'main.c', link_with : both_libs.get_shared_lib()) -exe_static = executable('prog-static', 'main.c', - c_args : ['-DSTATIC_COMPILATION'], - link_with : both_libs.get_static_lib()) -exe_both = executable('prog-both', 'main.c', link_with : both_libs) - -test('runtest-shared', exe_shared) -test('runtest-static', exe_static) -test('runtest-both', exe_both) diff --git a/test cases/common/189 bothlibraries/mylib.h b/test cases/common/189 bothlibraries/mylib.h deleted file mode 100644 index 1038a0142..000000000 --- a/test cases/common/189 bothlibraries/mylib.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#ifdef _WIN32 - #ifdef STATIC_COMPILATION - #define DO_IMPORT extern - #else - #define DO_IMPORT __declspec(dllimport) - #endif - #define DO_EXPORT __declspec(dllexport) -#else - #define DO_IMPORT extern - #define DO_EXPORT -#endif diff --git a/test cases/common/189 has link arg/meson.build b/test cases/common/189 has link arg/meson.build new file mode 100644 index 000000000..e166101ab --- /dev/null +++ b/test cases/common/189 has link arg/meson.build @@ -0,0 +1,44 @@ +project('has link arg', 'c', 'cpp') + +cc = meson.get_compiler('c') +cpp = meson.get_compiler('cpp') + +if cc.get_id() == 'msvc' + is_arg = '/OPT:REF' + useless = '/DEBUG' + isnt_arg = '/iambroken' +else + is_arg = '-Wl,-Lfoo' + useless = '-Wl,-Lbar' + isnt_arg = '-Wl,-iambroken' +endif + +assert(cc.has_link_argument(is_arg), 'Arg that should have worked does not work.') +assert(not cc.has_link_argument(isnt_arg), 'Arg that should be broken is not.') + +assert(cpp.has_link_argument(is_arg), 'Arg that should have worked does not work.') +assert(not cpp.has_link_argument(isnt_arg), 'Arg that should be broken is not.') + +assert(cc.get_supported_link_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') +assert(cpp.get_supported_link_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') + +# Have useless at the end to ensure that the search goes from front to back. +l1 = cc.first_supported_link_argument([isnt_arg, is_arg, isnt_arg, useless]) +l2 = cc.first_supported_link_argument(isnt_arg, isnt_arg, isnt_arg) + +assert(l1.length() == 1, 'First supported returned wrong result.') +assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') +assert(l2.length() == 0, 'First supported did not return empty array.') + +l1 = cpp.first_supported_link_argument([isnt_arg, is_arg, isnt_arg, useless]) +l2 = cpp.first_supported_link_argument(isnt_arg, isnt_arg, isnt_arg) + +assert(l1.length() == 1, 'First supported returned wrong result.') +assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') +assert(l2.length() == 0, 'First supported did not return empty array.') + +assert(not cc.has_multi_link_arguments([isnt_arg, is_arg]), 'Arg that should be broken is not.') +assert(cc.has_multi_link_arguments(is_arg), 'Arg that should have worked does not work.') +assert(cc.has_multi_link_arguments([useless, is_arg]), 'Arg that should have worked does not work.') + +assert(not cc.has_link_argument('-Wl,-z,nodelete42'), 'Did not detect wrong -z linker argument') diff --git a/test cases/common/190 escape and unicode/file.c.in b/test cases/common/190 escape and unicode/file.c.in deleted file mode 100644 index 413ed4297..000000000 --- a/test cases/common/190 escape and unicode/file.c.in +++ /dev/null @@ -1,5 +0,0 @@ -#include -const char* does_it_work() { - printf("{NAME}\n"); - return "yes it does"; -} diff --git a/test cases/common/190 escape and unicode/file.py b/test cases/common/190 escape and unicode/file.py deleted file mode 100644 index af67a0950..000000000 --- a/test cases/common/190 escape and unicode/file.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import os - -with open(sys.argv[1]) as fh: - content = fh.read().replace("{NAME}", sys.argv[2]) - -with open(os.path.join(sys.argv[3]), 'w') as fh: - fh.write(content) diff --git a/test cases/common/190 escape and unicode/find.py b/test cases/common/190 escape and unicode/find.py deleted file mode 100644 index 34a3eb835..000000000 --- a/test cases/common/190 escape and unicode/find.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -for fh in os.listdir('.'): - if os.path.isfile(fh): - if fh.endswith('.c'): - sys.stdout.write(fh + '\0') diff --git a/test cases/common/190 escape and unicode/fun.c b/test cases/common/190 escape and unicode/fun.c deleted file mode 100644 index 8eeb8ea00..000000000 --- a/test cases/common/190 escape and unicode/fun.c +++ /dev/null @@ -1,3 +0,0 @@ -int a_fun() { - return 1; -} diff --git a/test cases/common/190 escape and unicode/main.c b/test cases/common/190 escape and unicode/main.c deleted file mode 100644 index 0bcde169c..000000000 --- a/test cases/common/190 escape and unicode/main.c +++ /dev/null @@ -1,12 +0,0 @@ -#include - -const char* does_it_work(); - -int a_fun(); - -int main() { - if(strcmp(does_it_work(), "yes it does") != 0) { - return -a_fun(); - } - return 0; -} diff --git a/test cases/common/190 escape and unicode/meson.build b/test cases/common/190 escape and unicode/meson.build deleted file mode 100644 index 65377b6a3..000000000 --- a/test cases/common/190 escape and unicode/meson.build +++ /dev/null @@ -1,24 +0,0 @@ -project('180 escape', 'c') - -gen = generator(find_program('file.py'), arguments:['@INPUT@', 'erd\u0151', '@OUTPUT@'], output: '@BASENAME@') - -gen_file = gen.process('file.c.in') - -find_file_list = run_command(find_program('find.py')) -assert(find_file_list.returncode() == 0, 'Didn\'t find any files.') - -# Strings should support both octal \ooo and hex \xhh encodings - -found_files_oct = [] -foreach l : find_file_list.stdout().strip('\0').split('\000') - found_files_oct += [files(l)] -endforeach - -test('first', executable('first', found_files_oct + [gen_file])) - -found_files_hex = [] -foreach l : find_file_list.stdout().strip('\x00').split('\x00') - found_files_hex += [files(l)] -endforeach - -test('second', executable('second', found_files_hex + [gen_file])) diff --git a/test cases/common/190 same target name flat layout/foo.c b/test cases/common/190 same target name flat layout/foo.c new file mode 100644 index 000000000..ed427899a --- /dev/null +++ b/test cases/common/190 same target name flat layout/foo.c @@ -0,0 +1 @@ +int meson_test_main_foo(void) { return 10; } diff --git a/test cases/common/190 same target name flat layout/main.c b/test cases/common/190 same target name flat layout/main.c new file mode 100644 index 000000000..6f02aeb82 --- /dev/null +++ b/test cases/common/190 same target name flat layout/main.c @@ -0,0 +1,16 @@ +#include + +int meson_test_main_foo(void); +int meson_test_subproj_foo(void); + +int main(void) { + if (meson_test_main_foo() != 10) { + printf("Failed meson_test_main_foo\n"); + return 1; + } + if (meson_test_subproj_foo() != 20) { + printf("Failed meson_test_subproj_foo\n"); + return 1; + } + return 0; +} diff --git a/test cases/common/190 same target name flat layout/meson.build b/test cases/common/190 same target name flat layout/meson.build new file mode 100644 index 000000000..a3c95fa25 --- /dev/null +++ b/test cases/common/190 same target name flat layout/meson.build @@ -0,0 +1,11 @@ +project('subdir targets', 'c') + +# Idea behind this test is to create targets with identical name +# but different output files. We can do this by choosing different +# name_prefix of libraries. Target id does not depend on name_prefix. + +main_foo = static_library('foo', 'foo.c', name_prefix : 'main') +subdir('subdir') # defines subdir_foo + +exe = executable('prog', 'main.c', link_with : [main_foo, subdir_foo]) +test('main test', exe) diff --git a/test cases/common/190 same target name flat layout/subdir/foo.c b/test cases/common/190 same target name flat layout/subdir/foo.c new file mode 100644 index 000000000..f33429229 --- /dev/null +++ b/test cases/common/190 same target name flat layout/subdir/foo.c @@ -0,0 +1 @@ +int meson_test_subproj_foo(void) { return 20; } diff --git a/test cases/common/190 same target name flat layout/subdir/meson.build b/test cases/common/190 same target name flat layout/subdir/meson.build new file mode 100644 index 000000000..223a5ef90 --- /dev/null +++ b/test cases/common/190 same target name flat layout/subdir/meson.build @@ -0,0 +1 @@ +subdir_foo = static_library('foo', 'foo.c', name_prefix : 'subdir') diff --git a/test cases/common/191 find override/meson.build b/test cases/common/191 find override/meson.build new file mode 100644 index 000000000..3b8af8091 --- /dev/null +++ b/test cases/common/191 find override/meson.build @@ -0,0 +1,12 @@ +project('find program override', 'c') + +gencodegen = find_program('gencodegen', required : false) + +assert(not gencodegen.found(), 'gencodegen is an internal program, should not be found') + +# Test the check-if-found-else-override workflow +if not gencodegen.found() + subdir('subdir') +endif + +subdir('otherdir') diff --git a/test cases/common/191 find override/otherdir/main.c b/test cases/common/191 find override/otherdir/main.c new file mode 100644 index 000000000..2cef67c8d --- /dev/null +++ b/test cases/common/191 find override/otherdir/main.c @@ -0,0 +1,5 @@ +int be_seeing_you(); + +int main(int argc, char **argv) { + return be_seeing_you() == 6 ? 0 : 1; +} diff --git a/test cases/common/191 find override/otherdir/main2.c b/test cases/common/191 find override/otherdir/main2.c new file mode 100644 index 000000000..6d716882c --- /dev/null +++ b/test cases/common/191 find override/otherdir/main2.c @@ -0,0 +1,5 @@ +int number_returner(); + +int main(int argc, char **argv) { + return number_returner() == 100 ? 0 : 1; +} diff --git a/test cases/common/191 find override/otherdir/meson.build b/test cases/common/191 find override/otherdir/meson.build new file mode 100644 index 000000000..dc41f5bf7 --- /dev/null +++ b/test cases/common/191 find override/otherdir/meson.build @@ -0,0 +1,26 @@ +gen = find_program('codegen') # Should use overridden value set in "subdir". + +src = custom_target('arrival', + input : 'source.desc', + output : 'file.c', + command : [gen, '@INPUT@', '@OUTPUT@'] + ) + +e = executable('six', 'main.c', src) + +test('six', e) + +# The same again, but this time with a program that was genererated +# with configure_file. + +gen = find_program('gencodegen') + +src = custom_target('hundred', + input : 'source2.desc', + output : 'file2.c', + command : [gen, '@INPUT@', '@OUTPUT@'] + ) + +e = executable('hundred', 'main2.c', src) + +test('hundred', e) diff --git a/test cases/common/191 find override/otherdir/source.desc b/test cases/common/191 find override/otherdir/source.desc new file mode 100644 index 000000000..8b19c9c2f --- /dev/null +++ b/test cases/common/191 find override/otherdir/source.desc @@ -0,0 +1 @@ +be_seeing_you diff --git a/test cases/common/191 find override/otherdir/source2.desc b/test cases/common/191 find override/otherdir/source2.desc new file mode 100644 index 000000000..965f868df --- /dev/null +++ b/test cases/common/191 find override/otherdir/source2.desc @@ -0,0 +1 @@ +number_returner diff --git a/test cases/common/191 find override/subdir/converter.py b/test cases/common/191 find override/subdir/converter.py new file mode 100755 index 000000000..ee2ff85a3 --- /dev/null +++ b/test cases/common/191 find override/subdir/converter.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import sys +import pathlib + +[ifilename, ofilename] = sys.argv[1:3] + +ftempl = '''int %s() { + return 6; +} +''' + +d = pathlib.Path(ifilename).read_text().split('\n')[0].strip() + +pathlib.Path(ofilename).write_text(ftempl % d) diff --git a/test cases/common/191 find override/subdir/gencodegen.py.in b/test cases/common/191 find override/subdir/gencodegen.py.in new file mode 100755 index 000000000..57d9c40b4 --- /dev/null +++ b/test cases/common/191 find override/subdir/gencodegen.py.in @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import sys +import pathlib + +[ifilename, ofilename] = sys.argv[1:3] + +ftempl = '''int %s() { + return @NUMBER@; +} +''' + +d = pathlib.Path(ifilename).read_text().split('\n')[0].strip() + +pathlib.Path(ofilename).write_text(ftempl % d) diff --git a/test cases/common/191 find override/subdir/meson.build b/test cases/common/191 find override/subdir/meson.build new file mode 100644 index 000000000..e5de34dde --- /dev/null +++ b/test cases/common/191 find override/subdir/meson.build @@ -0,0 +1,14 @@ +x = find_program('converter.py') + +meson.override_find_program('codegen', x) + +# Override a command with a generated script + +cdata = configuration_data() + +cdata.set('NUMBER', 100) +numprog = configure_file(input : 'gencodegen.py.in', + output : 'gencodegen.py', + configuration : cdata) + +meson.override_find_program('gencodegen', numprog) diff --git a/test cases/common/191 has link arg/meson.build b/test cases/common/191 has link arg/meson.build deleted file mode 100644 index e166101ab..000000000 --- a/test cases/common/191 has link arg/meson.build +++ /dev/null @@ -1,44 +0,0 @@ -project('has link arg', 'c', 'cpp') - -cc = meson.get_compiler('c') -cpp = meson.get_compiler('cpp') - -if cc.get_id() == 'msvc' - is_arg = '/OPT:REF' - useless = '/DEBUG' - isnt_arg = '/iambroken' -else - is_arg = '-Wl,-Lfoo' - useless = '-Wl,-Lbar' - isnt_arg = '-Wl,-iambroken' -endif - -assert(cc.has_link_argument(is_arg), 'Arg that should have worked does not work.') -assert(not cc.has_link_argument(isnt_arg), 'Arg that should be broken is not.') - -assert(cpp.has_link_argument(is_arg), 'Arg that should have worked does not work.') -assert(not cpp.has_link_argument(isnt_arg), 'Arg that should be broken is not.') - -assert(cc.get_supported_link_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') -assert(cpp.get_supported_link_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') - -# Have useless at the end to ensure that the search goes from front to back. -l1 = cc.first_supported_link_argument([isnt_arg, is_arg, isnt_arg, useless]) -l2 = cc.first_supported_link_argument(isnt_arg, isnt_arg, isnt_arg) - -assert(l1.length() == 1, 'First supported returned wrong result.') -assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') -assert(l2.length() == 0, 'First supported did not return empty array.') - -l1 = cpp.first_supported_link_argument([isnt_arg, is_arg, isnt_arg, useless]) -l2 = cpp.first_supported_link_argument(isnt_arg, isnt_arg, isnt_arg) - -assert(l1.length() == 1, 'First supported returned wrong result.') -assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') -assert(l2.length() == 0, 'First supported did not return empty array.') - -assert(not cc.has_multi_link_arguments([isnt_arg, is_arg]), 'Arg that should be broken is not.') -assert(cc.has_multi_link_arguments(is_arg), 'Arg that should have worked does not work.') -assert(cc.has_multi_link_arguments([useless, is_arg]), 'Arg that should have worked does not work.') - -assert(not cc.has_link_argument('-Wl,-z,nodelete42'), 'Did not detect wrong -z linker argument') diff --git a/test cases/common/192 partial dependency/declare_dependency/headers/foo.c b/test cases/common/192 partial dependency/declare_dependency/headers/foo.c new file mode 100644 index 000000000..215112ca5 --- /dev/null +++ b/test cases/common/192 partial dependency/declare_dependency/headers/foo.c @@ -0,0 +1,16 @@ +/* Copyright © 2018 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#error "Included C sources that shouldn't be." diff --git a/test cases/common/192 partial dependency/declare_dependency/headers/foo.h b/test cases/common/192 partial dependency/declare_dependency/headers/foo.h new file mode 100644 index 000000000..28c81c9d3 --- /dev/null +++ b/test cases/common/192 partial dependency/declare_dependency/headers/foo.h @@ -0,0 +1,16 @@ +/* Copyright © 2018 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +int foo(void); diff --git a/test cases/common/192 partial dependency/declare_dependency/main.c b/test cases/common/192 partial dependency/declare_dependency/main.c new file mode 100644 index 000000000..e9ed0329a --- /dev/null +++ b/test cases/common/192 partial dependency/declare_dependency/main.c @@ -0,0 +1,25 @@ +/* Copyright © 2018 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "foo.h" + +int main() { + int a = foo(); + if (a == 1) { + return 0; + } else { + return 1; + } +} diff --git a/test cases/common/192 partial dependency/declare_dependency/meson.build b/test cases/common/192 partial dependency/declare_dependency/meson.build new file mode 100644 index 000000000..86e26089d --- /dev/null +++ b/test cases/common/192 partial dependency/declare_dependency/meson.build @@ -0,0 +1,28 @@ +# Copyright © 2018 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +dec_dep = declare_dependency( + sources : files('headers/foo.c'), + include_directories : include_directories('headers'), +) + +sub_dep = dec_dep.partial_dependency(includes : true) + +dec_exe = executable( + 'declare_dep', + files('main.c', 'other.c'), + dependencies : sub_dep, +) + +test('Declare Dependency', dec_exe) diff --git a/test cases/common/192 partial dependency/declare_dependency/other.c b/test cases/common/192 partial dependency/declare_dependency/other.c new file mode 100644 index 000000000..b1e199e44 --- /dev/null +++ b/test cases/common/192 partial dependency/declare_dependency/other.c @@ -0,0 +1,20 @@ +/* Copyright © 2018 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "foo.h" + +int foo(void) { + return 1; +} diff --git a/test cases/common/192 partial dependency/meson.build b/test cases/common/192 partial dependency/meson.build new file mode 100644 index 000000000..e908487f1 --- /dev/null +++ b/test cases/common/192 partial dependency/meson.build @@ -0,0 +1,17 @@ +# Copyright © 2018 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('partial dependency', ['c', 'cpp']) + +subdir('declare_dependency') diff --git a/test cases/common/192 same target name flat layout/foo.c b/test cases/common/192 same target name flat layout/foo.c deleted file mode 100644 index ed427899a..000000000 --- a/test cases/common/192 same target name flat layout/foo.c +++ /dev/null @@ -1 +0,0 @@ -int meson_test_main_foo(void) { return 10; } diff --git a/test cases/common/192 same target name flat layout/main.c b/test cases/common/192 same target name flat layout/main.c deleted file mode 100644 index 6f02aeb82..000000000 --- a/test cases/common/192 same target name flat layout/main.c +++ /dev/null @@ -1,16 +0,0 @@ -#include - -int meson_test_main_foo(void); -int meson_test_subproj_foo(void); - -int main(void) { - if (meson_test_main_foo() != 10) { - printf("Failed meson_test_main_foo\n"); - return 1; - } - if (meson_test_subproj_foo() != 20) { - printf("Failed meson_test_subproj_foo\n"); - return 1; - } - return 0; -} diff --git a/test cases/common/192 same target name flat layout/meson.build b/test cases/common/192 same target name flat layout/meson.build deleted file mode 100644 index a3c95fa25..000000000 --- a/test cases/common/192 same target name flat layout/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('subdir targets', 'c') - -# Idea behind this test is to create targets with identical name -# but different output files. We can do this by choosing different -# name_prefix of libraries. Target id does not depend on name_prefix. - -main_foo = static_library('foo', 'foo.c', name_prefix : 'main') -subdir('subdir') # defines subdir_foo - -exe = executable('prog', 'main.c', link_with : [main_foo, subdir_foo]) -test('main test', exe) diff --git a/test cases/common/192 same target name flat layout/subdir/foo.c b/test cases/common/192 same target name flat layout/subdir/foo.c deleted file mode 100644 index f33429229..000000000 --- a/test cases/common/192 same target name flat layout/subdir/foo.c +++ /dev/null @@ -1 +0,0 @@ -int meson_test_subproj_foo(void) { return 20; } diff --git a/test cases/common/192 same target name flat layout/subdir/meson.build b/test cases/common/192 same target name flat layout/subdir/meson.build deleted file mode 100644 index 223a5ef90..000000000 --- a/test cases/common/192 same target name flat layout/subdir/meson.build +++ /dev/null @@ -1 +0,0 @@ -subdir_foo = static_library('foo', 'foo.c', name_prefix : 'subdir') diff --git a/test cases/common/193 find override/meson.build b/test cases/common/193 find override/meson.build deleted file mode 100644 index 3b8af8091..000000000 --- a/test cases/common/193 find override/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -project('find program override', 'c') - -gencodegen = find_program('gencodegen', required : false) - -assert(not gencodegen.found(), 'gencodegen is an internal program, should not be found') - -# Test the check-if-found-else-override workflow -if not gencodegen.found() - subdir('subdir') -endif - -subdir('otherdir') diff --git a/test cases/common/193 find override/otherdir/main.c b/test cases/common/193 find override/otherdir/main.c deleted file mode 100644 index 2cef67c8d..000000000 --- a/test cases/common/193 find override/otherdir/main.c +++ /dev/null @@ -1,5 +0,0 @@ -int be_seeing_you(); - -int main(int argc, char **argv) { - return be_seeing_you() == 6 ? 0 : 1; -} diff --git a/test cases/common/193 find override/otherdir/main2.c b/test cases/common/193 find override/otherdir/main2.c deleted file mode 100644 index 6d716882c..000000000 --- a/test cases/common/193 find override/otherdir/main2.c +++ /dev/null @@ -1,5 +0,0 @@ -int number_returner(); - -int main(int argc, char **argv) { - return number_returner() == 100 ? 0 : 1; -} diff --git a/test cases/common/193 find override/otherdir/meson.build b/test cases/common/193 find override/otherdir/meson.build deleted file mode 100644 index dc41f5bf7..000000000 --- a/test cases/common/193 find override/otherdir/meson.build +++ /dev/null @@ -1,26 +0,0 @@ -gen = find_program('codegen') # Should use overridden value set in "subdir". - -src = custom_target('arrival', - input : 'source.desc', - output : 'file.c', - command : [gen, '@INPUT@', '@OUTPUT@'] - ) - -e = executable('six', 'main.c', src) - -test('six', e) - -# The same again, but this time with a program that was genererated -# with configure_file. - -gen = find_program('gencodegen') - -src = custom_target('hundred', - input : 'source2.desc', - output : 'file2.c', - command : [gen, '@INPUT@', '@OUTPUT@'] - ) - -e = executable('hundred', 'main2.c', src) - -test('hundred', e) diff --git a/test cases/common/193 find override/otherdir/source.desc b/test cases/common/193 find override/otherdir/source.desc deleted file mode 100644 index 8b19c9c2f..000000000 --- a/test cases/common/193 find override/otherdir/source.desc +++ /dev/null @@ -1 +0,0 @@ -be_seeing_you diff --git a/test cases/common/193 find override/otherdir/source2.desc b/test cases/common/193 find override/otherdir/source2.desc deleted file mode 100644 index 965f868df..000000000 --- a/test cases/common/193 find override/otherdir/source2.desc +++ /dev/null @@ -1 +0,0 @@ -number_returner diff --git a/test cases/common/193 find override/subdir/converter.py b/test cases/common/193 find override/subdir/converter.py deleted file mode 100755 index ee2ff85a3..000000000 --- a/test cases/common/193 find override/subdir/converter.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import pathlib - -[ifilename, ofilename] = sys.argv[1:3] - -ftempl = '''int %s() { - return 6; -} -''' - -d = pathlib.Path(ifilename).read_text().split('\n')[0].strip() - -pathlib.Path(ofilename).write_text(ftempl % d) diff --git a/test cases/common/193 find override/subdir/gencodegen.py.in b/test cases/common/193 find override/subdir/gencodegen.py.in deleted file mode 100755 index 57d9c40b4..000000000 --- a/test cases/common/193 find override/subdir/gencodegen.py.in +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import pathlib - -[ifilename, ofilename] = sys.argv[1:3] - -ftempl = '''int %s() { - return @NUMBER@; -} -''' - -d = pathlib.Path(ifilename).read_text().split('\n')[0].strip() - -pathlib.Path(ofilename).write_text(ftempl % d) diff --git a/test cases/common/193 find override/subdir/meson.build b/test cases/common/193 find override/subdir/meson.build deleted file mode 100644 index e5de34dde..000000000 --- a/test cases/common/193 find override/subdir/meson.build +++ /dev/null @@ -1,14 +0,0 @@ -x = find_program('converter.py') - -meson.override_find_program('codegen', x) - -# Override a command with a generated script - -cdata = configuration_data() - -cdata.set('NUMBER', 100) -numprog = configure_file(input : 'gencodegen.py.in', - output : 'gencodegen.py', - configuration : cdata) - -meson.override_find_program('gencodegen', numprog) diff --git a/test cases/common/193 openmp/main.c b/test cases/common/193 openmp/main.c new file mode 100644 index 000000000..cc81f4897 --- /dev/null +++ b/test cases/common/193 openmp/main.c @@ -0,0 +1,16 @@ +#include +#include + +int main(void) { +#ifdef _OPENMP + if (omp_get_max_threads() == 2) { + return 0; + } else { + printf("Max threads is %d not 2.\n", omp_get_max_threads()); + return 1; + } +#else + printf("_OPENMP is not defined; is OpenMP compilation working?\n"); + return 1; +#endif +} diff --git a/test cases/common/193 openmp/main.cpp b/test cases/common/193 openmp/main.cpp new file mode 100644 index 000000000..b12be3fd8 --- /dev/null +++ b/test cases/common/193 openmp/main.cpp @@ -0,0 +1,16 @@ +#include +#include + +int main(void) { +#ifdef _OPENMP + if (omp_get_max_threads() == 2) { + return 0; + } else { + std::cout << "Max threads is " << omp_get_max_threads() << " not 2." << std::endl; + return 1; + } +#else + printf("_OPENMP is not defined; is OpenMP compilation working?\n"); + return 1; +#endif +} diff --git a/test cases/common/193 openmp/main.f90 b/test cases/common/193 openmp/main.f90 new file mode 100644 index 000000000..c062d8691 --- /dev/null +++ b/test cases/common/193 openmp/main.f90 @@ -0,0 +1,8 @@ +program main + if (omp_get_max_threads() .eq. 2) then + stop 0 + else + print *, 'Max threads is', omp_get_max_threads(), 'not 2.' + stop 1 + endif +end program main diff --git a/test cases/common/193 openmp/meson.build b/test cases/common/193 openmp/meson.build new file mode 100644 index 000000000..a05ca59d9 --- /dev/null +++ b/test cases/common/193 openmp/meson.build @@ -0,0 +1,40 @@ +project('openmp', 'c', 'cpp') + +cc = meson.get_compiler('c') +if cc.get_id() == 'gcc' and cc.version().version_compare('<4.2.0') + error('MESON_SKIP_TEST gcc is too old to support OpenMP.') +endif +if cc.get_id() == 'clang' and cc.version().version_compare('<3.7.0') + error('MESON_SKIP_TEST clang is too old to support OpenMP.') +endif +if cc.get_id() == 'msvc' and cc.version().version_compare('<17') + error('MESON_SKIP_TEST msvc is too old to support OpenMP.') +endif +if host_machine.system() == 'darwin' + error('MESON_SKIP_TEST macOS does not support OpenMP.') +endif + +openmp = dependency('openmp') + +exec = executable('exec', + 'main.c', + dependencies : [openmp]) + +execpp = executable('execpp', + 'main.cpp', + dependencies : [openmp]) + +env = environment() +env.set('OMP_NUM_THREADS', '2') + +test('OpenMP C', exec, env : env) +test('OpenMP C++', execpp, env : env) + + +if add_languages('fortran', required : false) + exef = executable('exef', + 'main.f90', + dependencies : [openmp]) + + test('OpenMP Fortran', execpp, env : env) +endif diff --git a/test cases/common/194 partial dependency/declare_dependency/headers/foo.c b/test cases/common/194 partial dependency/declare_dependency/headers/foo.c deleted file mode 100644 index 215112ca5..000000000 --- a/test cases/common/194 partial dependency/declare_dependency/headers/foo.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright © 2018 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#error "Included C sources that shouldn't be." diff --git a/test cases/common/194 partial dependency/declare_dependency/headers/foo.h b/test cases/common/194 partial dependency/declare_dependency/headers/foo.h deleted file mode 100644 index 28c81c9d3..000000000 --- a/test cases/common/194 partial dependency/declare_dependency/headers/foo.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright © 2018 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -int foo(void); diff --git a/test cases/common/194 partial dependency/declare_dependency/main.c b/test cases/common/194 partial dependency/declare_dependency/main.c deleted file mode 100644 index e9ed0329a..000000000 --- a/test cases/common/194 partial dependency/declare_dependency/main.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright © 2018 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "foo.h" - -int main() { - int a = foo(); - if (a == 1) { - return 0; - } else { - return 1; - } -} diff --git a/test cases/common/194 partial dependency/declare_dependency/meson.build b/test cases/common/194 partial dependency/declare_dependency/meson.build deleted file mode 100644 index 86e26089d..000000000 --- a/test cases/common/194 partial dependency/declare_dependency/meson.build +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright © 2018 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -dec_dep = declare_dependency( - sources : files('headers/foo.c'), - include_directories : include_directories('headers'), -) - -sub_dep = dec_dep.partial_dependency(includes : true) - -dec_exe = executable( - 'declare_dep', - files('main.c', 'other.c'), - dependencies : sub_dep, -) - -test('Declare Dependency', dec_exe) diff --git a/test cases/common/194 partial dependency/declare_dependency/other.c b/test cases/common/194 partial dependency/declare_dependency/other.c deleted file mode 100644 index b1e199e44..000000000 --- a/test cases/common/194 partial dependency/declare_dependency/other.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright © 2018 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "foo.h" - -int foo(void) { - return 1; -} diff --git a/test cases/common/194 partial dependency/meson.build b/test cases/common/194 partial dependency/meson.build deleted file mode 100644 index e908487f1..000000000 --- a/test cases/common/194 partial dependency/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright © 2018 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('partial dependency', ['c', 'cpp']) - -subdir('declare_dependency') diff --git a/test cases/common/194 same target name/file.c b/test cases/common/194 same target name/file.c new file mode 100644 index 000000000..6f1c172d6 --- /dev/null +++ b/test cases/common/194 same target name/file.c @@ -0,0 +1,3 @@ +int func() { + return 0; +} diff --git a/test cases/common/194 same target name/meson.build b/test cases/common/194 same target name/meson.build new file mode 100644 index 000000000..4e585d56e --- /dev/null +++ b/test cases/common/194 same target name/meson.build @@ -0,0 +1,4 @@ +project('same name', 'c') + +static_library('foo', 'file.c') +subdir('sub') diff --git a/test cases/common/194 same target name/sub/file2.c b/test cases/common/194 same target name/sub/file2.c new file mode 100644 index 000000000..a5e453d2f --- /dev/null +++ b/test cases/common/194 same target name/sub/file2.c @@ -0,0 +1,3 @@ +int func() { + return 5; +} diff --git a/test cases/common/194 same target name/sub/meson.build b/test cases/common/194 same target name/sub/meson.build new file mode 100644 index 000000000..610a4a3c7 --- /dev/null +++ b/test cases/common/194 same target name/sub/meson.build @@ -0,0 +1 @@ +static_library('foo', 'file2.c') diff --git a/test cases/common/195 openmp/main.c b/test cases/common/195 openmp/main.c deleted file mode 100644 index cc81f4897..000000000 --- a/test cases/common/195 openmp/main.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -int main(void) { -#ifdef _OPENMP - if (omp_get_max_threads() == 2) { - return 0; - } else { - printf("Max threads is %d not 2.\n", omp_get_max_threads()); - return 1; - } -#else - printf("_OPENMP is not defined; is OpenMP compilation working?\n"); - return 1; -#endif -} diff --git a/test cases/common/195 openmp/main.cpp b/test cases/common/195 openmp/main.cpp deleted file mode 100644 index b12be3fd8..000000000 --- a/test cases/common/195 openmp/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -int main(void) { -#ifdef _OPENMP - if (omp_get_max_threads() == 2) { - return 0; - } else { - std::cout << "Max threads is " << omp_get_max_threads() << " not 2." << std::endl; - return 1; - } -#else - printf("_OPENMP is not defined; is OpenMP compilation working?\n"); - return 1; -#endif -} diff --git a/test cases/common/195 openmp/main.f90 b/test cases/common/195 openmp/main.f90 deleted file mode 100644 index c062d8691..000000000 --- a/test cases/common/195 openmp/main.f90 +++ /dev/null @@ -1,8 +0,0 @@ -program main - if (omp_get_max_threads() .eq. 2) then - stop 0 - else - print *, 'Max threads is', omp_get_max_threads(), 'not 2.' - stop 1 - endif -end program main diff --git a/test cases/common/195 openmp/meson.build b/test cases/common/195 openmp/meson.build deleted file mode 100644 index a05ca59d9..000000000 --- a/test cases/common/195 openmp/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -project('openmp', 'c', 'cpp') - -cc = meson.get_compiler('c') -if cc.get_id() == 'gcc' and cc.version().version_compare('<4.2.0') - error('MESON_SKIP_TEST gcc is too old to support OpenMP.') -endif -if cc.get_id() == 'clang' and cc.version().version_compare('<3.7.0') - error('MESON_SKIP_TEST clang is too old to support OpenMP.') -endif -if cc.get_id() == 'msvc' and cc.version().version_compare('<17') - error('MESON_SKIP_TEST msvc is too old to support OpenMP.') -endif -if host_machine.system() == 'darwin' - error('MESON_SKIP_TEST macOS does not support OpenMP.') -endif - -openmp = dependency('openmp') - -exec = executable('exec', - 'main.c', - dependencies : [openmp]) - -execpp = executable('execpp', - 'main.cpp', - dependencies : [openmp]) - -env = environment() -env.set('OMP_NUM_THREADS', '2') - -test('OpenMP C', exec, env : env) -test('OpenMP C++', execpp, env : env) - - -if add_languages('fortran', required : false) - exef = executable('exef', - 'main.f90', - dependencies : [openmp]) - - test('OpenMP Fortran', execpp, env : env) -endif diff --git a/test cases/common/195 test depends/gen.py b/test cases/common/195 test depends/gen.py new file mode 100755 index 000000000..ee4ed9818 --- /dev/null +++ b/test cases/common/195 test depends/gen.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sys + + +def main(): + with open(sys.argv[1], 'w') as out: + out.write(sys.argv[2]) + out.write('\n') + + +if __name__ == '__main__': + main() diff --git a/test cases/common/195 test depends/main.c b/test cases/common/195 test depends/main.c new file mode 100644 index 000000000..78f2de106 --- /dev/null +++ b/test cases/common/195 test depends/main.c @@ -0,0 +1 @@ +int main(void) { return 0; } diff --git a/test cases/common/195 test depends/meson.build b/test cases/common/195 test depends/meson.build new file mode 100644 index 000000000..888c45118 --- /dev/null +++ b/test cases/common/195 test depends/meson.build @@ -0,0 +1,26 @@ +project('test depends', 'c') + +gen = find_program('gen.py') + +custom_dep = custom_target('custom_dep', + build_by_default : false, + output : 'custom_dep.txt', + command : [gen, '@OUTPUT@', 'custom_dep'], +) + +exe_dep = executable('exe_dep', 'main.c', + build_by_default : false, +) + +test_prog = find_program('test.py') +test('string dependencies', test_prog, + args : [ + # This is declared for convenience, + # real use case might have some obscure method + # to find these dependencies, e.g. automatic plugin loading. + 'custom_dep.txt', + exe_dep.full_path(), + ], + depends : [custom_dep, exe_dep], + workdir : meson.current_build_dir(), +) diff --git a/test cases/common/195 test depends/test.py b/test cases/common/195 test depends/test.py new file mode 100755 index 000000000..5b9f65c86 --- /dev/null +++ b/test cases/common/195 test depends/test.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +import os +import os.path +import sys + + +def main(): + print('Looking in:', os.getcwd()) + not_found = list() + for f in sys.argv[1:]: + if not os.path.exists(f): + not_found.append(f) + if not_found: + print('Not found:', ', '.join(not_found)) + sys.exit(1) + + +if __name__ == '__main__': + main() diff --git a/test cases/common/196 args flattening/meson.build b/test cases/common/196 args flattening/meson.build new file mode 100644 index 000000000..6da2e8f25 --- /dev/null +++ b/test cases/common/196 args flattening/meson.build @@ -0,0 +1,29 @@ +project('args flattening') + +arr = get_variable('does-not-exist', ['bar', 'baz']) + +assert(arr == ['bar', 'baz'], 'get_variable with array fallback is broken') + +set_variable('arr', ['bar', 'baz']) + +assert(arr == ['bar', 'baz'], 'set_variable(array) is broken') + +conf = configuration_data() + +conf.set('foo', ['bar', 'baz']) + +assert(conf.get('foo') == ['bar', 'baz'], 'configuration_data.set(array) is broken') + +arr = conf.get('does-not-exist', ['bar', 'baz']) + +assert(arr == ['bar', 'baz'], 'configuration_data.get with array fallback is broken') + +arr = meson.get_cross_property('does-not-exist', ['bar', 'baz']) + +assert(arr == ['bar', 'baz'], 'meson.get_cross_property with array fallback is broken') + +# Test deprecated behaviour + +conf.set(['foo', 'bar']) + +message(conf.get('foo')) diff --git a/test cases/common/196 same target name/file.c b/test cases/common/196 same target name/file.c deleted file mode 100644 index 6f1c172d6..000000000 --- a/test cases/common/196 same target name/file.c +++ /dev/null @@ -1,3 +0,0 @@ -int func() { - return 0; -} diff --git a/test cases/common/196 same target name/meson.build b/test cases/common/196 same target name/meson.build deleted file mode 100644 index 4e585d56e..000000000 --- a/test cases/common/196 same target name/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('same name', 'c') - -static_library('foo', 'file.c') -subdir('sub') diff --git a/test cases/common/196 same target name/sub/file2.c b/test cases/common/196 same target name/sub/file2.c deleted file mode 100644 index a5e453d2f..000000000 --- a/test cases/common/196 same target name/sub/file2.c +++ /dev/null @@ -1,3 +0,0 @@ -int func() { - return 5; -} diff --git a/test cases/common/196 same target name/sub/meson.build b/test cases/common/196 same target name/sub/meson.build deleted file mode 100644 index 610a4a3c7..000000000 --- a/test cases/common/196 same target name/sub/meson.build +++ /dev/null @@ -1 +0,0 @@ -static_library('foo', 'file2.c') diff --git a/test cases/common/197 dict/meson.build b/test cases/common/197 dict/meson.build new file mode 100644 index 000000000..e1ee2e33b --- /dev/null +++ b/test cases/common/197 dict/meson.build @@ -0,0 +1,23 @@ +project('dict test', 'c') + +dict = {'foo' : 'bar', + 'baz' : 'foo', + 'foo bar': 'baz'} + +exe = executable('prog', sources : ['prog.c']) + +i = 0 + +foreach key, value : dict + test('dict test @0@'.format(key), exe, + args : [dict[key], value]) + i += 1 +endforeach + +assert(i == 3, 'There should be three elements in that dictionary') + +empty_dict = {} + +foreach key, value : empty_dict + assert(false, 'This dict should be empty') +endforeach diff --git a/test cases/common/197 dict/prog.c b/test cases/common/197 dict/prog.c new file mode 100644 index 000000000..bf0999d4a --- /dev/null +++ b/test cases/common/197 dict/prog.c @@ -0,0 +1,8 @@ +#include + +int main(int argc, char **argv) { + if (argc != 3) + return 1; + + return strcmp(argv[1], argv[2]); +} diff --git a/test cases/common/197 test depends/gen.py b/test cases/common/197 test depends/gen.py deleted file mode 100755 index ee4ed9818..000000000 --- a/test cases/common/197 test depends/gen.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python3 - -import sys - - -def main(): - with open(sys.argv[1], 'w') as out: - out.write(sys.argv[2]) - out.write('\n') - - -if __name__ == '__main__': - main() diff --git a/test cases/common/197 test depends/main.c b/test cases/common/197 test depends/main.c deleted file mode 100644 index 78f2de106..000000000 --- a/test cases/common/197 test depends/main.c +++ /dev/null @@ -1 +0,0 @@ -int main(void) { return 0; } diff --git a/test cases/common/197 test depends/meson.build b/test cases/common/197 test depends/meson.build deleted file mode 100644 index 888c45118..000000000 --- a/test cases/common/197 test depends/meson.build +++ /dev/null @@ -1,26 +0,0 @@ -project('test depends', 'c') - -gen = find_program('gen.py') - -custom_dep = custom_target('custom_dep', - build_by_default : false, - output : 'custom_dep.txt', - command : [gen, '@OUTPUT@', 'custom_dep'], -) - -exe_dep = executable('exe_dep', 'main.c', - build_by_default : false, -) - -test_prog = find_program('test.py') -test('string dependencies', test_prog, - args : [ - # This is declared for convenience, - # real use case might have some obscure method - # to find these dependencies, e.g. automatic plugin loading. - 'custom_dep.txt', - exe_dep.full_path(), - ], - depends : [custom_dep, exe_dep], - workdir : meson.current_build_dir(), -) diff --git a/test cases/common/197 test depends/test.py b/test cases/common/197 test depends/test.py deleted file mode 100755 index 5b9f65c86..000000000 --- a/test cases/common/197 test depends/test.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 - -import os -import os.path -import sys - - -def main(): - print('Looking in:', os.getcwd()) - not_found = list() - for f in sys.argv[1:]: - if not os.path.exists(f): - not_found.append(f) - if not_found: - print('Not found:', ', '.join(not_found)) - sys.exit(1) - - -if __name__ == '__main__': - main() diff --git a/test cases/common/198 args flattening/meson.build b/test cases/common/198 args flattening/meson.build deleted file mode 100644 index 6da2e8f25..000000000 --- a/test cases/common/198 args flattening/meson.build +++ /dev/null @@ -1,29 +0,0 @@ -project('args flattening') - -arr = get_variable('does-not-exist', ['bar', 'baz']) - -assert(arr == ['bar', 'baz'], 'get_variable with array fallback is broken') - -set_variable('arr', ['bar', 'baz']) - -assert(arr == ['bar', 'baz'], 'set_variable(array) is broken') - -conf = configuration_data() - -conf.set('foo', ['bar', 'baz']) - -assert(conf.get('foo') == ['bar', 'baz'], 'configuration_data.set(array) is broken') - -arr = conf.get('does-not-exist', ['bar', 'baz']) - -assert(arr == ['bar', 'baz'], 'configuration_data.get with array fallback is broken') - -arr = meson.get_cross_property('does-not-exist', ['bar', 'baz']) - -assert(arr == ['bar', 'baz'], 'meson.get_cross_property with array fallback is broken') - -# Test deprecated behaviour - -conf.set(['foo', 'bar']) - -message(conf.get('foo')) diff --git a/test cases/common/198 check header/meson.build b/test cases/common/198 check header/meson.build new file mode 100644 index 000000000..7b343d7e3 --- /dev/null +++ b/test cases/common/198 check header/meson.build @@ -0,0 +1,48 @@ +project('check header', 'c', 'cpp') + +host_system = host_machine.system() + +non_existant_header = 'ouagadougou.h' + +# Copy it into the builddir to ensure that it isn't found even if it's there +configure_file(input : non_existant_header, + output : non_existant_header, + copy: true) + +fallback = '' + +foreach comp : [meson.get_compiler('c'), meson.get_compiler('cpp')] + assert(comp.check_header('stdio.h', prefix : fallback), 'Stdio missing.') + + # stdio.h doesn't actually need stdlib.h, but just test that setting the + # prefix does not result in an error. + assert(comp.check_header('stdio.h', prefix : '#include ' + fallback), + 'Stdio missing.') + + # Test that check_header behaves differently than has_header. The second + # check without windows.h will fail with check_header. + # We only do this check on MSVC because MinGW often defines its own wrappers + # that pre-include windows.h + if comp.get_id() == 'msvc' + assert(comp.check_header('XInput.h', prefix : '#include ' + fallback), + 'XInput.h should not be missing on Windows') + assert(not comp.check_header('XInput.h'), 'XInput.h needs windows.h') + endif + + # Test that the following GCC bug doesn't happen: + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005 + # https://github.com/mesonbuild/meson/issues/1458 + if host_system == 'linux' + assert(comp.check_header('linux/if.h', prefix : fallback), + 'Could not find ') + if comp.has_header('intrin.h', prefix : fallback) + assert(not comp.check_header('intrin.h'), + 'intrin.h should not be usable on linux') + endif + endif + + # This header exists in the source and the builddir, but we still must not + # find it since we are looking in the system directories. + assert(not comp.check_header(non_existant_header, prefix : fallback), + 'Found non-existant header.') +endforeach diff --git a/test cases/common/198 check header/ouagadougou.h b/test cases/common/198 check header/ouagadougou.h new file mode 100644 index 000000000..2f76c49cc --- /dev/null +++ b/test cases/common/198 check header/ouagadougou.h @@ -0,0 +1 @@ +#define OMG_THIS_SHOULDNT_BE_FOUND diff --git a/test cases/common/199 dict/meson.build b/test cases/common/199 dict/meson.build deleted file mode 100644 index e1ee2e33b..000000000 --- a/test cases/common/199 dict/meson.build +++ /dev/null @@ -1,23 +0,0 @@ -project('dict test', 'c') - -dict = {'foo' : 'bar', - 'baz' : 'foo', - 'foo bar': 'baz'} - -exe = executable('prog', sources : ['prog.c']) - -i = 0 - -foreach key, value : dict - test('dict test @0@'.format(key), exe, - args : [dict[key], value]) - i += 1 -endforeach - -assert(i == 3, 'There should be three elements in that dictionary') - -empty_dict = {} - -foreach key, value : empty_dict - assert(false, 'This dict should be empty') -endforeach diff --git a/test cases/common/199 dict/prog.c b/test cases/common/199 dict/prog.c deleted file mode 100644 index bf0999d4a..000000000 --- a/test cases/common/199 dict/prog.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main(int argc, char **argv) { - if (argc != 3) - return 1; - - return strcmp(argv[1], argv[2]); -} diff --git a/test cases/common/199 install_mode/config.h.in b/test cases/common/199 install_mode/config.h.in new file mode 100644 index 000000000..14a155874 --- /dev/null +++ b/test cases/common/199 install_mode/config.h.in @@ -0,0 +1,5 @@ +#define MESSAGE "@var@" +#define OTHER "@other@" "@second@" "@empty@" + +#mesondefine BE_TRUE +#mesondefine SHOULD_BE_UNDEF diff --git a/test cases/common/199 install_mode/data_source.txt b/test cases/common/199 install_mode/data_source.txt new file mode 100644 index 000000000..0c23cc0c3 --- /dev/null +++ b/test cases/common/199 install_mode/data_source.txt @@ -0,0 +1 @@ +This is a text only input file. diff --git a/test cases/common/199 install_mode/foo.1 b/test cases/common/199 install_mode/foo.1 new file mode 100644 index 000000000..647c0970c --- /dev/null +++ b/test cases/common/199 install_mode/foo.1 @@ -0,0 +1 @@ +this is a man page of foo.1 its contents are irrelevant diff --git a/test cases/common/199 install_mode/installed_files.txt b/test cases/common/199 install_mode/installed_files.txt new file mode 100644 index 000000000..00fb231e7 --- /dev/null +++ b/test cases/common/199 install_mode/installed_files.txt @@ -0,0 +1,8 @@ +usr/bin/runscript.sh +usr/bin/trivialprog?exe +usr/include/config.h +usr/include/rootdir.h +usr/libtest/libstat.a +usr/share/man/man1/foo.1.gz +usr/share/sub1/second.dat +usr/subdir/data.dat diff --git a/test cases/common/199 install_mode/meson.build b/test cases/common/199 install_mode/meson.build new file mode 100644 index 000000000..d06371f84 --- /dev/null +++ b/test cases/common/199 install_mode/meson.build @@ -0,0 +1,52 @@ +project('install_mode test', 'c', + default_options : ['install_umask=027', 'libdir=libtest']) + +# confirm no regressions in install_data +install_data('runscript.sh', + install_dir : get_option('bindir'), + install_mode : ['rwxr-sr-x', 'root', 0]) + +# confirm no regressions in install_subdir +install_subdir('sub1', + install_dir : 'share', + install_mode : ['rwxr-x--t', 'root']) + +# test install_mode in configure_file +conf = configuration_data() +conf.set('var', 'mystring') +conf.set('other', 'string 2') +conf.set('second', ' bonus') +conf.set('BE_TRUE', true) +configure_file(input : 'config.h.in', + output : 'config.h', + configuration : conf, + install_dir : 'include', + install_mode : 'rw-rwSr--') + +# test install_mode in custom_target +custom_target('bindat', + output : 'data.dat', + input : 'data_source.txt', + command : ['cp', '@INPUT@', '@OUTPUT@'], + install : true, + install_dir : 'subdir', + install_mode : 'rw-rwSr--') + +# test install_mode in install_headers +install_headers('rootdir.h', + install_mode : 'r--r--r-T') + +# test install_mode in install_man +install_man('foo.1', + install_mode : 'r--r--r-T') + +# test install_mode in executable +executable('trivialprog', + sources : 'trivial.c', + install : true, + install_mode : ['rwxr-sr-x', 'root', 'root']) + +# test install_mode in static_library +static_library('stat', 'stat.c', + install : true, + install_mode : ['rw---Sr--']) diff --git a/test cases/common/199 install_mode/rootdir.h b/test cases/common/199 install_mode/rootdir.h new file mode 100644 index 000000000..72fb13220 --- /dev/null +++ b/test cases/common/199 install_mode/rootdir.h @@ -0,0 +1,3 @@ +/* This header goes to include dir root. */ + +int root_func(); diff --git a/test cases/common/199 install_mode/runscript.sh b/test cases/common/199 install_mode/runscript.sh new file mode 100644 index 000000000..8bc5ca6ce --- /dev/null +++ b/test cases/common/199 install_mode/runscript.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Runscript" diff --git a/test cases/common/199 install_mode/stat.c b/test cases/common/199 install_mode/stat.c new file mode 100644 index 000000000..fa76a658f --- /dev/null +++ b/test cases/common/199 install_mode/stat.c @@ -0,0 +1 @@ +int func() { return 933; } diff --git a/test cases/common/199 install_mode/sub1/second.dat b/test cases/common/199 install_mode/sub1/second.dat new file mode 100644 index 000000000..48857a8b6 --- /dev/null +++ b/test cases/common/199 install_mode/sub1/second.dat @@ -0,0 +1 @@ +Test that multiple install_subdirs meld their results. \ No newline at end of file diff --git a/test cases/common/199 install_mode/trivial.c b/test cases/common/199 install_mode/trivial.c new file mode 100644 index 000000000..24ac454c3 --- /dev/null +++ b/test cases/common/199 install_mode/trivial.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("Trivial test is working.\n"); + return 0; +} diff --git a/test cases/common/200 check header/meson.build b/test cases/common/200 check header/meson.build deleted file mode 100644 index 7b343d7e3..000000000 --- a/test cases/common/200 check header/meson.build +++ /dev/null @@ -1,48 +0,0 @@ -project('check header', 'c', 'cpp') - -host_system = host_machine.system() - -non_existant_header = 'ouagadougou.h' - -# Copy it into the builddir to ensure that it isn't found even if it's there -configure_file(input : non_existant_header, - output : non_existant_header, - copy: true) - -fallback = '' - -foreach comp : [meson.get_compiler('c'), meson.get_compiler('cpp')] - assert(comp.check_header('stdio.h', prefix : fallback), 'Stdio missing.') - - # stdio.h doesn't actually need stdlib.h, but just test that setting the - # prefix does not result in an error. - assert(comp.check_header('stdio.h', prefix : '#include ' + fallback), - 'Stdio missing.') - - # Test that check_header behaves differently than has_header. The second - # check without windows.h will fail with check_header. - # We only do this check on MSVC because MinGW often defines its own wrappers - # that pre-include windows.h - if comp.get_id() == 'msvc' - assert(comp.check_header('XInput.h', prefix : '#include ' + fallback), - 'XInput.h should not be missing on Windows') - assert(not comp.check_header('XInput.h'), 'XInput.h needs windows.h') - endif - - # Test that the following GCC bug doesn't happen: - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005 - # https://github.com/mesonbuild/meson/issues/1458 - if host_system == 'linux' - assert(comp.check_header('linux/if.h', prefix : fallback), - 'Could not find ') - if comp.has_header('intrin.h', prefix : fallback) - assert(not comp.check_header('intrin.h'), - 'intrin.h should not be usable on linux') - endif - endif - - # This header exists in the source and the builddir, but we still must not - # find it since we are looking in the system directories. - assert(not comp.check_header(non_existant_header, prefix : fallback), - 'Found non-existant header.') -endforeach diff --git a/test cases/common/200 check header/ouagadougou.h b/test cases/common/200 check header/ouagadougou.h deleted file mode 100644 index 2f76c49cc..000000000 --- a/test cases/common/200 check header/ouagadougou.h +++ /dev/null @@ -1 +0,0 @@ -#define OMG_THIS_SHOULDNT_BE_FOUND diff --git a/test cases/common/200 subproject array version/meson.build b/test cases/common/200 subproject array version/meson.build new file mode 100644 index 000000000..0870bc498 --- /dev/null +++ b/test cases/common/200 subproject array version/meson.build @@ -0,0 +1,3 @@ +project('master', 'c') + +x = subproject('foo', version : ['>=1.0.0', '<2.0']) diff --git a/test cases/common/200 subproject array version/subprojects/foo/meson.build b/test cases/common/200 subproject array version/subprojects/foo/meson.build new file mode 100644 index 000000000..f4ff53548 --- /dev/null +++ b/test cases/common/200 subproject array version/subprojects/foo/meson.build @@ -0,0 +1 @@ +project('foo', 'c', version : '1.0.0') diff --git a/test cases/common/201 feature option/meson.build b/test cases/common/201 feature option/meson.build new file mode 100644 index 000000000..ef3fa2285 --- /dev/null +++ b/test cases/common/201 feature option/meson.build @@ -0,0 +1,47 @@ +project('feature user option', 'c') + +feature_opts = get_option('auto_features') +required_opt = get_option('required') +optional_opt = get_option('optional') +disabled_opt = get_option('disabled') + +assert(not feature_opts.enabled(), 'Should be auto option') +assert(not feature_opts.disabled(), 'Should be auto option') +assert(feature_opts.auto(), 'Should be auto option') + +assert(required_opt.enabled(), 'Should be enabled option') +assert(not required_opt.disabled(), 'Should be enabled option') +assert(not required_opt.auto(), 'Should be enabled option') + +assert(not optional_opt.enabled(), 'Should be auto option') +assert(not optional_opt.disabled(), 'Should be auto option') +assert(optional_opt.auto(), 'Should be auto option') + +assert(not disabled_opt.enabled(), 'Should be disabled option') +assert(disabled_opt.disabled(), 'Should be disabled option') +assert(not disabled_opt.auto(), 'Should be disabled option') + +dep = dependency('threads', required : required_opt) +assert(dep.found(), 'Should find required "threads" dep') + +dep = dependency('threads', required : optional_opt) +assert(dep.found(), 'Should find optional "threads" dep') + +dep = dependency('threads', required : disabled_opt) +assert(not dep.found(), 'Should not find disabled "threads" dep') + +dep = dependency('notfounddep', required : optional_opt) +assert(not dep.found(), 'Should not find optional "notfounddep" dep') + +dep = dependency('notfounddep', required : disabled_opt) +assert(not dep.found(), 'Should not find disabled "notfounddep" dep') + +cc = meson.get_compiler('c') +lib = cc.find_library('m', required : disabled_opt) +assert(not lib.found(), 'Should not find "m" library') + +cp = find_program('cp', required : disabled_opt) +assert(not cp.found(), 'Should not find "cp" program') + +found = add_languages('cpp', required : disabled_opt) +assert(not found, 'Should not find "cpp" language') diff --git a/test cases/common/201 feature option/meson_options.txt b/test cases/common/201 feature option/meson_options.txt new file mode 100644 index 000000000..063a35f39 --- /dev/null +++ b/test cases/common/201 feature option/meson_options.txt @@ -0,0 +1,3 @@ +option('required', type : 'feature', value : 'enabled', description : 'An required feature') +option('optional', type : 'feature', value : 'auto', description : 'An optional feature') +option('disabled', type : 'feature', value : 'disabled', description : 'A disabled feature') diff --git a/test cases/common/201 install_mode/config.h.in b/test cases/common/201 install_mode/config.h.in deleted file mode 100644 index 14a155874..000000000 --- a/test cases/common/201 install_mode/config.h.in +++ /dev/null @@ -1,5 +0,0 @@ -#define MESSAGE "@var@" -#define OTHER "@other@" "@second@" "@empty@" - -#mesondefine BE_TRUE -#mesondefine SHOULD_BE_UNDEF diff --git a/test cases/common/201 install_mode/data_source.txt b/test cases/common/201 install_mode/data_source.txt deleted file mode 100644 index 0c23cc0c3..000000000 --- a/test cases/common/201 install_mode/data_source.txt +++ /dev/null @@ -1 +0,0 @@ -This is a text only input file. diff --git a/test cases/common/201 install_mode/foo.1 b/test cases/common/201 install_mode/foo.1 deleted file mode 100644 index 647c0970c..000000000 --- a/test cases/common/201 install_mode/foo.1 +++ /dev/null @@ -1 +0,0 @@ -this is a man page of foo.1 its contents are irrelevant diff --git a/test cases/common/201 install_mode/installed_files.txt b/test cases/common/201 install_mode/installed_files.txt deleted file mode 100644 index 00fb231e7..000000000 --- a/test cases/common/201 install_mode/installed_files.txt +++ /dev/null @@ -1,8 +0,0 @@ -usr/bin/runscript.sh -usr/bin/trivialprog?exe -usr/include/config.h -usr/include/rootdir.h -usr/libtest/libstat.a -usr/share/man/man1/foo.1.gz -usr/share/sub1/second.dat -usr/subdir/data.dat diff --git a/test cases/common/201 install_mode/meson.build b/test cases/common/201 install_mode/meson.build deleted file mode 100644 index d06371f84..000000000 --- a/test cases/common/201 install_mode/meson.build +++ /dev/null @@ -1,52 +0,0 @@ -project('install_mode test', 'c', - default_options : ['install_umask=027', 'libdir=libtest']) - -# confirm no regressions in install_data -install_data('runscript.sh', - install_dir : get_option('bindir'), - install_mode : ['rwxr-sr-x', 'root', 0]) - -# confirm no regressions in install_subdir -install_subdir('sub1', - install_dir : 'share', - install_mode : ['rwxr-x--t', 'root']) - -# test install_mode in configure_file -conf = configuration_data() -conf.set('var', 'mystring') -conf.set('other', 'string 2') -conf.set('second', ' bonus') -conf.set('BE_TRUE', true) -configure_file(input : 'config.h.in', - output : 'config.h', - configuration : conf, - install_dir : 'include', - install_mode : 'rw-rwSr--') - -# test install_mode in custom_target -custom_target('bindat', - output : 'data.dat', - input : 'data_source.txt', - command : ['cp', '@INPUT@', '@OUTPUT@'], - install : true, - install_dir : 'subdir', - install_mode : 'rw-rwSr--') - -# test install_mode in install_headers -install_headers('rootdir.h', - install_mode : 'r--r--r-T') - -# test install_mode in install_man -install_man('foo.1', - install_mode : 'r--r--r-T') - -# test install_mode in executable -executable('trivialprog', - sources : 'trivial.c', - install : true, - install_mode : ['rwxr-sr-x', 'root', 'root']) - -# test install_mode in static_library -static_library('stat', 'stat.c', - install : true, - install_mode : ['rw---Sr--']) diff --git a/test cases/common/201 install_mode/rootdir.h b/test cases/common/201 install_mode/rootdir.h deleted file mode 100644 index 72fb13220..000000000 --- a/test cases/common/201 install_mode/rootdir.h +++ /dev/null @@ -1,3 +0,0 @@ -/* This header goes to include dir root. */ - -int root_func(); diff --git a/test cases/common/201 install_mode/runscript.sh b/test cases/common/201 install_mode/runscript.sh deleted file mode 100644 index 8bc5ca6ce..000000000 --- a/test cases/common/201 install_mode/runscript.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -echo "Runscript" diff --git a/test cases/common/201 install_mode/stat.c b/test cases/common/201 install_mode/stat.c deleted file mode 100644 index fa76a658f..000000000 --- a/test cases/common/201 install_mode/stat.c +++ /dev/null @@ -1 +0,0 @@ -int func() { return 933; } diff --git a/test cases/common/201 install_mode/sub1/second.dat b/test cases/common/201 install_mode/sub1/second.dat deleted file mode 100644 index 48857a8b6..000000000 --- a/test cases/common/201 install_mode/sub1/second.dat +++ /dev/null @@ -1 +0,0 @@ -Test that multiple install_subdirs meld their results. \ No newline at end of file diff --git a/test cases/common/201 install_mode/trivial.c b/test cases/common/201 install_mode/trivial.c deleted file mode 100644 index 24ac454c3..000000000 --- a/test cases/common/201 install_mode/trivial.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("Trivial test is working.\n"); - return 0; -} diff --git a/test cases/common/202 feature option disabled/meson.build b/test cases/common/202 feature option disabled/meson.build new file mode 100644 index 000000000..1a831872a --- /dev/null +++ b/test cases/common/202 feature option disabled/meson.build @@ -0,0 +1,23 @@ +project('feature user option', 'c', + default_options : ['auto_features=disabled']) + +feature_opts = get_option('auto_features') +required_opt = get_option('required') +optional_opt = get_option('optional') +disabled_opt = get_option('disabled') + +assert(not feature_opts.enabled(), 'Should be disabled option') +assert(feature_opts.disabled(), 'Should be disabled option') +assert(not feature_opts.auto(), 'Should be disabled option') + +assert(required_opt.enabled(), 'Should be enabled option') +assert(not required_opt.disabled(), 'Should be enabled option') +assert(not required_opt.auto(), 'Should be enabled option') + +assert(not optional_opt.enabled(), 'Auto feature should be disabled') +assert(optional_opt.disabled(), 'Auto feature should be disabled') +assert(not optional_opt.auto(), 'Auto feature should be disabled') + +assert(not disabled_opt.enabled(), 'Should be disabled option') +assert(disabled_opt.disabled(), 'Should be disabled option') +assert(not disabled_opt.auto(), 'Should be disabled option') diff --git a/test cases/common/202 feature option disabled/meson_options.txt b/test cases/common/202 feature option disabled/meson_options.txt new file mode 100644 index 000000000..063a35f39 --- /dev/null +++ b/test cases/common/202 feature option disabled/meson_options.txt @@ -0,0 +1,3 @@ +option('required', type : 'feature', value : 'enabled', description : 'An required feature') +option('optional', type : 'feature', value : 'auto', description : 'An optional feature') +option('disabled', type : 'feature', value : 'disabled', description : 'A disabled feature') diff --git a/test cases/common/202 subproject array version/meson.build b/test cases/common/202 subproject array version/meson.build deleted file mode 100644 index 0870bc498..000000000 --- a/test cases/common/202 subproject array version/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('master', 'c') - -x = subproject('foo', version : ['>=1.0.0', '<2.0']) diff --git a/test cases/common/202 subproject array version/subprojects/foo/meson.build b/test cases/common/202 subproject array version/subprojects/foo/meson.build deleted file mode 100644 index f4ff53548..000000000 --- a/test cases/common/202 subproject array version/subprojects/foo/meson.build +++ /dev/null @@ -1 +0,0 @@ -project('foo', 'c', version : '1.0.0') diff --git a/test cases/common/203 feature option/meson.build b/test cases/common/203 feature option/meson.build deleted file mode 100644 index ef3fa2285..000000000 --- a/test cases/common/203 feature option/meson.build +++ /dev/null @@ -1,47 +0,0 @@ -project('feature user option', 'c') - -feature_opts = get_option('auto_features') -required_opt = get_option('required') -optional_opt = get_option('optional') -disabled_opt = get_option('disabled') - -assert(not feature_opts.enabled(), 'Should be auto option') -assert(not feature_opts.disabled(), 'Should be auto option') -assert(feature_opts.auto(), 'Should be auto option') - -assert(required_opt.enabled(), 'Should be enabled option') -assert(not required_opt.disabled(), 'Should be enabled option') -assert(not required_opt.auto(), 'Should be enabled option') - -assert(not optional_opt.enabled(), 'Should be auto option') -assert(not optional_opt.disabled(), 'Should be auto option') -assert(optional_opt.auto(), 'Should be auto option') - -assert(not disabled_opt.enabled(), 'Should be disabled option') -assert(disabled_opt.disabled(), 'Should be disabled option') -assert(not disabled_opt.auto(), 'Should be disabled option') - -dep = dependency('threads', required : required_opt) -assert(dep.found(), 'Should find required "threads" dep') - -dep = dependency('threads', required : optional_opt) -assert(dep.found(), 'Should find optional "threads" dep') - -dep = dependency('threads', required : disabled_opt) -assert(not dep.found(), 'Should not find disabled "threads" dep') - -dep = dependency('notfounddep', required : optional_opt) -assert(not dep.found(), 'Should not find optional "notfounddep" dep') - -dep = dependency('notfounddep', required : disabled_opt) -assert(not dep.found(), 'Should not find disabled "notfounddep" dep') - -cc = meson.get_compiler('c') -lib = cc.find_library('m', required : disabled_opt) -assert(not lib.found(), 'Should not find "m" library') - -cp = find_program('cp', required : disabled_opt) -assert(not cp.found(), 'Should not find "cp" program') - -found = add_languages('cpp', required : disabled_opt) -assert(not found, 'Should not find "cpp" language') diff --git a/test cases/common/203 feature option/meson_options.txt b/test cases/common/203 feature option/meson_options.txt deleted file mode 100644 index 063a35f39..000000000 --- a/test cases/common/203 feature option/meson_options.txt +++ /dev/null @@ -1,3 +0,0 @@ -option('required', type : 'feature', value : 'enabled', description : 'An required feature') -option('optional', type : 'feature', value : 'auto', description : 'An optional feature') -option('disabled', type : 'feature', value : 'disabled', description : 'A disabled feature') diff --git a/test cases/common/203 static threads/lib1.c b/test cases/common/203 static threads/lib1.c new file mode 100644 index 000000000..1aa786c66 --- /dev/null +++ b/test cases/common/203 static threads/lib1.c @@ -0,0 +1,13 @@ +#if defined _WIN32 +#include +#else +#include +#endif + +void *f(void) { +#if defined _WIN32 + return CreateThread; +#else + return pthread_create; +#endif +} diff --git a/test cases/common/203 static threads/lib2.c b/test cases/common/203 static threads/lib2.c new file mode 100644 index 000000000..e988814e2 --- /dev/null +++ b/test cases/common/203 static threads/lib2.c @@ -0,0 +1,5 @@ +extern void *f(void); + +void *g(void) { + return f(); +} diff --git a/test cases/common/203 static threads/meson.build b/test cases/common/203 static threads/meson.build new file mode 100644 index 000000000..427920034 --- /dev/null +++ b/test cases/common/203 static threads/meson.build @@ -0,0 +1,13 @@ +project('threads', 'c') + +thread_dep = dependency('threads') + + +lib1 = static_library('lib1', 'lib1.c', + dependencies : thread_dep) + +lib2 = static_library('lib2', 'lib2.c', + link_with : lib1) + +executable('prog', 'prog.c', + link_with : lib2) diff --git a/test cases/common/203 static threads/prog.c b/test cases/common/203 static threads/prog.c new file mode 100644 index 000000000..14a7c760f --- /dev/null +++ b/test cases/common/203 static threads/prog.c @@ -0,0 +1,6 @@ +extern void *g(void); + +int main(void) { + g(); + return 0; +} diff --git a/test cases/common/204 feature option disabled/meson.build b/test cases/common/204 feature option disabled/meson.build deleted file mode 100644 index 1a831872a..000000000 --- a/test cases/common/204 feature option disabled/meson.build +++ /dev/null @@ -1,23 +0,0 @@ -project('feature user option', 'c', - default_options : ['auto_features=disabled']) - -feature_opts = get_option('auto_features') -required_opt = get_option('required') -optional_opt = get_option('optional') -disabled_opt = get_option('disabled') - -assert(not feature_opts.enabled(), 'Should be disabled option') -assert(feature_opts.disabled(), 'Should be disabled option') -assert(not feature_opts.auto(), 'Should be disabled option') - -assert(required_opt.enabled(), 'Should be enabled option') -assert(not required_opt.disabled(), 'Should be enabled option') -assert(not required_opt.auto(), 'Should be enabled option') - -assert(not optional_opt.enabled(), 'Auto feature should be disabled') -assert(optional_opt.disabled(), 'Auto feature should be disabled') -assert(not optional_opt.auto(), 'Auto feature should be disabled') - -assert(not disabled_opt.enabled(), 'Should be disabled option') -assert(disabled_opt.disabled(), 'Should be disabled option') -assert(not disabled_opt.auto(), 'Should be disabled option') diff --git a/test cases/common/204 feature option disabled/meson_options.txt b/test cases/common/204 feature option disabled/meson_options.txt deleted file mode 100644 index 063a35f39..000000000 --- a/test cases/common/204 feature option disabled/meson_options.txt +++ /dev/null @@ -1,3 +0,0 @@ -option('required', type : 'feature', value : 'enabled', description : 'An required feature') -option('optional', type : 'feature', value : 'auto', description : 'An optional feature') -option('disabled', type : 'feature', value : 'disabled', description : 'A disabled feature') diff --git a/test cases/common/205 static threads/lib1.c b/test cases/common/205 static threads/lib1.c deleted file mode 100644 index 1aa786c66..000000000 --- a/test cases/common/205 static threads/lib1.c +++ /dev/null @@ -1,13 +0,0 @@ -#if defined _WIN32 -#include -#else -#include -#endif - -void *f(void) { -#if defined _WIN32 - return CreateThread; -#else - return pthread_create; -#endif -} diff --git a/test cases/common/205 static threads/lib2.c b/test cases/common/205 static threads/lib2.c deleted file mode 100644 index e988814e2..000000000 --- a/test cases/common/205 static threads/lib2.c +++ /dev/null @@ -1,5 +0,0 @@ -extern void *f(void); - -void *g(void) { - return f(); -} diff --git a/test cases/common/205 static threads/meson.build b/test cases/common/205 static threads/meson.build deleted file mode 100644 index 427920034..000000000 --- a/test cases/common/205 static threads/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -project('threads', 'c') - -thread_dep = dependency('threads') - - -lib1 = static_library('lib1', 'lib1.c', - dependencies : thread_dep) - -lib2 = static_library('lib2', 'lib2.c', - link_with : lib1) - -executable('prog', 'prog.c', - link_with : lib2) diff --git a/test cases/common/205 static threads/prog.c b/test cases/common/205 static threads/prog.c deleted file mode 100644 index 14a7c760f..000000000 --- a/test cases/common/205 static threads/prog.c +++ /dev/null @@ -1,6 +0,0 @@ -extern void *g(void); - -int main(void) { - g(); - return 0; -} diff --git a/test cases/failing/24 int conversion/meson.build b/test cases/failing/24 int conversion/meson.build new file mode 100644 index 000000000..51f6c7e16 --- /dev/null +++ b/test cases/failing/24 int conversion/meson.build @@ -0,0 +1,3 @@ +project('int conversion', 'c') + +'notanumber'.to_int() diff --git a/test cases/failing/25 badlang/meson.build b/test cases/failing/25 badlang/meson.build new file mode 100644 index 000000000..f6bf0cca0 --- /dev/null +++ b/test cases/failing/25 badlang/meson.build @@ -0,0 +1,3 @@ +project('badlang', 'c') + +add_languages('nonexisting') diff --git a/test cases/failing/25 int conversion/meson.build b/test cases/failing/25 int conversion/meson.build deleted file mode 100644 index 51f6c7e16..000000000 --- a/test cases/failing/25 int conversion/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('int conversion', 'c') - -'notanumber'.to_int() diff --git a/test cases/failing/26 badlang/meson.build b/test cases/failing/26 badlang/meson.build deleted file mode 100644 index f6bf0cca0..000000000 --- a/test cases/failing/26 badlang/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('badlang', 'c') - -add_languages('nonexisting') diff --git a/test cases/failing/26 output subdir/foo.in b/test cases/failing/26 output subdir/foo.in new file mode 100644 index 000000000..3d1bf19eb --- /dev/null +++ b/test cases/failing/26 output subdir/foo.in @@ -0,0 +1 @@ +Nothing here. diff --git a/test cases/failing/26 output subdir/meson.build b/test cases/failing/26 output subdir/meson.build new file mode 100644 index 000000000..4eb422ce4 --- /dev/null +++ b/test cases/failing/26 output subdir/meson.build @@ -0,0 +1,5 @@ +project('outdir path', 'c') + +configure_file(input : 'foo.in', + output : 'subdir/foo', + copy: true) diff --git a/test cases/failing/26 output subdir/subdir/dummy.txt b/test cases/failing/26 output subdir/subdir/dummy.txt new file mode 100644 index 000000000..f10acf3e5 --- /dev/null +++ b/test cases/failing/26 output subdir/subdir/dummy.txt @@ -0,0 +1,2 @@ +I'm only here because Git is stupid about empty dirs. + diff --git a/test cases/failing/27 noprog use/meson.build b/test cases/failing/27 noprog use/meson.build new file mode 100644 index 000000000..e4de42fbd --- /dev/null +++ b/test cases/failing/27 noprog use/meson.build @@ -0,0 +1,9 @@ +project('using not found exe', 'c') + +nope = find_program('nonexisting', required : false) + +custom_target( 'aa', + input: 'meson.build', + output: 'foobar', + command: [nope, '@INPUT@', '@OUTPUT@'] +) diff --git a/test cases/failing/27 output subdir/foo.in b/test cases/failing/27 output subdir/foo.in deleted file mode 100644 index 3d1bf19eb..000000000 --- a/test cases/failing/27 output subdir/foo.in +++ /dev/null @@ -1 +0,0 @@ -Nothing here. diff --git a/test cases/failing/27 output subdir/meson.build b/test cases/failing/27 output subdir/meson.build deleted file mode 100644 index 4eb422ce4..000000000 --- a/test cases/failing/27 output subdir/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('outdir path', 'c') - -configure_file(input : 'foo.in', - output : 'subdir/foo', - copy: true) diff --git a/test cases/failing/27 output subdir/subdir/dummy.txt b/test cases/failing/27 output subdir/subdir/dummy.txt deleted file mode 100644 index f10acf3e5..000000000 --- a/test cases/failing/27 output subdir/subdir/dummy.txt +++ /dev/null @@ -1,2 +0,0 @@ -I'm only here because Git is stupid about empty dirs. - diff --git a/test cases/failing/28 no crossprop/meson.build b/test cases/failing/28 no crossprop/meson.build new file mode 100644 index 000000000..bd3a743d6 --- /dev/null +++ b/test cases/failing/28 no crossprop/meson.build @@ -0,0 +1,3 @@ +project('no crossprop', 'c') + +message(meson.get_cross_property('nonexisting')) diff --git a/test cases/failing/28 noprog use/meson.build b/test cases/failing/28 noprog use/meson.build deleted file mode 100644 index e4de42fbd..000000000 --- a/test cases/failing/28 noprog use/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -project('using not found exe', 'c') - -nope = find_program('nonexisting', required : false) - -custom_target( 'aa', - input: 'meson.build', - output: 'foobar', - command: [nope, '@INPUT@', '@OUTPUT@'] -) diff --git a/test cases/failing/29 nested ternary/meson.build b/test cases/failing/29 nested ternary/meson.build new file mode 100644 index 000000000..f9c2e5f8a --- /dev/null +++ b/test cases/failing/29 nested ternary/meson.build @@ -0,0 +1,3 @@ +project('nested ternary', 'c') + +x = true ? (false ? 1 : 0) : 2 diff --git a/test cases/failing/29 no crossprop/meson.build b/test cases/failing/29 no crossprop/meson.build deleted file mode 100644 index bd3a743d6..000000000 --- a/test cases/failing/29 no crossprop/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('no crossprop', 'c') - -message(meson.get_cross_property('nonexisting')) diff --git a/test cases/failing/30 invalid man extension/meson.build b/test cases/failing/30 invalid man extension/meson.build new file mode 100644 index 000000000..45eddca40 --- /dev/null +++ b/test cases/failing/30 invalid man extension/meson.build @@ -0,0 +1,2 @@ +project('man install', 'c') +m1 = install_man('foo.a1') diff --git a/test cases/failing/30 nested ternary/meson.build b/test cases/failing/30 nested ternary/meson.build deleted file mode 100644 index f9c2e5f8a..000000000 --- a/test cases/failing/30 nested ternary/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('nested ternary', 'c') - -x = true ? (false ? 1 : 0) : 2 diff --git a/test cases/failing/31 invalid man extension/meson.build b/test cases/failing/31 invalid man extension/meson.build deleted file mode 100644 index 45eddca40..000000000 --- a/test cases/failing/31 invalid man extension/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('man install', 'c') -m1 = install_man('foo.a1') diff --git a/test cases/failing/31 no man extension/meson.build b/test cases/failing/31 no man extension/meson.build new file mode 100644 index 000000000..bf835713f --- /dev/null +++ b/test cases/failing/31 no man extension/meson.build @@ -0,0 +1,2 @@ +project('man install', 'c') +m1 = install_man('foo') diff --git a/test cases/failing/32 exe static shared/meson.build b/test cases/failing/32 exe static shared/meson.build new file mode 100644 index 000000000..b1027647d --- /dev/null +++ b/test cases/failing/32 exe static shared/meson.build @@ -0,0 +1,11 @@ +project('statchain', 'c') + +host_system = host_machine.system() +if host_system == 'windows' or host_system == 'darwin' + error('Test only fails on Linux and BSD') +endif + +statlib = static_library('stat', 'stat.c', pic : false) +shlib2 = shared_library('shr2', 'shlib2.c', link_with : statlib) +exe = executable('prog', 'prog.c', link_with : shlib2) +test('runtest', exe) diff --git a/test cases/failing/32 exe static shared/prog.c b/test cases/failing/32 exe static shared/prog.c new file mode 100644 index 000000000..26603b694 --- /dev/null +++ b/test cases/failing/32 exe static shared/prog.c @@ -0,0 +1,10 @@ +int shlibfunc2(); +int statlibfunc(); + +int main(int argc, char **argv) { + if (statlibfunc() != 42) + return 1; + if (shlibfunc2() != 24) + return 1; + return 0; +} diff --git a/test cases/failing/32 exe static shared/shlib2.c b/test cases/failing/32 exe static shared/shlib2.c new file mode 100644 index 000000000..5b68843dc --- /dev/null +++ b/test cases/failing/32 exe static shared/shlib2.c @@ -0,0 +1,16 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int statlibfunc(void); + +int DLL_PUBLIC shlibfunc2(void) { + return 24; +} diff --git a/test cases/failing/32 exe static shared/stat.c b/test cases/failing/32 exe static shared/stat.c new file mode 100644 index 000000000..56ec66c67 --- /dev/null +++ b/test cases/failing/32 exe static shared/stat.c @@ -0,0 +1,3 @@ +int statlibfunc() { + return 42; +} diff --git a/test cases/failing/32 no man extension/meson.build b/test cases/failing/32 no man extension/meson.build deleted file mode 100644 index bf835713f..000000000 --- a/test cases/failing/32 no man extension/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('man install', 'c') -m1 = install_man('foo') diff --git a/test cases/failing/33 exe static shared/meson.build b/test cases/failing/33 exe static shared/meson.build deleted file mode 100644 index b1027647d..000000000 --- a/test cases/failing/33 exe static shared/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('statchain', 'c') - -host_system = host_machine.system() -if host_system == 'windows' or host_system == 'darwin' - error('Test only fails on Linux and BSD') -endif - -statlib = static_library('stat', 'stat.c', pic : false) -shlib2 = shared_library('shr2', 'shlib2.c', link_with : statlib) -exe = executable('prog', 'prog.c', link_with : shlib2) -test('runtest', exe) diff --git a/test cases/failing/33 exe static shared/prog.c b/test cases/failing/33 exe static shared/prog.c deleted file mode 100644 index 26603b694..000000000 --- a/test cases/failing/33 exe static shared/prog.c +++ /dev/null @@ -1,10 +0,0 @@ -int shlibfunc2(); -int statlibfunc(); - -int main(int argc, char **argv) { - if (statlibfunc() != 42) - return 1; - if (shlibfunc2() != 24) - return 1; - return 0; -} diff --git a/test cases/failing/33 exe static shared/shlib2.c b/test cases/failing/33 exe static shared/shlib2.c deleted file mode 100644 index 5b68843dc..000000000 --- a/test cases/failing/33 exe static shared/shlib2.c +++ /dev/null @@ -1,16 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int statlibfunc(void); - -int DLL_PUBLIC shlibfunc2(void) { - return 24; -} diff --git a/test cases/failing/33 exe static shared/stat.c b/test cases/failing/33 exe static shared/stat.c deleted file mode 100644 index 56ec66c67..000000000 --- a/test cases/failing/33 exe static shared/stat.c +++ /dev/null @@ -1,3 +0,0 @@ -int statlibfunc() { - return 42; -} diff --git a/test cases/failing/33 non-root subproject/meson.build b/test cases/failing/33 non-root subproject/meson.build new file mode 100644 index 000000000..c84dce7f9 --- /dev/null +++ b/test cases/failing/33 non-root subproject/meson.build @@ -0,0 +1,3 @@ +project('non-root subproject', 'c') + +subdir('some') diff --git a/test cases/failing/33 non-root subproject/some/meson.build b/test cases/failing/33 non-root subproject/some/meson.build new file mode 100644 index 000000000..d82f45123 --- /dev/null +++ b/test cases/failing/33 non-root subproject/some/meson.build @@ -0,0 +1 @@ +dependency('definitely-doesnt-exist', fallback : ['someproj', 'some_dep']) diff --git a/test cases/failing/34 dependency not-required then required/meson.build b/test cases/failing/34 dependency not-required then required/meson.build new file mode 100644 index 000000000..1796699e4 --- /dev/null +++ b/test cases/failing/34 dependency not-required then required/meson.build @@ -0,0 +1,4 @@ +project('dep-test', 'c', version : '1.0') + +foo_dep = dependency('foo-bar-xyz-12.3', required : false) +bar_dep = dependency('foo-bar-xyz-12.3') diff --git a/test cases/failing/34 non-root subproject/meson.build b/test cases/failing/34 non-root subproject/meson.build deleted file mode 100644 index c84dce7f9..000000000 --- a/test cases/failing/34 non-root subproject/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('non-root subproject', 'c') - -subdir('some') diff --git a/test cases/failing/34 non-root subproject/some/meson.build b/test cases/failing/34 non-root subproject/some/meson.build deleted file mode 100644 index d82f45123..000000000 --- a/test cases/failing/34 non-root subproject/some/meson.build +++ /dev/null @@ -1 +0,0 @@ -dependency('definitely-doesnt-exist', fallback : ['someproj', 'some_dep']) diff --git a/test cases/failing/35 dependency not-required then required/meson.build b/test cases/failing/35 dependency not-required then required/meson.build deleted file mode 100644 index 1796699e4..000000000 --- a/test cases/failing/35 dependency not-required then required/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('dep-test', 'c', version : '1.0') - -foo_dep = dependency('foo-bar-xyz-12.3', required : false) -bar_dep = dependency('foo-bar-xyz-12.3') diff --git a/test cases/failing/35 project argument after target/exe.c b/test cases/failing/35 project argument after target/exe.c new file mode 100644 index 000000000..11b7fad8e --- /dev/null +++ b/test cases/failing/35 project argument after target/exe.c @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 0; +} diff --git a/test cases/failing/35 project argument after target/meson.build b/test cases/failing/35 project argument after target/meson.build new file mode 100644 index 000000000..5402c67fc --- /dev/null +++ b/test cases/failing/35 project argument after target/meson.build @@ -0,0 +1,7 @@ +project('project argument after target failing', 'c', + version : '2.3.4', + license : 'mylicense') + +add_project_arguments('-DPROJECT_OPTION', language: 'c') +e = executable('exe', 'exe.c') +add_project_arguments('-DPROJECT_OPTION1', language: 'c') diff --git a/test cases/failing/36 pkgconfig dependency impossible conditions/meson.build b/test cases/failing/36 pkgconfig dependency impossible conditions/meson.build new file mode 100644 index 000000000..54d434c09 --- /dev/null +++ b/test cases/failing/36 pkgconfig dependency impossible conditions/meson.build @@ -0,0 +1,3 @@ +project('impossible-dep-test', 'c', version : '1.0') + +dependency('zlib', version : ['>=1.0', '<1.0']) diff --git a/test cases/failing/36 project argument after target/exe.c b/test cases/failing/36 project argument after target/exe.c deleted file mode 100644 index 11b7fad8e..000000000 --- a/test cases/failing/36 project argument after target/exe.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(int argc, char **argv) { - return 0; -} diff --git a/test cases/failing/36 project argument after target/meson.build b/test cases/failing/36 project argument after target/meson.build deleted file mode 100644 index 5402c67fc..000000000 --- a/test cases/failing/36 project argument after target/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('project argument after target failing', 'c', - version : '2.3.4', - license : 'mylicense') - -add_project_arguments('-DPROJECT_OPTION', language: 'c') -e = executable('exe', 'exe.c') -add_project_arguments('-DPROJECT_OPTION1', language: 'c') diff --git a/test cases/failing/37 has function external dependency/meson.build b/test cases/failing/37 has function external dependency/meson.build new file mode 100644 index 000000000..45a3bc246 --- /dev/null +++ b/test cases/failing/37 has function external dependency/meson.build @@ -0,0 +1,8 @@ +project('has function ext dep', 'c') + +cc = meson.get_compiler('c') + +mylib = shared_library('mylib', 'mylib.c') +mylib_dep = declare_dependency(link_with : mylib) +# Only external dependencies can work here +cc.has_function('malloc', dependencies : mylib_dep) diff --git a/test cases/failing/37 has function external dependency/mylib.c b/test cases/failing/37 has function external dependency/mylib.c new file mode 100644 index 000000000..d9fbd342b --- /dev/null +++ b/test cases/failing/37 has function external dependency/mylib.c @@ -0,0 +1 @@ +int testfunc(void) { return 0; } diff --git a/test cases/failing/37 pkgconfig dependency impossible conditions/meson.build b/test cases/failing/37 pkgconfig dependency impossible conditions/meson.build deleted file mode 100644 index 54d434c09..000000000 --- a/test cases/failing/37 pkgconfig dependency impossible conditions/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('impossible-dep-test', 'c', version : '1.0') - -dependency('zlib', version : ['>=1.0', '<1.0']) diff --git a/test cases/failing/38 has function external dependency/meson.build b/test cases/failing/38 has function external dependency/meson.build deleted file mode 100644 index 45a3bc246..000000000 --- a/test cases/failing/38 has function external dependency/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -project('has function ext dep', 'c') - -cc = meson.get_compiler('c') - -mylib = shared_library('mylib', 'mylib.c') -mylib_dep = declare_dependency(link_with : mylib) -# Only external dependencies can work here -cc.has_function('malloc', dependencies : mylib_dep) diff --git a/test cases/failing/38 has function external dependency/mylib.c b/test cases/failing/38 has function external dependency/mylib.c deleted file mode 100644 index d9fbd342b..000000000 --- a/test cases/failing/38 has function external dependency/mylib.c +++ /dev/null @@ -1 +0,0 @@ -int testfunc(void) { return 0; } diff --git a/test cases/failing/38 libdir must be inside prefix/meson.build b/test cases/failing/38 libdir must be inside prefix/meson.build new file mode 100644 index 000000000..66272ea3f --- /dev/null +++ b/test cases/failing/38 libdir must be inside prefix/meson.build @@ -0,0 +1,2 @@ +project('libdir prefix', 'c', + default_options : ['libdir=/opt/lib']) diff --git a/test cases/failing/39 libdir must be inside prefix/meson.build b/test cases/failing/39 libdir must be inside prefix/meson.build deleted file mode 100644 index 66272ea3f..000000000 --- a/test cases/failing/39 libdir must be inside prefix/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('libdir prefix', 'c', - default_options : ['libdir=/opt/lib']) diff --git a/test cases/failing/39 prefix absolute/meson.build b/test cases/failing/39 prefix absolute/meson.build new file mode 100644 index 000000000..e2863e79c --- /dev/null +++ b/test cases/failing/39 prefix absolute/meson.build @@ -0,0 +1,2 @@ +project('prefix-abs', 'c', + default_options : ['prefix=some/path/notabs']) diff --git a/test cases/failing/40 kwarg assign/dummy.c b/test cases/failing/40 kwarg assign/dummy.c new file mode 100644 index 000000000..16fcdd9f4 --- /dev/null +++ b/test cases/failing/40 kwarg assign/dummy.c @@ -0,0 +1,3 @@ +const char* dummy() { + return "I do nothing."; +} diff --git a/test cases/failing/40 kwarg assign/meson.build b/test cases/failing/40 kwarg assign/meson.build new file mode 100644 index 000000000..c86786fd1 --- /dev/null +++ b/test cases/failing/40 kwarg assign/meson.build @@ -0,0 +1,4 @@ +project('assign in kwarg', 'c') + +executable('prog', 'dummy.c', args = 'prog.c') + diff --git a/test cases/failing/40 kwarg assign/prog.c b/test cases/failing/40 kwarg assign/prog.c new file mode 100644 index 000000000..11b7fad8e --- /dev/null +++ b/test cases/failing/40 kwarg assign/prog.c @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 0; +} diff --git a/test cases/failing/40 prefix absolute/meson.build b/test cases/failing/40 prefix absolute/meson.build deleted file mode 100644 index e2863e79c..000000000 --- a/test cases/failing/40 prefix absolute/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('prefix-abs', 'c', - default_options : ['prefix=some/path/notabs']) diff --git a/test cases/failing/41 custom target plainname many inputs/1.txt b/test cases/failing/41 custom target plainname many inputs/1.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/test cases/failing/41 custom target plainname many inputs/1.txt @@ -0,0 +1 @@ +1 diff --git a/test cases/failing/41 custom target plainname many inputs/2.txt b/test cases/failing/41 custom target plainname many inputs/2.txt new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/test cases/failing/41 custom target plainname many inputs/2.txt @@ -0,0 +1 @@ +2 diff --git a/test cases/failing/41 custom target plainname many inputs/catfiles.py b/test cases/failing/41 custom target plainname many inputs/catfiles.py new file mode 100644 index 000000000..1c53e24e7 --- /dev/null +++ b/test cases/failing/41 custom target plainname many inputs/catfiles.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import sys + +out = sys.argv[-1] +with open(out, 'wb') as o: + for infile in sys.argv[1:-1]: + with open(infile, 'rb') as f: + o.write(f.read()) diff --git a/test cases/failing/41 custom target plainname many inputs/meson.build b/test cases/failing/41 custom target plainname many inputs/meson.build new file mode 100644 index 000000000..1bcfc0672 --- /dev/null +++ b/test cases/failing/41 custom target plainname many inputs/meson.build @@ -0,0 +1,8 @@ +project('plain name many inputs', 'c') + +catfiles = find_program('catfiles.py') + +custom_target('plainname-inputs', + input : ['1.txt', '2.txt'], + output : '@PLAINNAME@.dat', + command : [catfiles, '@INPUT@', '@OUTPUT@']) diff --git a/test cases/failing/41 kwarg assign/dummy.c b/test cases/failing/41 kwarg assign/dummy.c deleted file mode 100644 index 16fcdd9f4..000000000 --- a/test cases/failing/41 kwarg assign/dummy.c +++ /dev/null @@ -1,3 +0,0 @@ -const char* dummy() { - return "I do nothing."; -} diff --git a/test cases/failing/41 kwarg assign/meson.build b/test cases/failing/41 kwarg assign/meson.build deleted file mode 100644 index c86786fd1..000000000 --- a/test cases/failing/41 kwarg assign/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('assign in kwarg', 'c') - -executable('prog', 'dummy.c', args = 'prog.c') - diff --git a/test cases/failing/41 kwarg assign/prog.c b/test cases/failing/41 kwarg assign/prog.c deleted file mode 100644 index 11b7fad8e..000000000 --- a/test cases/failing/41 kwarg assign/prog.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(int argc, char **argv) { - return 0; -} diff --git a/test cases/failing/42 custom target outputs not matching install_dirs/generator.py b/test cases/failing/42 custom target outputs not matching install_dirs/generator.py new file mode 100755 index 000000000..4ac61795b --- /dev/null +++ b/test cases/failing/42 custom target outputs not matching install_dirs/generator.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +import sys, os + +if len(sys.argv) != 3: + print(sys.argv[0], '', '') + +name = sys.argv[1] +odir = sys.argv[2] + +with open(os.path.join(odir, name + '.h'), 'w') as f: + f.write('int func();\n') +with open(os.path.join(odir, name + '.c'), 'w') as f: + f.write('int main(int argc, char *argv[]) { return 0; }') +with open(os.path.join(odir, name + '.sh'), 'w') as f: + f.write('#!/bin/bash') diff --git a/test cases/failing/42 custom target outputs not matching install_dirs/installed_files.txt b/test cases/failing/42 custom target outputs not matching install_dirs/installed_files.txt new file mode 100644 index 000000000..21e1249b1 --- /dev/null +++ b/test cases/failing/42 custom target outputs not matching install_dirs/installed_files.txt @@ -0,0 +1,6 @@ +usr/include/diff.h +usr/include/first.h +usr/bin/diff.sh +usr/bin/second.sh +opt/same.h +opt/same.sh diff --git a/test cases/failing/42 custom target outputs not matching install_dirs/meson.build b/test cases/failing/42 custom target outputs not matching install_dirs/meson.build new file mode 100644 index 000000000..45bd7b397 --- /dev/null +++ b/test cases/failing/42 custom target outputs not matching install_dirs/meson.build @@ -0,0 +1,13 @@ +project('outputs not matching install_dirs', 'c') + +gen = find_program('generator.py') + +if meson.backend() != 'ninja' + error('Failing manually, test is only for the ninja backend') +endif + +custom_target('too-few-install-dirs', + output : ['toofew.h', 'toofew.c', 'toofew.sh'], + command : [gen, 'toofew', '@OUTDIR@'], + install : true, + install_dir : [join_paths(get_option('prefix'), get_option('includedir')), false]) diff --git a/test cases/failing/42 custom target plainname many inputs/1.txt b/test cases/failing/42 custom target plainname many inputs/1.txt deleted file mode 100644 index d00491fd7..000000000 --- a/test cases/failing/42 custom target plainname many inputs/1.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/test cases/failing/42 custom target plainname many inputs/2.txt b/test cases/failing/42 custom target plainname many inputs/2.txt deleted file mode 100644 index 0cfbf0888..000000000 --- a/test cases/failing/42 custom target plainname many inputs/2.txt +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/test cases/failing/42 custom target plainname many inputs/catfiles.py b/test cases/failing/42 custom target plainname many inputs/catfiles.py deleted file mode 100644 index 1c53e24e7..000000000 --- a/test cases/failing/42 custom target plainname many inputs/catfiles.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -out = sys.argv[-1] -with open(out, 'wb') as o: - for infile in sys.argv[1:-1]: - with open(infile, 'rb') as f: - o.write(f.read()) diff --git a/test cases/failing/42 custom target plainname many inputs/meson.build b/test cases/failing/42 custom target plainname many inputs/meson.build deleted file mode 100644 index 1bcfc0672..000000000 --- a/test cases/failing/42 custom target plainname many inputs/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -project('plain name many inputs', 'c') - -catfiles = find_program('catfiles.py') - -custom_target('plainname-inputs', - input : ['1.txt', '2.txt'], - output : '@PLAINNAME@.dat', - command : [catfiles, '@INPUT@', '@OUTPUT@']) diff --git a/test cases/failing/43 custom target outputs not matching install_dirs/generator.py b/test cases/failing/43 custom target outputs not matching install_dirs/generator.py deleted file mode 100755 index 4ac61795b..000000000 --- a/test cases/failing/43 custom target outputs not matching install_dirs/generator.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os - -if len(sys.argv) != 3: - print(sys.argv[0], '', '') - -name = sys.argv[1] -odir = sys.argv[2] - -with open(os.path.join(odir, name + '.h'), 'w') as f: - f.write('int func();\n') -with open(os.path.join(odir, name + '.c'), 'w') as f: - f.write('int main(int argc, char *argv[]) { return 0; }') -with open(os.path.join(odir, name + '.sh'), 'w') as f: - f.write('#!/bin/bash') diff --git a/test cases/failing/43 custom target outputs not matching install_dirs/installed_files.txt b/test cases/failing/43 custom target outputs not matching install_dirs/installed_files.txt deleted file mode 100644 index 21e1249b1..000000000 --- a/test cases/failing/43 custom target outputs not matching install_dirs/installed_files.txt +++ /dev/null @@ -1,6 +0,0 @@ -usr/include/diff.h -usr/include/first.h -usr/bin/diff.sh -usr/bin/second.sh -opt/same.h -opt/same.sh diff --git a/test cases/failing/43 custom target outputs not matching install_dirs/meson.build b/test cases/failing/43 custom target outputs not matching install_dirs/meson.build deleted file mode 100644 index 45bd7b397..000000000 --- a/test cases/failing/43 custom target outputs not matching install_dirs/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -project('outputs not matching install_dirs', 'c') - -gen = find_program('generator.py') - -if meson.backend() != 'ninja' - error('Failing manually, test is only for the ninja backend') -endif - -custom_target('too-few-install-dirs', - output : ['toofew.h', 'toofew.c', 'toofew.sh'], - command : [gen, 'toofew', '@OUTDIR@'], - install : true, - install_dir : [join_paths(get_option('prefix'), get_option('includedir')), false]) diff --git a/test cases/failing/43 project name colon/meson.build b/test cases/failing/43 project name colon/meson.build new file mode 100644 index 000000000..53e947ef2 --- /dev/null +++ b/test cases/failing/43 project name colon/meson.build @@ -0,0 +1 @@ +project('name with :') diff --git a/test cases/failing/44 abs subdir/bob/meson.build b/test cases/failing/44 abs subdir/bob/meson.build new file mode 100644 index 000000000..7bbf4b284 --- /dev/null +++ b/test cases/failing/44 abs subdir/bob/meson.build @@ -0,0 +1,2 @@ +# This file is never reached. +x = 3 diff --git a/test cases/failing/44 abs subdir/meson.build b/test cases/failing/44 abs subdir/meson.build new file mode 100644 index 000000000..8c23224a4 --- /dev/null +++ b/test cases/failing/44 abs subdir/meson.build @@ -0,0 +1,6 @@ +project('abs subdir', 'c') + +# For some reason people insist on doing this, probably +# because Make has taught them to never rely on anything. +subdir(join_paths(meson.source_root(), 'bob')) + diff --git a/test cases/failing/44 project name colon/meson.build b/test cases/failing/44 project name colon/meson.build deleted file mode 100644 index 53e947ef2..000000000 --- a/test cases/failing/44 project name colon/meson.build +++ /dev/null @@ -1 +0,0 @@ -project('name with :') diff --git a/test cases/failing/45 abs subdir/bob/meson.build b/test cases/failing/45 abs subdir/bob/meson.build deleted file mode 100644 index 7bbf4b284..000000000 --- a/test cases/failing/45 abs subdir/bob/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -# This file is never reached. -x = 3 diff --git a/test cases/failing/45 abs subdir/meson.build b/test cases/failing/45 abs subdir/meson.build deleted file mode 100644 index 8c23224a4..000000000 --- a/test cases/failing/45 abs subdir/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('abs subdir', 'c') - -# For some reason people insist on doing this, probably -# because Make has taught them to never rely on anything. -subdir(join_paths(meson.source_root(), 'bob')) - diff --git a/test cases/failing/45 abspath to srcdir/meson.build b/test cases/failing/45 abspath to srcdir/meson.build new file mode 100644 index 000000000..964a19b56 --- /dev/null +++ b/test cases/failing/45 abspath to srcdir/meson.build @@ -0,0 +1,3 @@ +project('meson', 'c') + +include_directories(meson.current_source_dir()) diff --git a/test cases/failing/46 abspath to srcdir/meson.build b/test cases/failing/46 abspath to srcdir/meson.build deleted file mode 100644 index 964a19b56..000000000 --- a/test cases/failing/46 abspath to srcdir/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('meson', 'c') - -include_directories(meson.current_source_dir()) diff --git a/test cases/failing/46 pkgconfig variables reserved/meson.build b/test cases/failing/46 pkgconfig variables reserved/meson.build new file mode 100644 index 000000000..82ae995d4 --- /dev/null +++ b/test cases/failing/46 pkgconfig variables reserved/meson.build @@ -0,0 +1,16 @@ +project('variables-reserved-test', 'c', version : '1.0') + +pkgg = import('pkgconfig') +lib = shared_library('simple', 'simple.c') +libver = '1.0' +h = install_headers('simple.h') + +pkgg.generate( + libraries : [lib, '-lz'], + subdirs : '.', + version : libver, + name : 'libsimple', + filebase : 'simple', + description : 'A simple demo library.', + variables : [ 'prefix=/tmp/' ] +) diff --git a/test cases/failing/46 pkgconfig variables reserved/simple.c b/test cases/failing/46 pkgconfig variables reserved/simple.c new file mode 100644 index 000000000..e8a6d8330 --- /dev/null +++ b/test cases/failing/46 pkgconfig variables reserved/simple.c @@ -0,0 +1,5 @@ +#include"simple.h" + +int simple_function() { + return 42; +} diff --git a/test cases/failing/46 pkgconfig variables reserved/simple.h b/test cases/failing/46 pkgconfig variables reserved/simple.h new file mode 100644 index 000000000..bb52e6d72 --- /dev/null +++ b/test cases/failing/46 pkgconfig variables reserved/simple.h @@ -0,0 +1,6 @@ +#ifndef SIMPLE_H_ +#define SIMPLE_H_ + +int simple_function(); + +#endif diff --git a/test cases/failing/47 pkgconfig variables reserved/meson.build b/test cases/failing/47 pkgconfig variables reserved/meson.build deleted file mode 100644 index 82ae995d4..000000000 --- a/test cases/failing/47 pkgconfig variables reserved/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('variables-reserved-test', 'c', version : '1.0') - -pkgg = import('pkgconfig') -lib = shared_library('simple', 'simple.c') -libver = '1.0' -h = install_headers('simple.h') - -pkgg.generate( - libraries : [lib, '-lz'], - subdirs : '.', - version : libver, - name : 'libsimple', - filebase : 'simple', - description : 'A simple demo library.', - variables : [ 'prefix=/tmp/' ] -) diff --git a/test cases/failing/47 pkgconfig variables reserved/simple.c b/test cases/failing/47 pkgconfig variables reserved/simple.c deleted file mode 100644 index e8a6d8330..000000000 --- a/test cases/failing/47 pkgconfig variables reserved/simple.c +++ /dev/null @@ -1,5 +0,0 @@ -#include"simple.h" - -int simple_function() { - return 42; -} diff --git a/test cases/failing/47 pkgconfig variables reserved/simple.h b/test cases/failing/47 pkgconfig variables reserved/simple.h deleted file mode 100644 index bb52e6d72..000000000 --- a/test cases/failing/47 pkgconfig variables reserved/simple.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SIMPLE_H_ -#define SIMPLE_H_ - -int simple_function(); - -#endif diff --git a/test cases/failing/47 pkgconfig variables zero length/meson.build b/test cases/failing/47 pkgconfig variables zero length/meson.build new file mode 100644 index 000000000..65d33445c --- /dev/null +++ b/test cases/failing/47 pkgconfig variables zero length/meson.build @@ -0,0 +1,16 @@ +project('variables-zero-length-test', 'c', version : '1.0') + +pkgg = import('pkgconfig') +lib = shared_library('simple', 'simple.c') +libver = '1.0' +h = install_headers('simple.h') + +pkgg.generate( + libraries : [lib, '-lz'], + subdirs : '.', + version : libver, + name : 'libsimple', + filebase : 'simple', + description : 'A simple demo library.', + variables : [ '=value' ] +) diff --git a/test cases/failing/47 pkgconfig variables zero length/simple.c b/test cases/failing/47 pkgconfig variables zero length/simple.c new file mode 100644 index 000000000..e8a6d8330 --- /dev/null +++ b/test cases/failing/47 pkgconfig variables zero length/simple.c @@ -0,0 +1,5 @@ +#include"simple.h" + +int simple_function() { + return 42; +} diff --git a/test cases/failing/47 pkgconfig variables zero length/simple.h b/test cases/failing/47 pkgconfig variables zero length/simple.h new file mode 100644 index 000000000..bb52e6d72 --- /dev/null +++ b/test cases/failing/47 pkgconfig variables zero length/simple.h @@ -0,0 +1,6 @@ +#ifndef SIMPLE_H_ +#define SIMPLE_H_ + +int simple_function(); + +#endif diff --git a/test cases/failing/48 pkgconfig variables zero length value/meson.build b/test cases/failing/48 pkgconfig variables zero length value/meson.build new file mode 100644 index 000000000..33977b273 --- /dev/null +++ b/test cases/failing/48 pkgconfig variables zero length value/meson.build @@ -0,0 +1,16 @@ +project('variables-zero-length-value-test', 'c', version : '1.0') + +pkgg = import('pkgconfig') +lib = shared_library('simple', 'simple.c') +libver = '1.0' +h = install_headers('simple.h') + +pkgg.generate( + libraries : [lib, '-lz'], + subdirs : '.', + version : libver, + name : 'libsimple', + filebase : 'simple', + description : 'A simple demo library.', + variables : [ 'key=' ] +) diff --git a/test cases/failing/48 pkgconfig variables zero length value/simple.c b/test cases/failing/48 pkgconfig variables zero length value/simple.c new file mode 100644 index 000000000..e8a6d8330 --- /dev/null +++ b/test cases/failing/48 pkgconfig variables zero length value/simple.c @@ -0,0 +1,5 @@ +#include"simple.h" + +int simple_function() { + return 42; +} diff --git a/test cases/failing/48 pkgconfig variables zero length value/simple.h b/test cases/failing/48 pkgconfig variables zero length value/simple.h new file mode 100644 index 000000000..bb52e6d72 --- /dev/null +++ b/test cases/failing/48 pkgconfig variables zero length value/simple.h @@ -0,0 +1,6 @@ +#ifndef SIMPLE_H_ +#define SIMPLE_H_ + +int simple_function(); + +#endif diff --git a/test cases/failing/48 pkgconfig variables zero length/meson.build b/test cases/failing/48 pkgconfig variables zero length/meson.build deleted file mode 100644 index 65d33445c..000000000 --- a/test cases/failing/48 pkgconfig variables zero length/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('variables-zero-length-test', 'c', version : '1.0') - -pkgg = import('pkgconfig') -lib = shared_library('simple', 'simple.c') -libver = '1.0' -h = install_headers('simple.h') - -pkgg.generate( - libraries : [lib, '-lz'], - subdirs : '.', - version : libver, - name : 'libsimple', - filebase : 'simple', - description : 'A simple demo library.', - variables : [ '=value' ] -) diff --git a/test cases/failing/48 pkgconfig variables zero length/simple.c b/test cases/failing/48 pkgconfig variables zero length/simple.c deleted file mode 100644 index e8a6d8330..000000000 --- a/test cases/failing/48 pkgconfig variables zero length/simple.c +++ /dev/null @@ -1,5 +0,0 @@ -#include"simple.h" - -int simple_function() { - return 42; -} diff --git a/test cases/failing/48 pkgconfig variables zero length/simple.h b/test cases/failing/48 pkgconfig variables zero length/simple.h deleted file mode 100644 index bb52e6d72..000000000 --- a/test cases/failing/48 pkgconfig variables zero length/simple.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SIMPLE_H_ -#define SIMPLE_H_ - -int simple_function(); - -#endif diff --git a/test cases/failing/49 pkgconfig variables not key value/meson.build b/test cases/failing/49 pkgconfig variables not key value/meson.build new file mode 100644 index 000000000..02fa7376f --- /dev/null +++ b/test cases/failing/49 pkgconfig variables not key value/meson.build @@ -0,0 +1,16 @@ +project('variables-not-key-value-test', 'c', version : '1.0') + +pkgg = import('pkgconfig') +lib = shared_library('simple', 'simple.c') +libver = '1.0' +h = install_headers('simple.h') + +pkgg.generate( + libraries : [lib, '-lz'], + subdirs : '.', + version : libver, + name : 'libsimple', + filebase : 'simple', + description : 'A simple demo library.', + variables : [ 'this_should_be_key_value' ] +) diff --git a/test cases/failing/49 pkgconfig variables not key value/simple.c b/test cases/failing/49 pkgconfig variables not key value/simple.c new file mode 100644 index 000000000..e8a6d8330 --- /dev/null +++ b/test cases/failing/49 pkgconfig variables not key value/simple.c @@ -0,0 +1,5 @@ +#include"simple.h" + +int simple_function() { + return 42; +} diff --git a/test cases/failing/49 pkgconfig variables not key value/simple.h b/test cases/failing/49 pkgconfig variables not key value/simple.h new file mode 100644 index 000000000..bb52e6d72 --- /dev/null +++ b/test cases/failing/49 pkgconfig variables not key value/simple.h @@ -0,0 +1,6 @@ +#ifndef SIMPLE_H_ +#define SIMPLE_H_ + +int simple_function(); + +#endif diff --git a/test cases/failing/49 pkgconfig variables zero length value/meson.build b/test cases/failing/49 pkgconfig variables zero length value/meson.build deleted file mode 100644 index 33977b273..000000000 --- a/test cases/failing/49 pkgconfig variables zero length value/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('variables-zero-length-value-test', 'c', version : '1.0') - -pkgg = import('pkgconfig') -lib = shared_library('simple', 'simple.c') -libver = '1.0' -h = install_headers('simple.h') - -pkgg.generate( - libraries : [lib, '-lz'], - subdirs : '.', - version : libver, - name : 'libsimple', - filebase : 'simple', - description : 'A simple demo library.', - variables : [ 'key=' ] -) diff --git a/test cases/failing/49 pkgconfig variables zero length value/simple.c b/test cases/failing/49 pkgconfig variables zero length value/simple.c deleted file mode 100644 index e8a6d8330..000000000 --- a/test cases/failing/49 pkgconfig variables zero length value/simple.c +++ /dev/null @@ -1,5 +0,0 @@ -#include"simple.h" - -int simple_function() { - return 42; -} diff --git a/test cases/failing/49 pkgconfig variables zero length value/simple.h b/test cases/failing/49 pkgconfig variables zero length value/simple.h deleted file mode 100644 index bb52e6d72..000000000 --- a/test cases/failing/49 pkgconfig variables zero length value/simple.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SIMPLE_H_ -#define SIMPLE_H_ - -int simple_function(); - -#endif diff --git a/test cases/failing/50 executable comparison/meson.build b/test cases/failing/50 executable comparison/meson.build new file mode 100644 index 000000000..041bcf3d3 --- /dev/null +++ b/test cases/failing/50 executable comparison/meson.build @@ -0,0 +1,6 @@ +project('executable comparison', 'c') + +exe1 = executable('prog1', sources : 'prog.c') +exe2 = executable('prog2', sources : 'prog.c') + +assert(exe1 < exe2, 'should fail') diff --git a/test cases/failing/50 executable comparison/prog.c b/test cases/failing/50 executable comparison/prog.c new file mode 100644 index 000000000..0314ff17b --- /dev/null +++ b/test cases/failing/50 executable comparison/prog.c @@ -0,0 +1 @@ +int main(int argc, char **argv) { return 0; } diff --git a/test cases/failing/50 pkgconfig variables not key value/meson.build b/test cases/failing/50 pkgconfig variables not key value/meson.build deleted file mode 100644 index 02fa7376f..000000000 --- a/test cases/failing/50 pkgconfig variables not key value/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('variables-not-key-value-test', 'c', version : '1.0') - -pkgg = import('pkgconfig') -lib = shared_library('simple', 'simple.c') -libver = '1.0' -h = install_headers('simple.h') - -pkgg.generate( - libraries : [lib, '-lz'], - subdirs : '.', - version : libver, - name : 'libsimple', - filebase : 'simple', - description : 'A simple demo library.', - variables : [ 'this_should_be_key_value' ] -) diff --git a/test cases/failing/50 pkgconfig variables not key value/simple.c b/test cases/failing/50 pkgconfig variables not key value/simple.c deleted file mode 100644 index e8a6d8330..000000000 --- a/test cases/failing/50 pkgconfig variables not key value/simple.c +++ /dev/null @@ -1,5 +0,0 @@ -#include"simple.h" - -int simple_function() { - return 42; -} diff --git a/test cases/failing/50 pkgconfig variables not key value/simple.h b/test cases/failing/50 pkgconfig variables not key value/simple.h deleted file mode 100644 index bb52e6d72..000000000 --- a/test cases/failing/50 pkgconfig variables not key value/simple.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SIMPLE_H_ -#define SIMPLE_H_ - -int simple_function(); - -#endif diff --git a/test cases/failing/51 executable comparison/meson.build b/test cases/failing/51 executable comparison/meson.build deleted file mode 100644 index 041bcf3d3..000000000 --- a/test cases/failing/51 executable comparison/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('executable comparison', 'c') - -exe1 = executable('prog1', sources : 'prog.c') -exe2 = executable('prog2', sources : 'prog.c') - -assert(exe1 < exe2, 'should fail') diff --git a/test cases/failing/51 executable comparison/prog.c b/test cases/failing/51 executable comparison/prog.c deleted file mode 100644 index 0314ff17b..000000000 --- a/test cases/failing/51 executable comparison/prog.c +++ /dev/null @@ -1 +0,0 @@ -int main(int argc, char **argv) { return 0; } diff --git a/test cases/failing/51 inconsistent comparison/meson.build b/test cases/failing/51 inconsistent comparison/meson.build new file mode 100644 index 000000000..7694c2cd2 --- /dev/null +++ b/test cases/failing/51 inconsistent comparison/meson.build @@ -0,0 +1,7 @@ +project('kwarg before arg', 'c') + +# All of these should fail, though only the first one will error out if +# everything's working correctly. +assert([] < 'st', 'should fail') +assert([] < 1, 'should fail') +assert(2 < 'st', 'should fail') diff --git a/test cases/failing/52 inconsistent comparison/meson.build b/test cases/failing/52 inconsistent comparison/meson.build deleted file mode 100644 index 7694c2cd2..000000000 --- a/test cases/failing/52 inconsistent comparison/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('kwarg before arg', 'c') - -# All of these should fail, though only the first one will error out if -# everything's working correctly. -assert([] < 'st', 'should fail') -assert([] < 1, 'should fail') -assert(2 < 'st', 'should fail') diff --git a/test cases/failing/52 slashname/meson.build b/test cases/failing/52 slashname/meson.build new file mode 100644 index 000000000..bba5301bf --- /dev/null +++ b/test cases/failing/52 slashname/meson.build @@ -0,0 +1,12 @@ +project('slashname', 'c') + +# Traverse this subdir so the corresponding dir +# is created inside the build dir. +subdir('sub') + +# Try to create an executable that would go in the "sub" dir +# inside the build dir. This is prohibited. +executable('sub/prog', pf) + +error('Re-enable me once slash in name is finally prohibited.') + diff --git a/test cases/failing/52 slashname/sub/meson.build b/test cases/failing/52 slashname/sub/meson.build new file mode 100644 index 000000000..e10489001 --- /dev/null +++ b/test cases/failing/52 slashname/sub/meson.build @@ -0,0 +1,2 @@ +pf = files('prog.c') + diff --git a/test cases/failing/52 slashname/sub/prog.c b/test cases/failing/52 slashname/sub/prog.c new file mode 100644 index 000000000..722de0abe --- /dev/null +++ b/test cases/failing/52 slashname/sub/prog.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I should not be run ever.\n"); + return 1; +} diff --git a/test cases/failing/53 reserved meson prefix/meson-foo/meson.build b/test cases/failing/53 reserved meson prefix/meson-foo/meson.build new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/failing/53 reserved meson prefix/meson.build b/test cases/failing/53 reserved meson prefix/meson.build new file mode 100644 index 000000000..1339035ad --- /dev/null +++ b/test cases/failing/53 reserved meson prefix/meson.build @@ -0,0 +1,3 @@ +project('test') + +subdir('meson-foo') diff --git a/test cases/failing/53 slashname/meson.build b/test cases/failing/53 slashname/meson.build deleted file mode 100644 index bba5301bf..000000000 --- a/test cases/failing/53 slashname/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -project('slashname', 'c') - -# Traverse this subdir so the corresponding dir -# is created inside the build dir. -subdir('sub') - -# Try to create an executable that would go in the "sub" dir -# inside the build dir. This is prohibited. -executable('sub/prog', pf) - -error('Re-enable me once slash in name is finally prohibited.') - diff --git a/test cases/failing/53 slashname/sub/meson.build b/test cases/failing/53 slashname/sub/meson.build deleted file mode 100644 index e10489001..000000000 --- a/test cases/failing/53 slashname/sub/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -pf = files('prog.c') - diff --git a/test cases/failing/53 slashname/sub/prog.c b/test cases/failing/53 slashname/sub/prog.c deleted file mode 100644 index 722de0abe..000000000 --- a/test cases/failing/53 slashname/sub/prog.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I should not be run ever.\n"); - return 1; -} diff --git a/test cases/failing/54 reserved meson prefix/meson-foo/meson.build b/test cases/failing/54 reserved meson prefix/meson-foo/meson.build deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/failing/54 reserved meson prefix/meson.build b/test cases/failing/54 reserved meson prefix/meson.build deleted file mode 100644 index 1339035ad..000000000 --- a/test cases/failing/54 reserved meson prefix/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('test') - -subdir('meson-foo') diff --git a/test cases/failing/54 wrong shared crate type/foo.rs b/test cases/failing/54 wrong shared crate type/foo.rs new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/failing/54 wrong shared crate type/meson.build b/test cases/failing/54 wrong shared crate type/meson.build new file mode 100644 index 000000000..69ac3dad5 --- /dev/null +++ b/test cases/failing/54 wrong shared crate type/meson.build @@ -0,0 +1,3 @@ +project('test', 'rust') + +shared_library('test', 'foo.rs', rust_crate_type : 'staticlib') diff --git a/test cases/failing/55 wrong shared crate type/foo.rs b/test cases/failing/55 wrong shared crate type/foo.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/failing/55 wrong shared crate type/meson.build b/test cases/failing/55 wrong shared crate type/meson.build deleted file mode 100644 index 69ac3dad5..000000000 --- a/test cases/failing/55 wrong shared crate type/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('test', 'rust') - -shared_library('test', 'foo.rs', rust_crate_type : 'staticlib') diff --git a/test cases/failing/55 wrong static crate type/foo.rs b/test cases/failing/55 wrong static crate type/foo.rs new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/failing/55 wrong static crate type/meson.build b/test cases/failing/55 wrong static crate type/meson.build new file mode 100644 index 000000000..c094613b2 --- /dev/null +++ b/test cases/failing/55 wrong static crate type/meson.build @@ -0,0 +1,3 @@ +project('test', 'rust') + +static_library('test', 'foo.rs', rust_crate_type : 'cdylib') diff --git a/test cases/failing/56 or on new line/meson.build b/test cases/failing/56 or on new line/meson.build new file mode 100644 index 000000000..12f27058d --- /dev/null +++ b/test cases/failing/56 or on new line/meson.build @@ -0,0 +1,7 @@ +project('silent_or', 'c') + +if get_option('foo') == 'true' + or get_option('foo') == 'auto' +else + message('If this message is printed then something is wrong. The or above should give a syntax error.') +endif diff --git a/test cases/failing/56 or on new line/meson_options.txt b/test cases/failing/56 or on new line/meson_options.txt new file mode 100644 index 000000000..3302cf4ec --- /dev/null +++ b/test cases/failing/56 or on new line/meson_options.txt @@ -0,0 +1 @@ +option('foo', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto') diff --git a/test cases/failing/56 wrong static crate type/foo.rs b/test cases/failing/56 wrong static crate type/foo.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/failing/56 wrong static crate type/meson.build b/test cases/failing/56 wrong static crate type/meson.build deleted file mode 100644 index c094613b2..000000000 --- a/test cases/failing/56 wrong static crate type/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('test', 'rust') - -static_library('test', 'foo.rs', rust_crate_type : 'cdylib') diff --git a/test cases/failing/57 kwarg in module/meson.build b/test cases/failing/57 kwarg in module/meson.build new file mode 100644 index 000000000..b105db152 --- /dev/null +++ b/test cases/failing/57 kwarg in module/meson.build @@ -0,0 +1,5 @@ +project('module test', 'c') + +modtest = import('modtest', i_cause: 'a_build_failure') +modtest.print_hello() + diff --git a/test cases/failing/57 or on new line/meson.build b/test cases/failing/57 or on new line/meson.build deleted file mode 100644 index 12f27058d..000000000 --- a/test cases/failing/57 or on new line/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('silent_or', 'c') - -if get_option('foo') == 'true' - or get_option('foo') == 'auto' -else - message('If this message is printed then something is wrong. The or above should give a syntax error.') -endif diff --git a/test cases/failing/57 or on new line/meson_options.txt b/test cases/failing/57 or on new line/meson_options.txt deleted file mode 100644 index 3302cf4ec..000000000 --- a/test cases/failing/57 or on new line/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('foo', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto') diff --git a/test cases/failing/58 kwarg in module/meson.build b/test cases/failing/58 kwarg in module/meson.build deleted file mode 100644 index b105db152..000000000 --- a/test cases/failing/58 kwarg in module/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('module test', 'c') - -modtest = import('modtest', i_cause: 'a_build_failure') -modtest.print_hello() - diff --git a/test cases/failing/58 link with executable/meson.build b/test cases/failing/58 link with executable/meson.build new file mode 100644 index 000000000..186b3e595 --- /dev/null +++ b/test cases/failing/58 link with executable/meson.build @@ -0,0 +1,4 @@ +project('link with exe', 'c') + +e = executable('prog', 'prog.c') +m = shared_module('module', 'module.c', link_with: e) diff --git a/test cases/failing/58 link with executable/module.c b/test cases/failing/58 link with executable/module.c new file mode 100644 index 000000000..dc0124a24 --- /dev/null +++ b/test cases/failing/58 link with executable/module.c @@ -0,0 +1,4 @@ + +int func(void) { + return 42; +} diff --git a/test cases/failing/58 link with executable/prog.c b/test cases/failing/58 link with executable/prog.c new file mode 100644 index 000000000..f3836d7ba --- /dev/null +++ b/test cases/failing/58 link with executable/prog.c @@ -0,0 +1,5 @@ +int +main (int argc, char **argv) +{ + return 0; +} diff --git a/test cases/failing/59 assign custom target index/meson.build b/test cases/failing/59 assign custom target index/meson.build new file mode 100644 index 000000000..7f2a820b8 --- /dev/null +++ b/test cases/failing/59 assign custom target index/meson.build @@ -0,0 +1,24 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +prog_python = import('python3').find_python() + +target = custom_target( + 'target', + output : ['1', '2'], + command : [prog_python, '-c', + 'with open("1", "w") as f: f.write("foo"); with open("2", "w") as f: f.write("foo")'], +) + +target[0] = 'foo' diff --git a/test cases/failing/59 link with executable/meson.build b/test cases/failing/59 link with executable/meson.build deleted file mode 100644 index 186b3e595..000000000 --- a/test cases/failing/59 link with executable/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('link with exe', 'c') - -e = executable('prog', 'prog.c') -m = shared_module('module', 'module.c', link_with: e) diff --git a/test cases/failing/59 link with executable/module.c b/test cases/failing/59 link with executable/module.c deleted file mode 100644 index dc0124a24..000000000 --- a/test cases/failing/59 link with executable/module.c +++ /dev/null @@ -1,4 +0,0 @@ - -int func(void) { - return 42; -} diff --git a/test cases/failing/59 link with executable/prog.c b/test cases/failing/59 link with executable/prog.c deleted file mode 100644 index f3836d7ba..000000000 --- a/test cases/failing/59 link with executable/prog.c +++ /dev/null @@ -1,5 +0,0 @@ -int -main (int argc, char **argv) -{ - return 0; -} diff --git a/test cases/failing/60 assign custom target index/meson.build b/test cases/failing/60 assign custom target index/meson.build deleted file mode 100644 index 7f2a820b8..000000000 --- a/test cases/failing/60 assign custom target index/meson.build +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -prog_python = import('python3').find_python() - -target = custom_target( - 'target', - output : ['1', '2'], - command : [prog_python, '-c', - 'with open("1", "w") as f: f.write("foo"); with open("2", "w") as f: f.write("foo")'], -) - -target[0] = 'foo' diff --git a/test cases/failing/60 getoption prefix/meson.build b/test cases/failing/60 getoption prefix/meson.build new file mode 100644 index 000000000..8f85cff2a --- /dev/null +++ b/test cases/failing/60 getoption prefix/meson.build @@ -0,0 +1,5 @@ +project('getopt prefix') + +subproject('abc') + +get_option('abc:foo') diff --git a/test cases/failing/60 getoption prefix/subprojects/abc/meson.build b/test cases/failing/60 getoption prefix/subprojects/abc/meson.build new file mode 100644 index 000000000..aa9c3df0f --- /dev/null +++ b/test cases/failing/60 getoption prefix/subprojects/abc/meson.build @@ -0,0 +1 @@ +project('abc', 'c') diff --git a/test cases/failing/60 getoption prefix/subprojects/abc/meson_options.txt b/test cases/failing/60 getoption prefix/subprojects/abc/meson_options.txt new file mode 100644 index 000000000..89e624e24 --- /dev/null +++ b/test cases/failing/60 getoption prefix/subprojects/abc/meson_options.txt @@ -0,0 +1 @@ +option('foo', type : 'boolean') diff --git a/test cases/failing/61 bad option argument/meson.build b/test cases/failing/61 bad option argument/meson.build new file mode 100644 index 000000000..5219cfb96 --- /dev/null +++ b/test cases/failing/61 bad option argument/meson.build @@ -0,0 +1,3 @@ +project('bad option') + +get_option('name') diff --git a/test cases/failing/61 bad option argument/meson_options.txt b/test cases/failing/61 bad option argument/meson_options.txt new file mode 100644 index 000000000..de1fff6fb --- /dev/null +++ b/test cases/failing/61 bad option argument/meson_options.txt @@ -0,0 +1 @@ +option('name', type : 'string', vaule : 'foo') diff --git a/test cases/failing/61 getoption prefix/meson.build b/test cases/failing/61 getoption prefix/meson.build deleted file mode 100644 index 8f85cff2a..000000000 --- a/test cases/failing/61 getoption prefix/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('getopt prefix') - -subproject('abc') - -get_option('abc:foo') diff --git a/test cases/failing/61 getoption prefix/subprojects/abc/meson.build b/test cases/failing/61 getoption prefix/subprojects/abc/meson.build deleted file mode 100644 index aa9c3df0f..000000000 --- a/test cases/failing/61 getoption prefix/subprojects/abc/meson.build +++ /dev/null @@ -1 +0,0 @@ -project('abc', 'c') diff --git a/test cases/failing/61 getoption prefix/subprojects/abc/meson_options.txt b/test cases/failing/61 getoption prefix/subprojects/abc/meson_options.txt deleted file mode 100644 index 89e624e24..000000000 --- a/test cases/failing/61 getoption prefix/subprojects/abc/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('foo', type : 'boolean') diff --git a/test cases/failing/62 bad option argument/meson.build b/test cases/failing/62 bad option argument/meson.build deleted file mode 100644 index 5219cfb96..000000000 --- a/test cases/failing/62 bad option argument/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('bad option') - -get_option('name') diff --git a/test cases/failing/62 bad option argument/meson_options.txt b/test cases/failing/62 bad option argument/meson_options.txt deleted file mode 100644 index de1fff6fb..000000000 --- a/test cases/failing/62 bad option argument/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('name', type : 'string', vaule : 'foo') diff --git a/test cases/failing/62 subproj filegrab/meson.build b/test cases/failing/62 subproj filegrab/meson.build new file mode 100644 index 000000000..f38d6c74c --- /dev/null +++ b/test cases/failing/62 subproj filegrab/meson.build @@ -0,0 +1,5 @@ +project('mainproj', 'c') + +# Try to grab a file from a parent project. + +subproject('a') diff --git a/test cases/failing/62 subproj filegrab/prog.c b/test cases/failing/62 subproj filegrab/prog.c new file mode 100644 index 000000000..0314ff17b --- /dev/null +++ b/test cases/failing/62 subproj filegrab/prog.c @@ -0,0 +1 @@ +int main(int argc, char **argv) { return 0; } diff --git a/test cases/failing/62 subproj filegrab/subprojects/a/meson.build b/test cases/failing/62 subproj filegrab/subprojects/a/meson.build new file mode 100644 index 000000000..80b988804 --- /dev/null +++ b/test cases/failing/62 subproj filegrab/subprojects/a/meson.build @@ -0,0 +1,3 @@ +project('a', 'c') + +executable('prog', '../../prog.c') diff --git a/test cases/failing/63 grab subproj/meson.build b/test cases/failing/63 grab subproj/meson.build new file mode 100644 index 000000000..30fc69093 --- /dev/null +++ b/test cases/failing/63 grab subproj/meson.build @@ -0,0 +1,7 @@ +project('grabber', 'c') + +# Try to grab a file from a child subproject. + +subproject('foo') + +executable('foo', 'subprojects/foo/sub.c') diff --git a/test cases/failing/63 grab subproj/subprojects/foo/meson.build b/test cases/failing/63 grab subproj/subprojects/foo/meson.build new file mode 100644 index 000000000..b346f6d9a --- /dev/null +++ b/test cases/failing/63 grab subproj/subprojects/foo/meson.build @@ -0,0 +1,3 @@ +project('foo', 'c') + +message('I do nothing.') diff --git a/test cases/failing/63 grab subproj/subprojects/foo/sub.c b/test cases/failing/63 grab subproj/subprojects/foo/sub.c new file mode 100644 index 000000000..a94b1f5ad --- /dev/null +++ b/test cases/failing/63 grab subproj/subprojects/foo/sub.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I am a subproject executable file.\n"); + return 0; +} diff --git a/test cases/failing/63 subproj filegrab/meson.build b/test cases/failing/63 subproj filegrab/meson.build deleted file mode 100644 index f38d6c74c..000000000 --- a/test cases/failing/63 subproj filegrab/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('mainproj', 'c') - -# Try to grab a file from a parent project. - -subproject('a') diff --git a/test cases/failing/63 subproj filegrab/prog.c b/test cases/failing/63 subproj filegrab/prog.c deleted file mode 100644 index 0314ff17b..000000000 --- a/test cases/failing/63 subproj filegrab/prog.c +++ /dev/null @@ -1 +0,0 @@ -int main(int argc, char **argv) { return 0; } diff --git a/test cases/failing/63 subproj filegrab/subprojects/a/meson.build b/test cases/failing/63 subproj filegrab/subprojects/a/meson.build deleted file mode 100644 index 80b988804..000000000 --- a/test cases/failing/63 subproj filegrab/subprojects/a/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('a', 'c') - -executable('prog', '../../prog.c') diff --git a/test cases/failing/64 grab sibling/meson.build b/test cases/failing/64 grab sibling/meson.build new file mode 100644 index 000000000..60b926a95 --- /dev/null +++ b/test cases/failing/64 grab sibling/meson.build @@ -0,0 +1,3 @@ +project('master', 'c') + +subproject('a') diff --git a/test cases/failing/64 grab sibling/subprojects/a/meson.build b/test cases/failing/64 grab sibling/subprojects/a/meson.build new file mode 100644 index 000000000..6dd9f61fc --- /dev/null +++ b/test cases/failing/64 grab sibling/subprojects/a/meson.build @@ -0,0 +1,3 @@ +project('a', 'c') + +executable('sneaky', '../b/sneaky.c') diff --git a/test cases/failing/64 grab sibling/subprojects/b/meson.build b/test cases/failing/64 grab sibling/subprojects/b/meson.build new file mode 100644 index 000000000..7c70fe55b --- /dev/null +++ b/test cases/failing/64 grab sibling/subprojects/b/meson.build @@ -0,0 +1,3 @@ +projecT('b', 'c') + +message('I do nothing.') diff --git a/test cases/failing/64 grab sibling/subprojects/b/sneaky.c b/test cases/failing/64 grab sibling/subprojects/b/sneaky.c new file mode 100644 index 000000000..46718c6cc --- /dev/null +++ b/test cases/failing/64 grab sibling/subprojects/b/sneaky.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I can only come into existence via trickery.\n"); + return 0; +} diff --git a/test cases/failing/64 grab subproj/meson.build b/test cases/failing/64 grab subproj/meson.build deleted file mode 100644 index 30fc69093..000000000 --- a/test cases/failing/64 grab subproj/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('grabber', 'c') - -# Try to grab a file from a child subproject. - -subproject('foo') - -executable('foo', 'subprojects/foo/sub.c') diff --git a/test cases/failing/64 grab subproj/subprojects/foo/meson.build b/test cases/failing/64 grab subproj/subprojects/foo/meson.build deleted file mode 100644 index b346f6d9a..000000000 --- a/test cases/failing/64 grab subproj/subprojects/foo/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('foo', 'c') - -message('I do nothing.') diff --git a/test cases/failing/64 grab subproj/subprojects/foo/sub.c b/test cases/failing/64 grab subproj/subprojects/foo/sub.c deleted file mode 100644 index a94b1f5ad..000000000 --- a/test cases/failing/64 grab subproj/subprojects/foo/sub.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I am a subproject executable file.\n"); - return 0; -} diff --git a/test cases/failing/65 grab sibling/meson.build b/test cases/failing/65 grab sibling/meson.build deleted file mode 100644 index 60b926a95..000000000 --- a/test cases/failing/65 grab sibling/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('master', 'c') - -subproject('a') diff --git a/test cases/failing/65 grab sibling/subprojects/a/meson.build b/test cases/failing/65 grab sibling/subprojects/a/meson.build deleted file mode 100644 index 6dd9f61fc..000000000 --- a/test cases/failing/65 grab sibling/subprojects/a/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('a', 'c') - -executable('sneaky', '../b/sneaky.c') diff --git a/test cases/failing/65 grab sibling/subprojects/b/meson.build b/test cases/failing/65 grab sibling/subprojects/b/meson.build deleted file mode 100644 index 7c70fe55b..000000000 --- a/test cases/failing/65 grab sibling/subprojects/b/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -projecT('b', 'c') - -message('I do nothing.') diff --git a/test cases/failing/65 grab sibling/subprojects/b/sneaky.c b/test cases/failing/65 grab sibling/subprojects/b/sneaky.c deleted file mode 100644 index 46718c6cc..000000000 --- a/test cases/failing/65 grab sibling/subprojects/b/sneaky.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I can only come into existence via trickery.\n"); - return 0; -} diff --git a/test cases/failing/65 string as link target/meson.build b/test cases/failing/65 string as link target/meson.build new file mode 100644 index 000000000..cb83fff6a --- /dev/null +++ b/test cases/failing/65 string as link target/meson.build @@ -0,0 +1,2 @@ +project('string as link argument', 'c') +executable('myprog', 'prog.c', link_with: [ '' ]) diff --git a/test cases/failing/65 string as link target/prog.c b/test cases/failing/65 string as link target/prog.c new file mode 100644 index 000000000..0314ff17b --- /dev/null +++ b/test cases/failing/65 string as link target/prog.c @@ -0,0 +1 @@ +int main(int argc, char **argv) { return 0; } diff --git a/test cases/failing/66 dependency not-found and required/meson.build b/test cases/failing/66 dependency not-found and required/meson.build new file mode 100644 index 000000000..1ce574738 --- /dev/null +++ b/test cases/failing/66 dependency not-found and required/meson.build @@ -0,0 +1,2 @@ +project('dep-test') +dep = dependency('', required:true) diff --git a/test cases/failing/66 string as link target/meson.build b/test cases/failing/66 string as link target/meson.build deleted file mode 100644 index cb83fff6a..000000000 --- a/test cases/failing/66 string as link target/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('string as link argument', 'c') -executable('myprog', 'prog.c', link_with: [ '' ]) diff --git a/test cases/failing/66 string as link target/prog.c b/test cases/failing/66 string as link target/prog.c deleted file mode 100644 index 0314ff17b..000000000 --- a/test cases/failing/66 string as link target/prog.c +++ /dev/null @@ -1 +0,0 @@ -int main(int argc, char **argv) { return 0; } diff --git a/test cases/failing/67 dependency not-found and required/meson.build b/test cases/failing/67 dependency not-found and required/meson.build deleted file mode 100644 index 1ce574738..000000000 --- a/test cases/failing/67 dependency not-found and required/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('dep-test') -dep = dependency('', required:true) diff --git a/test cases/failing/67 subproj different versions/main.c b/test cases/failing/67 subproj different versions/main.c new file mode 100644 index 000000000..8793c623a --- /dev/null +++ b/test cases/failing/67 subproj different versions/main.c @@ -0,0 +1,9 @@ +#include +#include "a.h" +#include "b.h" + +int main(int argc, char **argv) { + int life = a_fun() + b_fun(); + printf("%d\n", life); + return 0; +} diff --git a/test cases/failing/67 subproj different versions/meson.build b/test cases/failing/67 subproj different versions/meson.build new file mode 100644 index 000000000..e964e423e --- /dev/null +++ b/test cases/failing/67 subproj different versions/meson.build @@ -0,0 +1,9 @@ +project('super', 'c') + +# A will use version 1 of C +a_dep = dependency('a', fallback: ['a', 'a_dep']) + +# B will fail because it requests version 2 of C +b_dep = dependency('b', fallback: ['b', 'b_dep']) + +main = executable('main', files('main.c'), dependencies: [a_dep, b_dep]) diff --git a/test cases/failing/67 subproj different versions/subprojects/a/a.c b/test cases/failing/67 subproj different versions/subprojects/a/a.c new file mode 100644 index 000000000..cd41a6588 --- /dev/null +++ b/test cases/failing/67 subproj different versions/subprojects/a/a.c @@ -0,0 +1,5 @@ +#include "c.h" + +int a_fun() { + return c_fun(); +} diff --git a/test cases/failing/67 subproj different versions/subprojects/a/a.h b/test cases/failing/67 subproj different versions/subprojects/a/a.h new file mode 100644 index 000000000..8f1d49eda --- /dev/null +++ b/test cases/failing/67 subproj different versions/subprojects/a/a.h @@ -0,0 +1 @@ +int a_fun(); diff --git a/test cases/failing/67 subproj different versions/subprojects/a/meson.build b/test cases/failing/67 subproj different versions/subprojects/a/meson.build new file mode 100644 index 000000000..e84182a07 --- /dev/null +++ b/test cases/failing/67 subproj different versions/subprojects/a/meson.build @@ -0,0 +1,11 @@ +project('a', 'c') + +c_dep = dependency('c', version:'1', fallback: ['c', 'c_dep']) + +alib = library('a', 'a.c', + dependencies: c_dep) + +a_dep = declare_dependency( + link_with: alib, + include_directories: include_directories('.'), +) diff --git a/test cases/failing/67 subproj different versions/subprojects/b/b.c b/test cases/failing/67 subproj different versions/subprojects/b/b.c new file mode 100644 index 000000000..f85f8c3f8 --- /dev/null +++ b/test cases/failing/67 subproj different versions/subprojects/b/b.c @@ -0,0 +1,5 @@ +#include "c.h" + +int b_fun(){ +return c_fun(); +} diff --git a/test cases/failing/67 subproj different versions/subprojects/b/b.h b/test cases/failing/67 subproj different versions/subprojects/b/b.h new file mode 100644 index 000000000..eced786a0 --- /dev/null +++ b/test cases/failing/67 subproj different versions/subprojects/b/b.h @@ -0,0 +1 @@ +int b_fun(); diff --git a/test cases/failing/67 subproj different versions/subprojects/b/meson.build b/test cases/failing/67 subproj different versions/subprojects/b/meson.build new file mode 100644 index 000000000..0398340e6 --- /dev/null +++ b/test cases/failing/67 subproj different versions/subprojects/b/meson.build @@ -0,0 +1,11 @@ +project('b', 'c') + +c_dep = dependency('c', version:'2', fallback: ['c', 'c_dep']) + +blib = library('b', 'b.c', + dependencies: c_dep) + +b_dep = declare_dependency( + link_with: blib, + include_directories: include_directories('.'), +) diff --git a/test cases/failing/67 subproj different versions/subprojects/c/c.h b/test cases/failing/67 subproj different versions/subprojects/c/c.h new file mode 100644 index 000000000..2b15f607c --- /dev/null +++ b/test cases/failing/67 subproj different versions/subprojects/c/c.h @@ -0,0 +1,3 @@ +static int c_fun(){ + return 3; +} diff --git a/test cases/failing/67 subproj different versions/subprojects/c/meson.build b/test cases/failing/67 subproj different versions/subprojects/c/meson.build new file mode 100644 index 000000000..7184933b2 --- /dev/null +++ b/test cases/failing/67 subproj different versions/subprojects/c/meson.build @@ -0,0 +1,5 @@ +project('c', 'c', version:'1') + +c_dep = declare_dependency( + include_directories: include_directories('.') +) diff --git a/test cases/failing/68 subproj different versions/main.c b/test cases/failing/68 subproj different versions/main.c deleted file mode 100644 index 8793c623a..000000000 --- a/test cases/failing/68 subproj different versions/main.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include "a.h" -#include "b.h" - -int main(int argc, char **argv) { - int life = a_fun() + b_fun(); - printf("%d\n", life); - return 0; -} diff --git a/test cases/failing/68 subproj different versions/meson.build b/test cases/failing/68 subproj different versions/meson.build deleted file mode 100644 index e964e423e..000000000 --- a/test cases/failing/68 subproj different versions/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -project('super', 'c') - -# A will use version 1 of C -a_dep = dependency('a', fallback: ['a', 'a_dep']) - -# B will fail because it requests version 2 of C -b_dep = dependency('b', fallback: ['b', 'b_dep']) - -main = executable('main', files('main.c'), dependencies: [a_dep, b_dep]) diff --git a/test cases/failing/68 subproj different versions/subprojects/a/a.c b/test cases/failing/68 subproj different versions/subprojects/a/a.c deleted file mode 100644 index cd41a6588..000000000 --- a/test cases/failing/68 subproj different versions/subprojects/a/a.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "c.h" - -int a_fun() { - return c_fun(); -} diff --git a/test cases/failing/68 subproj different versions/subprojects/a/a.h b/test cases/failing/68 subproj different versions/subprojects/a/a.h deleted file mode 100644 index 8f1d49eda..000000000 --- a/test cases/failing/68 subproj different versions/subprojects/a/a.h +++ /dev/null @@ -1 +0,0 @@ -int a_fun(); diff --git a/test cases/failing/68 subproj different versions/subprojects/a/meson.build b/test cases/failing/68 subproj different versions/subprojects/a/meson.build deleted file mode 100644 index e84182a07..000000000 --- a/test cases/failing/68 subproj different versions/subprojects/a/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('a', 'c') - -c_dep = dependency('c', version:'1', fallback: ['c', 'c_dep']) - -alib = library('a', 'a.c', - dependencies: c_dep) - -a_dep = declare_dependency( - link_with: alib, - include_directories: include_directories('.'), -) diff --git a/test cases/failing/68 subproj different versions/subprojects/b/b.c b/test cases/failing/68 subproj different versions/subprojects/b/b.c deleted file mode 100644 index f85f8c3f8..000000000 --- a/test cases/failing/68 subproj different versions/subprojects/b/b.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "c.h" - -int b_fun(){ -return c_fun(); -} diff --git a/test cases/failing/68 subproj different versions/subprojects/b/b.h b/test cases/failing/68 subproj different versions/subprojects/b/b.h deleted file mode 100644 index eced786a0..000000000 --- a/test cases/failing/68 subproj different versions/subprojects/b/b.h +++ /dev/null @@ -1 +0,0 @@ -int b_fun(); diff --git a/test cases/failing/68 subproj different versions/subprojects/b/meson.build b/test cases/failing/68 subproj different versions/subprojects/b/meson.build deleted file mode 100644 index 0398340e6..000000000 --- a/test cases/failing/68 subproj different versions/subprojects/b/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('b', 'c') - -c_dep = dependency('c', version:'2', fallback: ['c', 'c_dep']) - -blib = library('b', 'b.c', - dependencies: c_dep) - -b_dep = declare_dependency( - link_with: blib, - include_directories: include_directories('.'), -) diff --git a/test cases/failing/68 subproj different versions/subprojects/c/c.h b/test cases/failing/68 subproj different versions/subprojects/c/c.h deleted file mode 100644 index 2b15f607c..000000000 --- a/test cases/failing/68 subproj different versions/subprojects/c/c.h +++ /dev/null @@ -1,3 +0,0 @@ -static int c_fun(){ - return 3; -} diff --git a/test cases/failing/68 subproj different versions/subprojects/c/meson.build b/test cases/failing/68 subproj different versions/subprojects/c/meson.build deleted file mode 100644 index 7184933b2..000000000 --- a/test cases/failing/68 subproj different versions/subprojects/c/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('c', 'c', version:'1') - -c_dep = declare_dependency( - include_directories: include_directories('.') -) diff --git a/test cases/failing/68 wrong boost module/meson.build b/test cases/failing/68 wrong boost module/meson.build new file mode 100644 index 000000000..7fb3a40b2 --- /dev/null +++ b/test cases/failing/68 wrong boost module/meson.build @@ -0,0 +1,5 @@ +project('boosttest', 'cpp', + default_options : ['cpp_std=c++11']) + +# abc doesn't exist +linkdep = dependency('boost', modules : ['thread', 'system', 'test', 'abc']) diff --git a/test cases/failing/69 install_data rename bad size/file1.txt b/test cases/failing/69 install_data rename bad size/file1.txt new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/failing/69 install_data rename bad size/file2.txt b/test cases/failing/69 install_data rename bad size/file2.txt new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/failing/69 install_data rename bad size/meson.build b/test cases/failing/69 install_data rename bad size/meson.build new file mode 100644 index 000000000..c7cde087d --- /dev/null +++ b/test cases/failing/69 install_data rename bad size/meson.build @@ -0,0 +1,3 @@ +project('data install test', 'c') + +install_data(['file1.txt', 'file2.txt'], rename : 'just one name') diff --git a/test cases/failing/69 wrong boost module/meson.build b/test cases/failing/69 wrong boost module/meson.build deleted file mode 100644 index 7fb3a40b2..000000000 --- a/test cases/failing/69 wrong boost module/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('boosttest', 'cpp', - default_options : ['cpp_std=c++11']) - -# abc doesn't exist -linkdep = dependency('boost', modules : ['thread', 'system', 'test', 'abc']) diff --git a/test cases/failing/70 install_data rename bad size/file1.txt b/test cases/failing/70 install_data rename bad size/file1.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/failing/70 install_data rename bad size/file2.txt b/test cases/failing/70 install_data rename bad size/file2.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/failing/70 install_data rename bad size/meson.build b/test cases/failing/70 install_data rename bad size/meson.build deleted file mode 100644 index c7cde087d..000000000 --- a/test cases/failing/70 install_data rename bad size/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('data install test', 'c') - -install_data(['file1.txt', 'file2.txt'], rename : 'just one name') diff --git a/test cases/failing/70 skip only subdir/meson.build b/test cases/failing/70 skip only subdir/meson.build new file mode 100644 index 000000000..4832bd49c --- /dev/null +++ b/test cases/failing/70 skip only subdir/meson.build @@ -0,0 +1,8 @@ +# Check that skip_rest only exits subdir, not the whole script. +# Should create an error because main.cpp does not exists. +project('example exit', 'cpp') + +subdir('subdir') + +message('Good') +executable('main', 'main.cpp') diff --git a/test cases/failing/70 skip only subdir/subdir/meson.build b/test cases/failing/70 skip only subdir/subdir/meson.build new file mode 100644 index 000000000..1ba447b22 --- /dev/null +++ b/test cases/failing/70 skip only subdir/subdir/meson.build @@ -0,0 +1,3 @@ +subdir_done() + +error('Unreachable') diff --git a/test cases/failing/71 invalid escape char/meson.build b/test cases/failing/71 invalid escape char/meson.build new file mode 100644 index 000000000..b4e9196cc --- /dev/null +++ b/test cases/failing/71 invalid escape char/meson.build @@ -0,0 +1,4 @@ +# Make sure meson exits on invalid string +# The string below contains an invalid unicode code point + +'my name is what \uxyzo who are you' diff --git a/test cases/failing/71 skip only subdir/meson.build b/test cases/failing/71 skip only subdir/meson.build deleted file mode 100644 index 4832bd49c..000000000 --- a/test cases/failing/71 skip only subdir/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -# Check that skip_rest only exits subdir, not the whole script. -# Should create an error because main.cpp does not exists. -project('example exit', 'cpp') - -subdir('subdir') - -message('Good') -executable('main', 'main.cpp') diff --git a/test cases/failing/71 skip only subdir/subdir/meson.build b/test cases/failing/71 skip only subdir/subdir/meson.build deleted file mode 100644 index 1ba447b22..000000000 --- a/test cases/failing/71 skip only subdir/subdir/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -subdir_done() - -error('Unreachable') diff --git a/test cases/failing/72 dual override/meson.build b/test cases/failing/72 dual override/meson.build new file mode 100644 index 000000000..e5f86baaf --- /dev/null +++ b/test cases/failing/72 dual override/meson.build @@ -0,0 +1,5 @@ +project('yo dawg', 'c') + +p = find_program('overrides.py') +meson.override_find_program('override', p) +meson.override_find_program('override', p) diff --git a/test cases/failing/72 dual override/overrides.py b/test cases/failing/72 dual override/overrides.py new file mode 100644 index 000000000..49e9b7ad6 --- /dev/null +++ b/test cases/failing/72 dual override/overrides.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python3 + +print('Yo dawg, we put overrides in your overrides,') +print('so now you can override when you override.') diff --git a/test cases/failing/72 invalid escape char/meson.build b/test cases/failing/72 invalid escape char/meson.build deleted file mode 100644 index b4e9196cc..000000000 --- a/test cases/failing/72 invalid escape char/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -# Make sure meson exits on invalid string -# The string below contains an invalid unicode code point - -'my name is what \uxyzo who are you' diff --git a/test cases/failing/73 dual override/meson.build b/test cases/failing/73 dual override/meson.build deleted file mode 100644 index e5f86baaf..000000000 --- a/test cases/failing/73 dual override/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('yo dawg', 'c') - -p = find_program('overrides.py') -meson.override_find_program('override', p) -meson.override_find_program('override', p) diff --git a/test cases/failing/73 dual override/overrides.py b/test cases/failing/73 dual override/overrides.py deleted file mode 100644 index 49e9b7ad6..000000000 --- a/test cases/failing/73 dual override/overrides.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python3 - -print('Yo dawg, we put overrides in your overrides,') -print('so now you can override when you override.') diff --git a/test cases/failing/73 override used/meson.build b/test cases/failing/73 override used/meson.build new file mode 100644 index 000000000..61885bba1 --- /dev/null +++ b/test cases/failing/73 override used/meson.build @@ -0,0 +1,5 @@ +project('overridde an already found exe', 'c') + +old = find_program('something.py') +replacement = find_program('other.py') +meson.override_find_program('something.py', replacement) diff --git a/test cases/failing/73 override used/other.py b/test cases/failing/73 override used/other.py new file mode 100755 index 000000000..f62ba960d --- /dev/null +++ b/test cases/failing/73 override used/other.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 + +print('Doing something else.') diff --git a/test cases/failing/73 override used/something.py b/test cases/failing/73 override used/something.py new file mode 100755 index 000000000..64c9454c3 --- /dev/null +++ b/test cases/failing/73 override used/something.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 + +print('Doing something.') diff --git a/test cases/failing/74 override used/meson.build b/test cases/failing/74 override used/meson.build deleted file mode 100644 index 61885bba1..000000000 --- a/test cases/failing/74 override used/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('overridde an already found exe', 'c') - -old = find_program('something.py') -replacement = find_program('other.py') -meson.override_find_program('something.py', replacement) diff --git a/test cases/failing/74 override used/other.py b/test cases/failing/74 override used/other.py deleted file mode 100755 index f62ba960d..000000000 --- a/test cases/failing/74 override used/other.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python3 - -print('Doing something else.') diff --git a/test cases/failing/74 override used/something.py b/test cases/failing/74 override used/something.py deleted file mode 100755 index 64c9454c3..000000000 --- a/test cases/failing/74 override used/something.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python3 - -print('Doing something.') diff --git a/test cases/failing/74 run_command unclean exit/meson.build b/test cases/failing/74 run_command unclean exit/meson.build new file mode 100644 index 000000000..4bc02ae7b --- /dev/null +++ b/test cases/failing/74 run_command unclean exit/meson.build @@ -0,0 +1,4 @@ +project('run_command unclean exit', 'c') + +rcprog = find_program('./returncode.py') +run_command(rcprog, '1', check : true) diff --git a/test cases/failing/74 run_command unclean exit/returncode.py b/test cases/failing/74 run_command unclean exit/returncode.py new file mode 100755 index 000000000..84dbc5df6 --- /dev/null +++ b/test cases/failing/74 run_command unclean exit/returncode.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python3 + +import sys +exit(int(sys.argv[1])) diff --git a/test cases/failing/75 int literal leading zero/meson.build b/test cases/failing/75 int literal leading zero/meson.build new file mode 100644 index 000000000..7ad64ae09 --- /dev/null +++ b/test cases/failing/75 int literal leading zero/meson.build @@ -0,0 +1,6 @@ + +# This should fail. +# Decimal syntax is 123. +# Octal syntax is 0o123. +fail_0123 = 0123 + diff --git a/test cases/failing/75 run_command unclean exit/meson.build b/test cases/failing/75 run_command unclean exit/meson.build deleted file mode 100644 index 4bc02ae7b..000000000 --- a/test cases/failing/75 run_command unclean exit/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('run_command unclean exit', 'c') - -rcprog = find_program('./returncode.py') -run_command(rcprog, '1', check : true) diff --git a/test cases/failing/75 run_command unclean exit/returncode.py b/test cases/failing/75 run_command unclean exit/returncode.py deleted file mode 100755 index 84dbc5df6..000000000 --- a/test cases/failing/75 run_command unclean exit/returncode.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python3 - -import sys -exit(int(sys.argv[1])) diff --git a/test cases/failing/76 configuration immutable/input b/test cases/failing/76 configuration immutable/input new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/failing/76 configuration immutable/meson.build b/test cases/failing/76 configuration immutable/meson.build new file mode 100644 index 000000000..b6cac4126 --- /dev/null +++ b/test cases/failing/76 configuration immutable/meson.build @@ -0,0 +1,12 @@ +project('configuration_data is immutable') + +a = configuration_data() + +configure_file( + configuration : a, + input : 'input', + output : 'output', +) + +still_immutable = a +still_immutable.set('hello', 'world') diff --git a/test cases/failing/76 int literal leading zero/meson.build b/test cases/failing/76 int literal leading zero/meson.build deleted file mode 100644 index 7ad64ae09..000000000 --- a/test cases/failing/76 int literal leading zero/meson.build +++ /dev/null @@ -1,6 +0,0 @@ - -# This should fail. -# Decimal syntax is 123. -# Octal syntax is 0o123. -fail_0123 = 0123 - diff --git a/test cases/failing/77 configuration immutable/input b/test cases/failing/77 configuration immutable/input deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/failing/77 configuration immutable/meson.build b/test cases/failing/77 configuration immutable/meson.build deleted file mode 100644 index b6cac4126..000000000 --- a/test cases/failing/77 configuration immutable/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -project('configuration_data is immutable') - -a = configuration_data() - -configure_file( - configuration : a, - input : 'input', - output : 'output', -) - -still_immutable = a -still_immutable.set('hello', 'world') diff --git a/test cases/failing/77 link with shared module on osx/meson.build b/test cases/failing/77 link with shared module on osx/meson.build new file mode 100644 index 000000000..2c714f97a --- /dev/null +++ b/test cases/failing/77 link with shared module on osx/meson.build @@ -0,0 +1,8 @@ +project('link with shared module', 'c') + +if host_machine.system() != 'darwin' + error('Test only fails on OSX') +endif + +m = shared_module('mymodule', 'module.c') +e = executable('prog', 'prog.c', link_with : m) diff --git a/test cases/failing/77 link with shared module on osx/module.c b/test cases/failing/77 link with shared module on osx/module.c new file mode 100644 index 000000000..81b0d5af0 --- /dev/null +++ b/test cases/failing/77 link with shared module on osx/module.c @@ -0,0 +1,3 @@ +int func(void) { + return 1496; +} diff --git a/test cases/failing/77 link with shared module on osx/prog.c b/test cases/failing/77 link with shared module on osx/prog.c new file mode 100644 index 000000000..8164d8da1 --- /dev/null +++ b/test cases/failing/77 link with shared module on osx/prog.c @@ -0,0 +1,4 @@ + +int main(int argc, char **argv) { + return func(); +} diff --git a/test cases/failing/78 link with shared module on osx/meson.build b/test cases/failing/78 link with shared module on osx/meson.build deleted file mode 100644 index 2c714f97a..000000000 --- a/test cases/failing/78 link with shared module on osx/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -project('link with shared module', 'c') - -if host_machine.system() != 'darwin' - error('Test only fails on OSX') -endif - -m = shared_module('mymodule', 'module.c') -e = executable('prog', 'prog.c', link_with : m) diff --git a/test cases/failing/78 link with shared module on osx/module.c b/test cases/failing/78 link with shared module on osx/module.c deleted file mode 100644 index 81b0d5af0..000000000 --- a/test cases/failing/78 link with shared module on osx/module.c +++ /dev/null @@ -1,3 +0,0 @@ -int func(void) { - return 1496; -} diff --git a/test cases/failing/78 link with shared module on osx/prog.c b/test cases/failing/78 link with shared module on osx/prog.c deleted file mode 100644 index 8164d8da1..000000000 --- a/test cases/failing/78 link with shared module on osx/prog.c +++ /dev/null @@ -1,4 +0,0 @@ - -int main(int argc, char **argv) { - return func(); -} diff --git a/test cases/failing/78 non ascii in ascii encoded configure file/config9.h.in b/test cases/failing/78 non ascii in ascii encoded configure file/config9.h.in new file mode 100644 index 000000000..323bec64a --- /dev/null +++ b/test cases/failing/78 non ascii in ascii encoded configure file/config9.h.in @@ -0,0 +1 @@ +#define MESSAGE "@var@" diff --git a/test cases/failing/78 non ascii in ascii encoded configure file/meson.build b/test cases/failing/78 non ascii in ascii encoded configure file/meson.build new file mode 100644 index 000000000..846daaf89 --- /dev/null +++ b/test cases/failing/78 non ascii in ascii encoded configure file/meson.build @@ -0,0 +1,10 @@ +project('non acsii to ascii encoding', 'c') +# Writing a non ASCII character with a ASCII encoding should fail +conf9 = configuration_data() +conf9.set('var', 'д') +configure_file( + input : 'config9.h.in', + output : '@BASENAME@', + encoding : 'ascii', + configuration : conf9 +) diff --git a/test cases/failing/79 non ascii in ascii encoded configure file/config9.h.in b/test cases/failing/79 non ascii in ascii encoded configure file/config9.h.in deleted file mode 100644 index 323bec64a..000000000 --- a/test cases/failing/79 non ascii in ascii encoded configure file/config9.h.in +++ /dev/null @@ -1 +0,0 @@ -#define MESSAGE "@var@" diff --git a/test cases/failing/79 non ascii in ascii encoded configure file/meson.build b/test cases/failing/79 non ascii in ascii encoded configure file/meson.build deleted file mode 100644 index 846daaf89..000000000 --- a/test cases/failing/79 non ascii in ascii encoded configure file/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -project('non acsii to ascii encoding', 'c') -# Writing a non ASCII character with a ASCII encoding should fail -conf9 = configuration_data() -conf9.set('var', 'д') -configure_file( - input : 'config9.h.in', - output : '@BASENAME@', - encoding : 'ascii', - configuration : conf9 -) diff --git a/test cases/failing/79 subproj dependency not-found and required/meson.build b/test cases/failing/79 subproj dependency not-found and required/meson.build new file mode 100644 index 000000000..c5a296104 --- /dev/null +++ b/test cases/failing/79 subproj dependency not-found and required/meson.build @@ -0,0 +1,2 @@ +project('dep-test') +missing = dependency('', fallback: ['missing', 'missing_dep'], required: true) diff --git a/test cases/failing/80 subproj dependency not-found and required/meson.build b/test cases/failing/80 subproj dependency not-found and required/meson.build deleted file mode 100644 index c5a296104..000000000 --- a/test cases/failing/80 subproj dependency not-found and required/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('dep-test') -missing = dependency('', fallback: ['missing', 'missing_dep'], required: true) diff --git a/test cases/failing/80 unfound run/meson.build b/test cases/failing/80 unfound run/meson.build new file mode 100644 index 000000000..3f37e9a06 --- /dev/null +++ b/test cases/failing/80 unfound run/meson.build @@ -0,0 +1,4 @@ +project('unfound runtarget') + +exe = find_program('nonexisting_prog', required : false) +run_target('invoke_fail', command : [exe]) diff --git a/test cases/failing/81 unfound run/meson.build b/test cases/failing/81 unfound run/meson.build deleted file mode 100644 index 3f37e9a06..000000000 --- a/test cases/failing/81 unfound run/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('unfound runtarget') - -exe = find_program('nonexisting_prog', required : false) -run_target('invoke_fail', command : [exe]) diff --git a/test cases/objc/4 c++ project objc subproject/master.cpp b/test cases/objc/4 c++ project objc subproject/master.cpp new file mode 100644 index 000000000..2f351d1ca --- /dev/null +++ b/test cases/objc/4 c++ project objc subproject/master.cpp @@ -0,0 +1,11 @@ + +#include + +extern "C" +int foo(); + +int main() { + std::cout << "Starting\n"; + std::cout << foo() << "\n"; + return 0; +} diff --git a/test cases/objc/4 c++ project objc subproject/meson.build b/test cases/objc/4 c++ project objc subproject/meson.build new file mode 100644 index 000000000..8a77dedce --- /dev/null +++ b/test cases/objc/4 c++ project objc subproject/meson.build @@ -0,0 +1,6 @@ +project('master', ['cpp']) + +foo = subproject('foo') +dep = foo.get_variable('foo_dep') + +executable('master', 'master.cpp', dependencies: dep) diff --git a/test cases/objc/4 c++ project objc subproject/subprojects/foo/foo.m b/test cases/objc/4 c++ project objc subproject/subprojects/foo/foo.m new file mode 100644 index 000000000..e193b8681 --- /dev/null +++ b/test cases/objc/4 c++ project objc subproject/subprojects/foo/foo.m @@ -0,0 +1,4 @@ + +int foo() { + return 42; +} diff --git a/test cases/objc/4 c++ project objc subproject/subprojects/foo/meson.build b/test cases/objc/4 c++ project objc subproject/subprojects/foo/meson.build new file mode 100644 index 000000000..2dbf8ab26 --- /dev/null +++ b/test cases/objc/4 c++ project objc subproject/subprojects/foo/meson.build @@ -0,0 +1,5 @@ +project('foo', ['objc']) + +l = static_library('foo', 'foo.m') + +foo_dep = declare_dependency(link_with : l) diff --git a/test cases/objc/6 c++ project objc subproject/master.cpp b/test cases/objc/6 c++ project objc subproject/master.cpp deleted file mode 100644 index 2f351d1ca..000000000 --- a/test cases/objc/6 c++ project objc subproject/master.cpp +++ /dev/null @@ -1,11 +0,0 @@ - -#include - -extern "C" -int foo(); - -int main() { - std::cout << "Starting\n"; - std::cout << foo() << "\n"; - return 0; -} diff --git a/test cases/objc/6 c++ project objc subproject/meson.build b/test cases/objc/6 c++ project objc subproject/meson.build deleted file mode 100644 index 8a77dedce..000000000 --- a/test cases/objc/6 c++ project objc subproject/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('master', ['cpp']) - -foo = subproject('foo') -dep = foo.get_variable('foo_dep') - -executable('master', 'master.cpp', dependencies: dep) diff --git a/test cases/objc/6 c++ project objc subproject/subprojects/foo/foo.m b/test cases/objc/6 c++ project objc subproject/subprojects/foo/foo.m deleted file mode 100644 index e193b8681..000000000 --- a/test cases/objc/6 c++ project objc subproject/subprojects/foo/foo.m +++ /dev/null @@ -1,4 +0,0 @@ - -int foo() { - return 42; -} diff --git a/test cases/objc/6 c++ project objc subproject/subprojects/foo/meson.build b/test cases/objc/6 c++ project objc subproject/subprojects/foo/meson.build deleted file mode 100644 index 2dbf8ab26..000000000 --- a/test cases/objc/6 c++ project objc subproject/subprojects/foo/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('foo', ['objc']) - -l = static_library('foo', 'foo.m') - -foo_dep = declare_dependency(link_with : l) diff --git a/test cases/unit/10 build_rpath/meson.build b/test cases/unit/10 build_rpath/meson.build new file mode 100644 index 000000000..c0bc3bd27 --- /dev/null +++ b/test cases/unit/10 build_rpath/meson.build @@ -0,0 +1,16 @@ +project('build rpath', 'c', 'cpp') + +subdir('sub') +executable('prog', 'prog.c', + link_with : l, + build_rpath : '/foo/bar', + install_rpath : '/baz', + install : true, + ) + +executable('progcxx', 'prog.cc', + link_with : l, + build_rpath : '/foo/bar', + install_rpath : 'baz', + install : true, + ) diff --git a/test cases/unit/10 build_rpath/prog.c b/test cases/unit/10 build_rpath/prog.c new file mode 100644 index 000000000..45b2fa3df --- /dev/null +++ b/test cases/unit/10 build_rpath/prog.c @@ -0,0 +1,5 @@ +int get_stuff(); + +int main(int argc, char **argv) { + return get_stuff(); +} diff --git a/test cases/unit/10 build_rpath/prog.cc b/test cases/unit/10 build_rpath/prog.cc new file mode 100644 index 000000000..c7c212370 --- /dev/null +++ b/test cases/unit/10 build_rpath/prog.cc @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) { + std::string* s = new std::string("Hello"); + delete s; + return 0; +} diff --git a/test cases/unit/10 build_rpath/sub/meson.build b/test cases/unit/10 build_rpath/sub/meson.build new file mode 100644 index 000000000..6879ec666 --- /dev/null +++ b/test cases/unit/10 build_rpath/sub/meson.build @@ -0,0 +1 @@ +l = shared_library('stuff', 'stuff.c') diff --git a/test cases/unit/10 build_rpath/sub/stuff.c b/test cases/unit/10 build_rpath/sub/stuff.c new file mode 100644 index 000000000..d56d8b0ea --- /dev/null +++ b/test cases/unit/10 build_rpath/sub/stuff.c @@ -0,0 +1,3 @@ +int get_stuff() { + return 0; +} diff --git a/test cases/unit/10 d dedup/meson.build b/test cases/unit/10 d dedup/meson.build deleted file mode 100644 index 08f3a6c67..000000000 --- a/test cases/unit/10 d dedup/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('d dedup', 'c') - -add_project_arguments('-D', 'FOO', '-D', 'BAR', language : 'c') - -executable('prog', 'prog.c') - diff --git a/test cases/unit/10 d dedup/prog.c b/test cases/unit/10 d dedup/prog.c deleted file mode 100644 index 505f12280..000000000 --- a/test cases/unit/10 d dedup/prog.c +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#ifndef FOO -#error FOO is not defined. -#endif - -#ifndef BAR -#error BAR is not defined. -#endif - -int main(int argc, char **argv) { - printf("All is well.\n"); - return 0; -} diff --git a/test cases/unit/11 build_rpath/meson.build b/test cases/unit/11 build_rpath/meson.build deleted file mode 100644 index c0bc3bd27..000000000 --- a/test cases/unit/11 build_rpath/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('build rpath', 'c', 'cpp') - -subdir('sub') -executable('prog', 'prog.c', - link_with : l, - build_rpath : '/foo/bar', - install_rpath : '/baz', - install : true, - ) - -executable('progcxx', 'prog.cc', - link_with : l, - build_rpath : '/foo/bar', - install_rpath : 'baz', - install : true, - ) diff --git a/test cases/unit/11 build_rpath/prog.c b/test cases/unit/11 build_rpath/prog.c deleted file mode 100644 index 45b2fa3df..000000000 --- a/test cases/unit/11 build_rpath/prog.c +++ /dev/null @@ -1,5 +0,0 @@ -int get_stuff(); - -int main(int argc, char **argv) { - return get_stuff(); -} diff --git a/test cases/unit/11 build_rpath/prog.cc b/test cases/unit/11 build_rpath/prog.cc deleted file mode 100644 index c7c212370..000000000 --- a/test cases/unit/11 build_rpath/prog.cc +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - std::string* s = new std::string("Hello"); - delete s; - return 0; -} diff --git a/test cases/unit/11 build_rpath/sub/meson.build b/test cases/unit/11 build_rpath/sub/meson.build deleted file mode 100644 index 6879ec666..000000000 --- a/test cases/unit/11 build_rpath/sub/meson.build +++ /dev/null @@ -1 +0,0 @@ -l = shared_library('stuff', 'stuff.c') diff --git a/test cases/unit/11 build_rpath/sub/stuff.c b/test cases/unit/11 build_rpath/sub/stuff.c deleted file mode 100644 index d56d8b0ea..000000000 --- a/test cases/unit/11 build_rpath/sub/stuff.c +++ /dev/null @@ -1,3 +0,0 @@ -int get_stuff() { - return 0; -} diff --git a/test cases/unit/11 cross prog/meson.build b/test cases/unit/11 cross prog/meson.build new file mode 100644 index 000000000..a7adeb284 --- /dev/null +++ b/test cases/unit/11 cross prog/meson.build @@ -0,0 +1,16 @@ +project('cross find program', 'c') + +native_exe = find_program('sometool.py', native : true) +cross_exe = find_program('sometool.py') +cross_other_exe = find_program('someothertool.py') + +native_out = run_command(native_exe).stdout().strip() +cross_out = run_command(cross_exe).stdout().strip() +cross_other_out = run_command(cross_other_exe).stdout().strip() + +assert(native_out == 'native', + 'Native output incorrect:' + native_out) +assert(cross_out == 'cross', + 'Cross output incorrect:' + cross_out) +assert(cross_out == cross_other_out, + 'Cross output incorrect:' + cross_other_out) diff --git a/test cases/unit/11 cross prog/some_cross_tool.py b/test cases/unit/11 cross prog/some_cross_tool.py new file mode 100755 index 000000000..1edd10f6a --- /dev/null +++ b/test cases/unit/11 cross prog/some_cross_tool.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +from __future__ import print_function + +print('cross') diff --git a/test cases/unit/11 cross prog/sometool.py b/test cases/unit/11 cross prog/sometool.py new file mode 100755 index 000000000..4c0e3b184 --- /dev/null +++ b/test cases/unit/11 cross prog/sometool.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +from __future__ import print_function + +print('native') diff --git a/test cases/unit/12 cross prog/meson.build b/test cases/unit/12 cross prog/meson.build deleted file mode 100644 index a7adeb284..000000000 --- a/test cases/unit/12 cross prog/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('cross find program', 'c') - -native_exe = find_program('sometool.py', native : true) -cross_exe = find_program('sometool.py') -cross_other_exe = find_program('someothertool.py') - -native_out = run_command(native_exe).stdout().strip() -cross_out = run_command(cross_exe).stdout().strip() -cross_other_out = run_command(cross_other_exe).stdout().strip() - -assert(native_out == 'native', - 'Native output incorrect:' + native_out) -assert(cross_out == 'cross', - 'Cross output incorrect:' + cross_out) -assert(cross_out == cross_other_out, - 'Cross output incorrect:' + cross_other_out) diff --git a/test cases/unit/12 cross prog/some_cross_tool.py b/test cases/unit/12 cross prog/some_cross_tool.py deleted file mode 100755 index 1edd10f6a..000000000 --- a/test cases/unit/12 cross prog/some_cross_tool.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -print('cross') diff --git a/test cases/unit/12 cross prog/sometool.py b/test cases/unit/12 cross prog/sometool.py deleted file mode 100755 index 4c0e3b184..000000000 --- a/test cases/unit/12 cross prog/sometool.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -print('native') diff --git a/test cases/unit/12 promote/meson.build b/test cases/unit/12 promote/meson.build new file mode 100644 index 000000000..066cf36cf --- /dev/null +++ b/test cases/unit/12 promote/meson.build @@ -0,0 +1,5 @@ +project('promotion test', 'c') + +subproject('s1') +subproject('s2') + diff --git a/test cases/unit/12 promote/subprojects/s1/meson.build b/test cases/unit/12 promote/subprojects/s1/meson.build new file mode 100644 index 000000000..88c467bf4 --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s1/meson.build @@ -0,0 +1,7 @@ +project('s1', 'c') + +sc = subproject('scommon') +s3 = subproject('s3') + +executable('s1', 's1.c', + link_with : [sc.get_variable('clib'), s3.get_variable('l')]) diff --git a/test cases/unit/12 promote/subprojects/s1/s1.c b/test cases/unit/12 promote/subprojects/s1/s1.c new file mode 100644 index 000000000..7d1d775c1 --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s1/s1.c @@ -0,0 +1,6 @@ +int func(); +int func2(); + +int main(int argc, char **argv) { + return func() + func2(); +} diff --git a/test cases/unit/12 promote/subprojects/s1/subprojects/s3/meson.build b/test cases/unit/12 promote/subprojects/s1/subprojects/s3/meson.build new file mode 100644 index 000000000..894fe265b --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s1/subprojects/s3/meson.build @@ -0,0 +1,4 @@ +project('s3', 'c') + +l = static_library('s3', 's3.c') + diff --git a/test cases/unit/12 promote/subprojects/s1/subprojects/s3/s3.c b/test cases/unit/12 promote/subprojects/s1/subprojects/s3/s3.c new file mode 100644 index 000000000..0166603e5 --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s1/subprojects/s3/s3.c @@ -0,0 +1,3 @@ +int func2() { + return -42; +} diff --git a/test cases/unit/12 promote/subprojects/s1/subprojects/scommon/meson.build b/test cases/unit/12 promote/subprojects/s1/subprojects/scommon/meson.build new file mode 100644 index 000000000..231f2757b --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s1/subprojects/scommon/meson.build @@ -0,0 +1,4 @@ +project('scommon', 'c') + +clib = static_library('scommon', 'scommon_broken.c') + diff --git a/test cases/unit/12 promote/subprojects/s1/subprojects/scommon/scommon_broken.c b/test cases/unit/12 promote/subprojects/s1/subprojects/scommon/scommon_broken.c new file mode 100644 index 000000000..3665a9cbc --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s1/subprojects/scommon/scommon_broken.c @@ -0,0 +1 @@ +#error This file must not be used. The other scommon one should be instead. diff --git a/test cases/unit/12 promote/subprojects/s2/meson.build b/test cases/unit/12 promote/subprojects/s2/meson.build new file mode 100644 index 000000000..32bcf8f39 --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s2/meson.build @@ -0,0 +1,6 @@ +project('s2', 'c') + +sc = subproject('scommon') + +executable('s2', 's2.c', link_with : sc.get_variable('clib')) + diff --git a/test cases/unit/12 promote/subprojects/s2/s2.c b/test cases/unit/12 promote/subprojects/s2/s2.c new file mode 100644 index 000000000..2a6d1e63d --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s2/s2.c @@ -0,0 +1,6 @@ +int func(); + + +int main(int argc, char **argv) { + return func() != 42; +} diff --git a/test cases/unit/12 promote/subprojects/s2/subprojects/athing.wrap b/test cases/unit/12 promote/subprojects/s2/subprojects/athing.wrap new file mode 100644 index 000000000..09ba4e87f --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s2/subprojects/athing.wrap @@ -0,0 +1,2 @@ +The contents of this wrap file are never evaluated so they +can be anything. diff --git a/test cases/unit/12 promote/subprojects/s2/subprojects/scommon/meson.build b/test cases/unit/12 promote/subprojects/s2/subprojects/scommon/meson.build new file mode 100644 index 000000000..e0d8c7ddc --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s2/subprojects/scommon/meson.build @@ -0,0 +1,4 @@ +project('scommon', 'c') + +clib = static_library('scommon', 'scommon_ok.c') + diff --git a/test cases/unit/12 promote/subprojects/s2/subprojects/scommon/scommon_ok.c b/test cases/unit/12 promote/subprojects/s2/subprojects/scommon/scommon_ok.c new file mode 100644 index 000000000..652f4eb13 --- /dev/null +++ b/test cases/unit/12 promote/subprojects/s2/subprojects/scommon/scommon_ok.c @@ -0,0 +1,3 @@ +int func() { + return 42; +} diff --git a/test cases/unit/13 promote/meson.build b/test cases/unit/13 promote/meson.build deleted file mode 100644 index 066cf36cf..000000000 --- a/test cases/unit/13 promote/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('promotion test', 'c') - -subproject('s1') -subproject('s2') - diff --git a/test cases/unit/13 promote/subprojects/s1/meson.build b/test cases/unit/13 promote/subprojects/s1/meson.build deleted file mode 100644 index 88c467bf4..000000000 --- a/test cases/unit/13 promote/subprojects/s1/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('s1', 'c') - -sc = subproject('scommon') -s3 = subproject('s3') - -executable('s1', 's1.c', - link_with : [sc.get_variable('clib'), s3.get_variable('l')]) diff --git a/test cases/unit/13 promote/subprojects/s1/s1.c b/test cases/unit/13 promote/subprojects/s1/s1.c deleted file mode 100644 index 7d1d775c1..000000000 --- a/test cases/unit/13 promote/subprojects/s1/s1.c +++ /dev/null @@ -1,6 +0,0 @@ -int func(); -int func2(); - -int main(int argc, char **argv) { - return func() + func2(); -} diff --git a/test cases/unit/13 promote/subprojects/s1/subprojects/s3/meson.build b/test cases/unit/13 promote/subprojects/s1/subprojects/s3/meson.build deleted file mode 100644 index 894fe265b..000000000 --- a/test cases/unit/13 promote/subprojects/s1/subprojects/s3/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('s3', 'c') - -l = static_library('s3', 's3.c') - diff --git a/test cases/unit/13 promote/subprojects/s1/subprojects/s3/s3.c b/test cases/unit/13 promote/subprojects/s1/subprojects/s3/s3.c deleted file mode 100644 index 0166603e5..000000000 --- a/test cases/unit/13 promote/subprojects/s1/subprojects/s3/s3.c +++ /dev/null @@ -1,3 +0,0 @@ -int func2() { - return -42; -} diff --git a/test cases/unit/13 promote/subprojects/s1/subprojects/scommon/meson.build b/test cases/unit/13 promote/subprojects/s1/subprojects/scommon/meson.build deleted file mode 100644 index 231f2757b..000000000 --- a/test cases/unit/13 promote/subprojects/s1/subprojects/scommon/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('scommon', 'c') - -clib = static_library('scommon', 'scommon_broken.c') - diff --git a/test cases/unit/13 promote/subprojects/s1/subprojects/scommon/scommon_broken.c b/test cases/unit/13 promote/subprojects/s1/subprojects/scommon/scommon_broken.c deleted file mode 100644 index 3665a9cbc..000000000 --- a/test cases/unit/13 promote/subprojects/s1/subprojects/scommon/scommon_broken.c +++ /dev/null @@ -1 +0,0 @@ -#error This file must not be used. The other scommon one should be instead. diff --git a/test cases/unit/13 promote/subprojects/s2/meson.build b/test cases/unit/13 promote/subprojects/s2/meson.build deleted file mode 100644 index 32bcf8f39..000000000 --- a/test cases/unit/13 promote/subprojects/s2/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('s2', 'c') - -sc = subproject('scommon') - -executable('s2', 's2.c', link_with : sc.get_variable('clib')) - diff --git a/test cases/unit/13 promote/subprojects/s2/s2.c b/test cases/unit/13 promote/subprojects/s2/s2.c deleted file mode 100644 index 2a6d1e63d..000000000 --- a/test cases/unit/13 promote/subprojects/s2/s2.c +++ /dev/null @@ -1,6 +0,0 @@ -int func(); - - -int main(int argc, char **argv) { - return func() != 42; -} diff --git a/test cases/unit/13 promote/subprojects/s2/subprojects/athing.wrap b/test cases/unit/13 promote/subprojects/s2/subprojects/athing.wrap deleted file mode 100644 index 09ba4e87f..000000000 --- a/test cases/unit/13 promote/subprojects/s2/subprojects/athing.wrap +++ /dev/null @@ -1,2 +0,0 @@ -The contents of this wrap file are never evaluated so they -can be anything. diff --git a/test cases/unit/13 promote/subprojects/s2/subprojects/scommon/meson.build b/test cases/unit/13 promote/subprojects/s2/subprojects/scommon/meson.build deleted file mode 100644 index e0d8c7ddc..000000000 --- a/test cases/unit/13 promote/subprojects/s2/subprojects/scommon/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('scommon', 'c') - -clib = static_library('scommon', 'scommon_ok.c') - diff --git a/test cases/unit/13 promote/subprojects/s2/subprojects/scommon/scommon_ok.c b/test cases/unit/13 promote/subprojects/s2/subprojects/scommon/scommon_ok.c deleted file mode 100644 index 652f4eb13..000000000 --- a/test cases/unit/13 promote/subprojects/s2/subprojects/scommon/scommon_ok.c +++ /dev/null @@ -1,3 +0,0 @@ -int func() { - return 42; -} diff --git a/test cases/unit/13 testsetup selection/main.c b/test cases/unit/13 testsetup selection/main.c deleted file mode 100644 index cb3f7482f..000000000 --- a/test cases/unit/13 testsetup selection/main.c +++ /dev/null @@ -1,3 +0,0 @@ -int main() { - return 0; -} diff --git a/test cases/unit/13 testsetup selection/meson.build b/test cases/unit/13 testsetup selection/meson.build deleted file mode 100644 index ae996c5be..000000000 --- a/test cases/unit/13 testsetup selection/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -project('main', 'c') - -main = executable('main', 'main.c') -test('Test main', main) - -add_test_setup('worksforall') -add_test_setup('missingfromfoo') - -subproject('foo') -subproject('bar') diff --git a/test cases/unit/13 testsetup selection/subprojects/bar/bar.c b/test cases/unit/13 testsetup selection/subprojects/bar/bar.c deleted file mode 100644 index cb3f7482f..000000000 --- a/test cases/unit/13 testsetup selection/subprojects/bar/bar.c +++ /dev/null @@ -1,3 +0,0 @@ -int main() { - return 0; -} diff --git a/test cases/unit/13 testsetup selection/subprojects/bar/meson.build b/test cases/unit/13 testsetup selection/subprojects/bar/meson.build deleted file mode 100644 index 1155a88aa..000000000 --- a/test cases/unit/13 testsetup selection/subprojects/bar/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('bar', 'c') -bar = executable('bar', 'bar.c') -test('Test bar', bar) -add_test_setup('onlyinbar') -add_test_setup('worksforall') -add_test_setup('missingfromfoo') diff --git a/test cases/unit/13 testsetup selection/subprojects/foo/foo.c b/test cases/unit/13 testsetup selection/subprojects/foo/foo.c deleted file mode 100644 index cb3f7482f..000000000 --- a/test cases/unit/13 testsetup selection/subprojects/foo/foo.c +++ /dev/null @@ -1,3 +0,0 @@ -int main() { - return 0; -} diff --git a/test cases/unit/13 testsetup selection/subprojects/foo/meson.build b/test cases/unit/13 testsetup selection/subprojects/foo/meson.build deleted file mode 100644 index 2eef840cd..000000000 --- a/test cases/unit/13 testsetup selection/subprojects/foo/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('foo', 'c') -foo = executable('foo', 'foo.c') -test('Test foo', foo) -add_test_setup('worksforall') diff --git a/test cases/unit/14 prebuilt object/main.c b/test cases/unit/14 prebuilt object/main.c deleted file mode 100644 index 480bda5f4..000000000 --- a/test cases/unit/14 prebuilt object/main.c +++ /dev/null @@ -1,5 +0,0 @@ -int func(); - -int main(int argc, char **argv) { - return func() == 42 ? 0 : 99; -} diff --git a/test cases/unit/14 prebuilt object/meson.build b/test cases/unit/14 prebuilt object/meson.build deleted file mode 100644 index 92f966b97..000000000 --- a/test cases/unit/14 prebuilt object/meson.build +++ /dev/null @@ -1,25 +0,0 @@ -# This test is on its own because it is special. -# To run the test you need the prebuilt object -# file for the given platform. -# -# Combined with cross compilation this would make -# the state space explode so let's just keep this -# in its own subdir so it's not run during cross -# compilation tests. - -project('prebuilt object', 'c') - -if host_machine.system() == 'windows' - prebuilt = 'prebuilt.obj' -else - prebuilt = 'prebuilt.o' -endif - -# Remember: do not put source.c in this -# declaration. run_tests.py generates the -# prebuilt object before running this test. - -e = executable('prog', 'main.c', -objects : prebuilt) - -test('objtest', e) diff --git a/test cases/unit/14 prebuilt object/source.c b/test cases/unit/14 prebuilt object/source.c deleted file mode 100644 index f39b4f366..000000000 --- a/test cases/unit/14 prebuilt object/source.c +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Compile this manually on new platforms and add the - * object file to revision control and Meson configuration. - */ - -int func() { - return 42; -} diff --git a/test cases/unit/14 testsetup selection/main.c b/test cases/unit/14 testsetup selection/main.c new file mode 100644 index 000000000..cb3f7482f --- /dev/null +++ b/test cases/unit/14 testsetup selection/main.c @@ -0,0 +1,3 @@ +int main() { + return 0; +} diff --git a/test cases/unit/14 testsetup selection/meson.build b/test cases/unit/14 testsetup selection/meson.build new file mode 100644 index 000000000..ae996c5be --- /dev/null +++ b/test cases/unit/14 testsetup selection/meson.build @@ -0,0 +1,10 @@ +project('main', 'c') + +main = executable('main', 'main.c') +test('Test main', main) + +add_test_setup('worksforall') +add_test_setup('missingfromfoo') + +subproject('foo') +subproject('bar') diff --git a/test cases/unit/14 testsetup selection/subprojects/bar/bar.c b/test cases/unit/14 testsetup selection/subprojects/bar/bar.c new file mode 100644 index 000000000..cb3f7482f --- /dev/null +++ b/test cases/unit/14 testsetup selection/subprojects/bar/bar.c @@ -0,0 +1,3 @@ +int main() { + return 0; +} diff --git a/test cases/unit/14 testsetup selection/subprojects/bar/meson.build b/test cases/unit/14 testsetup selection/subprojects/bar/meson.build new file mode 100644 index 000000000..1155a88aa --- /dev/null +++ b/test cases/unit/14 testsetup selection/subprojects/bar/meson.build @@ -0,0 +1,6 @@ +project('bar', 'c') +bar = executable('bar', 'bar.c') +test('Test bar', bar) +add_test_setup('onlyinbar') +add_test_setup('worksforall') +add_test_setup('missingfromfoo') diff --git a/test cases/unit/14 testsetup selection/subprojects/foo/foo.c b/test cases/unit/14 testsetup selection/subprojects/foo/foo.c new file mode 100644 index 000000000..cb3f7482f --- /dev/null +++ b/test cases/unit/14 testsetup selection/subprojects/foo/foo.c @@ -0,0 +1,3 @@ +int main() { + return 0; +} diff --git a/test cases/unit/14 testsetup selection/subprojects/foo/meson.build b/test cases/unit/14 testsetup selection/subprojects/foo/meson.build new file mode 100644 index 000000000..2eef840cd --- /dev/null +++ b/test cases/unit/14 testsetup selection/subprojects/foo/meson.build @@ -0,0 +1,4 @@ +project('foo', 'c') +foo = executable('foo', 'foo.c') +test('Test foo', foo) +add_test_setup('worksforall') diff --git a/test cases/unit/15 prebuilt object/main.c b/test cases/unit/15 prebuilt object/main.c new file mode 100644 index 000000000..480bda5f4 --- /dev/null +++ b/test cases/unit/15 prebuilt object/main.c @@ -0,0 +1,5 @@ +int func(); + +int main(int argc, char **argv) { + return func() == 42 ? 0 : 99; +} diff --git a/test cases/unit/15 prebuilt object/meson.build b/test cases/unit/15 prebuilt object/meson.build new file mode 100644 index 000000000..92f966b97 --- /dev/null +++ b/test cases/unit/15 prebuilt object/meson.build @@ -0,0 +1,25 @@ +# This test is on its own because it is special. +# To run the test you need the prebuilt object +# file for the given platform. +# +# Combined with cross compilation this would make +# the state space explode so let's just keep this +# in its own subdir so it's not run during cross +# compilation tests. + +project('prebuilt object', 'c') + +if host_machine.system() == 'windows' + prebuilt = 'prebuilt.obj' +else + prebuilt = 'prebuilt.o' +endif + +# Remember: do not put source.c in this +# declaration. run_tests.py generates the +# prebuilt object before running this test. + +e = executable('prog', 'main.c', +objects : prebuilt) + +test('objtest', e) diff --git a/test cases/unit/15 prebuilt object/source.c b/test cases/unit/15 prebuilt object/source.c new file mode 100644 index 000000000..f39b4f366 --- /dev/null +++ b/test cases/unit/15 prebuilt object/source.c @@ -0,0 +1,8 @@ +/* + * Compile this manually on new platforms and add the + * object file to revision control and Meson configuration. + */ + +int func() { + return 42; +} diff --git a/test cases/unit/15 prebuilt static/libdir/best.c b/test cases/unit/15 prebuilt static/libdir/best.c deleted file mode 100644 index ab774e1f5..000000000 --- a/test cases/unit/15 prebuilt static/libdir/best.c +++ /dev/null @@ -1,3 +0,0 @@ -const char *msg() { - return "I am the best."; -} diff --git a/test cases/unit/15 prebuilt static/libdir/best.h b/test cases/unit/15 prebuilt static/libdir/best.h deleted file mode 100644 index 063017f86..000000000 --- a/test cases/unit/15 prebuilt static/libdir/best.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -const char *msg(); diff --git a/test cases/unit/15 prebuilt static/libdir/meson.build b/test cases/unit/15 prebuilt static/libdir/meson.build deleted file mode 100644 index 8d74ccf3f..000000000 --- a/test cases/unit/15 prebuilt static/libdir/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -cc = meson.get_compiler('c') -stlib = cc.find_library('best', dirs : meson.current_source_dir()) - -best_dep = declare_dependency(dependencies : stlib, - include_directories : include_directories('.')) diff --git a/test cases/unit/15 prebuilt static/main.c b/test cases/unit/15 prebuilt static/main.c deleted file mode 100644 index d172625b9..000000000 --- a/test cases/unit/15 prebuilt static/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - printf("%s\n", msg()); - return 0; -} diff --git a/test cases/unit/15 prebuilt static/meson.build b/test cases/unit/15 prebuilt static/meson.build deleted file mode 100644 index 9ea1d0dc7..000000000 --- a/test cases/unit/15 prebuilt static/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('prebuilt static lib', 'c') - -subdir('libdir') - -test('static', executable('mainprog', 'main.c', dependencies : best_dep)) diff --git a/test cases/unit/16 prebuilt shared/alexandria.c b/test cases/unit/16 prebuilt shared/alexandria.c deleted file mode 100644 index 2d6b84831..000000000 --- a/test cases/unit/16 prebuilt shared/alexandria.c +++ /dev/null @@ -1,6 +0,0 @@ -#include"alexandria.h" -#include - -void alexandria_visit() { - printf("You are surrounded by wisdom and knowledge. You feel enlightened.\n"); -} diff --git a/test cases/unit/16 prebuilt shared/alexandria.h b/test cases/unit/16 prebuilt shared/alexandria.h deleted file mode 100644 index 6e507c5ae..000000000 --- a/test cases/unit/16 prebuilt shared/alexandria.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -/* Both funcs here for simplicity. */ - -#if defined _WIN32 || defined __CYGWIN__ -#if defined BUILDING_DLL - #define DLL_PUBLIC __declspec(dllexport) -#else - #define DLL_PUBLIC __declspec(dllimport) -#endif -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -void DLL_PUBLIC alexandria_visit(); diff --git a/test cases/unit/16 prebuilt shared/another_visitor.c b/test cases/unit/16 prebuilt shared/another_visitor.c deleted file mode 100644 index 18e5f150e..000000000 --- a/test cases/unit/16 prebuilt shared/another_visitor.c +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - printf("Ahh, another visitor. Stay a while.\n"); - printf("You enter the library.\n\n"); - alexandria_visit(); - printf("\nYou decided not to stay forever.\n"); - return 0; -} diff --git a/test cases/unit/16 prebuilt shared/meson.build b/test cases/unit/16 prebuilt shared/meson.build deleted file mode 100644 index 41c11c656..000000000 --- a/test cases/unit/16 prebuilt shared/meson.build +++ /dev/null @@ -1,14 +0,0 @@ -project('prebuilt shared library', 'c') - -cc = meson.get_compiler('c') -shlib = cc.find_library('alexandria', dirs : meson.current_source_dir()) - -exe = executable('patron', 'patron.c', dependencies : shlib) -test('visitation', exe) - -d = declare_dependency(dependencies : shlib) - -exe2 = executable('another_visitor', 'another_visitor.c', - dependencies : d) -test('another', exe2) - diff --git a/test cases/unit/16 prebuilt shared/patron.c b/test cases/unit/16 prebuilt shared/patron.c deleted file mode 100644 index 82d9678aa..000000000 --- a/test cases/unit/16 prebuilt shared/patron.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - printf("You are standing outside the Great Library of Alexandria.\n"); - printf("You decide to go inside.\n\n"); - alexandria_visit(); -} diff --git a/test cases/unit/16 prebuilt static/libdir/best.c b/test cases/unit/16 prebuilt static/libdir/best.c new file mode 100644 index 000000000..ab774e1f5 --- /dev/null +++ b/test cases/unit/16 prebuilt static/libdir/best.c @@ -0,0 +1,3 @@ +const char *msg() { + return "I am the best."; +} diff --git a/test cases/unit/16 prebuilt static/libdir/best.h b/test cases/unit/16 prebuilt static/libdir/best.h new file mode 100644 index 000000000..063017f86 --- /dev/null +++ b/test cases/unit/16 prebuilt static/libdir/best.h @@ -0,0 +1,3 @@ +#pragma once + +const char *msg(); diff --git a/test cases/unit/16 prebuilt static/libdir/meson.build b/test cases/unit/16 prebuilt static/libdir/meson.build new file mode 100644 index 000000000..8d74ccf3f --- /dev/null +++ b/test cases/unit/16 prebuilt static/libdir/meson.build @@ -0,0 +1,5 @@ +cc = meson.get_compiler('c') +stlib = cc.find_library('best', dirs : meson.current_source_dir()) + +best_dep = declare_dependency(dependencies : stlib, + include_directories : include_directories('.')) diff --git a/test cases/unit/16 prebuilt static/main.c b/test cases/unit/16 prebuilt static/main.c new file mode 100644 index 000000000..d172625b9 --- /dev/null +++ b/test cases/unit/16 prebuilt static/main.c @@ -0,0 +1,7 @@ +#include +#include + +int main(int argc, char **argv) { + printf("%s\n", msg()); + return 0; +} diff --git a/test cases/unit/16 prebuilt static/meson.build b/test cases/unit/16 prebuilt static/meson.build new file mode 100644 index 000000000..9ea1d0dc7 --- /dev/null +++ b/test cases/unit/16 prebuilt static/meson.build @@ -0,0 +1,5 @@ +project('prebuilt static lib', 'c') + +subdir('libdir') + +test('static', executable('mainprog', 'main.c', dependencies : best_dep)) diff --git a/test cases/unit/17 pkgconfig static/foo.c b/test cases/unit/17 pkgconfig static/foo.c deleted file mode 100644 index bf7fbddf3..000000000 --- a/test cases/unit/17 pkgconfig static/foo.c +++ /dev/null @@ -1,8 +0,0 @@ -int power_level (void) -{ -#ifdef FOO_STATIC - return 9001; -#else - return 8999; -#endif -} diff --git a/test cases/unit/17 pkgconfig static/foo.pc.in b/test cases/unit/17 pkgconfig static/foo.pc.in deleted file mode 100644 index b26c0b0a2..000000000 --- a/test cases/unit/17 pkgconfig static/foo.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@PREFIX@ -libdir=${prefix} -includedir=${prefix}/include -datadir=${prefix}/data - -Name: libfoo -Description: A foo library. -Version: 1.0 -Libs: -L${libdir} -lfoo -Libs.private: -lm -Cflags: -I${includedir} diff --git a/test cases/unit/17 pkgconfig static/include/foo.h b/test cases/unit/17 pkgconfig static/include/foo.h deleted file mode 100644 index 88ef55494..000000000 --- a/test cases/unit/17 pkgconfig static/include/foo.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -int power_level (void); diff --git a/test cases/unit/17 pkgconfig static/main.c b/test cases/unit/17 pkgconfig static/main.c deleted file mode 100644 index cc4649f71..000000000 --- a/test cases/unit/17 pkgconfig static/main.c +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -int -main (int argc, char * argv[]) -{ - int value = power_level (); - if (value < 9000) { - printf ("Power level is %i\n", value); - return 1; - } - printf ("IT'S OVER 9000!!!\n"); - return 0; -} diff --git a/test cases/unit/17 pkgconfig static/meson.build b/test cases/unit/17 pkgconfig static/meson.build deleted file mode 100644 index d1b0fd5ac..000000000 --- a/test cases/unit/17 pkgconfig static/meson.build +++ /dev/null @@ -1,37 +0,0 @@ -project('pkg-config static', 'c') - -if build_machine.system() != 'windows' - prefix = meson.source_root() -else - # pkg-config files should not use paths with \ - prefix_parts = meson.source_root().split('\\') - # If the path is C:/foo/bar, convert it to /c/foo/bar so we can test if our - # automatic conversion to C:/foo/bar inside PkgConfigDependency is working. - if prefix_parts[0][1] == ':' - drive = prefix_parts[0][0] - else - drive = prefix_parts[0] - endif - new_parts = [] - foreach part : prefix_parts - if part != prefix_parts[0] - new_parts += part - endif - endforeach - prefix = '/@0@/@1@'.format(drive, '/'.join(new_parts)) -endif -message(prefix) - -# Escape spaces -prefix_parts = prefix.split(' ') -prefix = '\ '.join(prefix_parts) - -conf = configuration_data() -conf.set('PREFIX', prefix) -configure_file(input : 'foo.pc.in', - output : 'foo.pc', - configuration : conf) - -foo_dep = dependency('foo', static : true) - -test('footest', executable('foomain', 'main.c', dependencies : foo_dep)) diff --git a/test cases/unit/17 prebuilt shared/alexandria.c b/test cases/unit/17 prebuilt shared/alexandria.c new file mode 100644 index 000000000..2d6b84831 --- /dev/null +++ b/test cases/unit/17 prebuilt shared/alexandria.c @@ -0,0 +1,6 @@ +#include"alexandria.h" +#include + +void alexandria_visit() { + printf("You are surrounded by wisdom and knowledge. You feel enlightened.\n"); +} diff --git a/test cases/unit/17 prebuilt shared/alexandria.h b/test cases/unit/17 prebuilt shared/alexandria.h new file mode 100644 index 000000000..6e507c5ae --- /dev/null +++ b/test cases/unit/17 prebuilt shared/alexandria.h @@ -0,0 +1,20 @@ +#pragma once + +/* Both funcs here for simplicity. */ + +#if defined _WIN32 || defined __CYGWIN__ +#if defined BUILDING_DLL + #define DLL_PUBLIC __declspec(dllexport) +#else + #define DLL_PUBLIC __declspec(dllimport) +#endif +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +void DLL_PUBLIC alexandria_visit(); diff --git a/test cases/unit/17 prebuilt shared/another_visitor.c b/test cases/unit/17 prebuilt shared/another_visitor.c new file mode 100644 index 000000000..18e5f150e --- /dev/null +++ b/test cases/unit/17 prebuilt shared/another_visitor.c @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, char **argv) { + printf("Ahh, another visitor. Stay a while.\n"); + printf("You enter the library.\n\n"); + alexandria_visit(); + printf("\nYou decided not to stay forever.\n"); + return 0; +} diff --git a/test cases/unit/17 prebuilt shared/meson.build b/test cases/unit/17 prebuilt shared/meson.build new file mode 100644 index 000000000..41c11c656 --- /dev/null +++ b/test cases/unit/17 prebuilt shared/meson.build @@ -0,0 +1,14 @@ +project('prebuilt shared library', 'c') + +cc = meson.get_compiler('c') +shlib = cc.find_library('alexandria', dirs : meson.current_source_dir()) + +exe = executable('patron', 'patron.c', dependencies : shlib) +test('visitation', exe) + +d = declare_dependency(dependencies : shlib) + +exe2 = executable('another_visitor', 'another_visitor.c', + dependencies : d) +test('another', exe2) + diff --git a/test cases/unit/17 prebuilt shared/patron.c b/test cases/unit/17 prebuilt shared/patron.c new file mode 100644 index 000000000..82d9678aa --- /dev/null +++ b/test cases/unit/17 prebuilt shared/patron.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) { + printf("You are standing outside the Great Library of Alexandria.\n"); + printf("You decide to go inside.\n\n"); + alexandria_visit(); +} diff --git a/test cases/unit/18 array option/meson.build b/test cases/unit/18 array option/meson.build deleted file mode 100644 index 2b44181fb..000000000 --- a/test cases/unit/18 array option/meson.build +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('array option test') diff --git a/test cases/unit/18 array option/meson_options.txt b/test cases/unit/18 array option/meson_options.txt deleted file mode 100644 index 0ccdcc4ad..000000000 --- a/test cases/unit/18 array option/meson_options.txt +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -option( - 'list', - type : 'array', - value : ['foo', 'bar'], - choices : ['foo', 'bar', 'oink', 'boink'], -) diff --git a/test cases/unit/18 pkgconfig static/foo.c b/test cases/unit/18 pkgconfig static/foo.c new file mode 100644 index 000000000..bf7fbddf3 --- /dev/null +++ b/test cases/unit/18 pkgconfig static/foo.c @@ -0,0 +1,8 @@ +int power_level (void) +{ +#ifdef FOO_STATIC + return 9001; +#else + return 8999; +#endif +} diff --git a/test cases/unit/18 pkgconfig static/foo.pc.in b/test cases/unit/18 pkgconfig static/foo.pc.in new file mode 100644 index 000000000..b26c0b0a2 --- /dev/null +++ b/test cases/unit/18 pkgconfig static/foo.pc.in @@ -0,0 +1,11 @@ +prefix=@PREFIX@ +libdir=${prefix} +includedir=${prefix}/include +datadir=${prefix}/data + +Name: libfoo +Description: A foo library. +Version: 1.0 +Libs: -L${libdir} -lfoo +Libs.private: -lm +Cflags: -I${includedir} diff --git a/test cases/unit/18 pkgconfig static/include/foo.h b/test cases/unit/18 pkgconfig static/include/foo.h new file mode 100644 index 000000000..88ef55494 --- /dev/null +++ b/test cases/unit/18 pkgconfig static/include/foo.h @@ -0,0 +1,3 @@ +#pragma once + +int power_level (void); diff --git a/test cases/unit/18 pkgconfig static/main.c b/test cases/unit/18 pkgconfig static/main.c new file mode 100644 index 000000000..cc4649f71 --- /dev/null +++ b/test cases/unit/18 pkgconfig static/main.c @@ -0,0 +1,14 @@ +#include +#include + +int +main (int argc, char * argv[]) +{ + int value = power_level (); + if (value < 9000) { + printf ("Power level is %i\n", value); + return 1; + } + printf ("IT'S OVER 9000!!!\n"); + return 0; +} diff --git a/test cases/unit/18 pkgconfig static/meson.build b/test cases/unit/18 pkgconfig static/meson.build new file mode 100644 index 000000000..d1b0fd5ac --- /dev/null +++ b/test cases/unit/18 pkgconfig static/meson.build @@ -0,0 +1,37 @@ +project('pkg-config static', 'c') + +if build_machine.system() != 'windows' + prefix = meson.source_root() +else + # pkg-config files should not use paths with \ + prefix_parts = meson.source_root().split('\\') + # If the path is C:/foo/bar, convert it to /c/foo/bar so we can test if our + # automatic conversion to C:/foo/bar inside PkgConfigDependency is working. + if prefix_parts[0][1] == ':' + drive = prefix_parts[0][0] + else + drive = prefix_parts[0] + endif + new_parts = [] + foreach part : prefix_parts + if part != prefix_parts[0] + new_parts += part + endif + endforeach + prefix = '/@0@/@1@'.format(drive, '/'.join(new_parts)) +endif +message(prefix) + +# Escape spaces +prefix_parts = prefix.split(' ') +prefix = '\ '.join(prefix_parts) + +conf = configuration_data() +conf.set('PREFIX', prefix) +configure_file(input : 'foo.pc.in', + output : 'foo.pc', + configuration : conf) + +foo_dep = dependency('foo', static : true) + +test('footest', executable('foomain', 'main.c', dependencies : foo_dep)) diff --git a/test cases/unit/19 array option/meson.build b/test cases/unit/19 array option/meson.build new file mode 100644 index 000000000..2b44181fb --- /dev/null +++ b/test cases/unit/19 array option/meson.build @@ -0,0 +1,15 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('array option test') diff --git a/test cases/unit/19 array option/meson_options.txt b/test cases/unit/19 array option/meson_options.txt new file mode 100644 index 000000000..0ccdcc4ad --- /dev/null +++ b/test cases/unit/19 array option/meson_options.txt @@ -0,0 +1,20 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +option( + 'list', + type : 'array', + value : ['foo', 'bar'], + choices : ['foo', 'bar', 'oink', 'boink'], +) diff --git a/test cases/unit/21 warning location/a.c b/test cases/unit/21 warning location/a.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/21 warning location/b.c b/test cases/unit/21 warning location/b.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/21 warning location/conf.in b/test cases/unit/21 warning location/conf.in deleted file mode 100644 index a2903ed38..000000000 --- a/test cases/unit/21 warning location/conf.in +++ /dev/null @@ -1 +0,0 @@ -@MISSING@ diff --git a/test cases/unit/21 warning location/main.c b/test cases/unit/21 warning location/main.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/21 warning location/meson.build b/test cases/unit/21 warning location/meson.build deleted file mode 100644 index 52a93d18c..000000000 --- a/test cases/unit/21 warning location/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('warning location', 'c', invalid: 'cheese') -a = library('liba', 'a.c') -b = library('libb', 'b.c') -executable('main', 'main.c', link_with: a, link_with: b) -subdir('sub') -warning('a warning of some sort') -import('unstable-simd') - -conf_data = configuration_data() -conf_data.set('NOTMISSING', 1) -configure_file(input: 'conf.in' , output: 'conf', configuration: conf_data) diff --git a/test cases/unit/21 warning location/sub/c.c b/test cases/unit/21 warning location/sub/c.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/21 warning location/sub/d.c b/test cases/unit/21 warning location/sub/d.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/21 warning location/sub/meson.build b/test cases/unit/21 warning location/sub/meson.build deleted file mode 100644 index 27f67783c..000000000 --- a/test cases/unit/21 warning location/sub/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -c = library('libc', 'c.c') -d = library('libd', 'd.c') -executable('sub', 'sub.c', link_with: c, link_with: d) -warning('subdir warning') diff --git a/test cases/unit/21 warning location/sub/sub.c b/test cases/unit/21 warning location/sub/sub.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/22 unfound pkgconfig/meson.build b/test cases/unit/22 unfound pkgconfig/meson.build deleted file mode 100644 index 1285c0a10..000000000 --- a/test cases/unit/22 unfound pkgconfig/meson.build +++ /dev/null @@ -1,15 +0,0 @@ -project('foobar', 'c') - -unfound = dependency('blub_blob_blib', required : false) - -pkgg = import('pkgconfig') - -l = shared_library('somename', 'some.c', - dependencies : unfound) - -pkgg.generate( - libraries : l, - name : 'somename', - version : '1.0.0', - description : 'A test library.', -) diff --git a/test cases/unit/22 unfound pkgconfig/some.c b/test cases/unit/22 unfound pkgconfig/some.c deleted file mode 100644 index fb765fb1f..000000000 --- a/test cases/unit/22 unfound pkgconfig/some.c +++ /dev/null @@ -1,3 +0,0 @@ -int some() { - return 6; -} diff --git a/test cases/unit/22 warning location/a.c b/test cases/unit/22 warning location/a.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/22 warning location/b.c b/test cases/unit/22 warning location/b.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/22 warning location/conf.in b/test cases/unit/22 warning location/conf.in new file mode 100644 index 000000000..a2903ed38 --- /dev/null +++ b/test cases/unit/22 warning location/conf.in @@ -0,0 +1 @@ +@MISSING@ diff --git a/test cases/unit/22 warning location/main.c b/test cases/unit/22 warning location/main.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/22 warning location/meson.build b/test cases/unit/22 warning location/meson.build new file mode 100644 index 000000000..52a93d18c --- /dev/null +++ b/test cases/unit/22 warning location/meson.build @@ -0,0 +1,11 @@ +project('warning location', 'c', invalid: 'cheese') +a = library('liba', 'a.c') +b = library('libb', 'b.c') +executable('main', 'main.c', link_with: a, link_with: b) +subdir('sub') +warning('a warning of some sort') +import('unstable-simd') + +conf_data = configuration_data() +conf_data.set('NOTMISSING', 1) +configure_file(input: 'conf.in' , output: 'conf', configuration: conf_data) diff --git a/test cases/unit/22 warning location/sub/c.c b/test cases/unit/22 warning location/sub/c.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/22 warning location/sub/d.c b/test cases/unit/22 warning location/sub/d.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/22 warning location/sub/meson.build b/test cases/unit/22 warning location/sub/meson.build new file mode 100644 index 000000000..27f67783c --- /dev/null +++ b/test cases/unit/22 warning location/sub/meson.build @@ -0,0 +1,4 @@ +c = library('libc', 'c.c') +d = library('libd', 'd.c') +executable('sub', 'sub.c', link_with: c, link_with: d) +warning('subdir warning') diff --git a/test cases/unit/22 warning location/sub/sub.c b/test cases/unit/22 warning location/sub/sub.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/23 compiler run_command/meson.build b/test cases/unit/23 compiler run_command/meson.build deleted file mode 100644 index 6d9e0b969..000000000 --- a/test cases/unit/23 compiler run_command/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -project('compiler_object_in_run_command', 'c') -cc = meson.get_compiler('c') - -# This test only checks that the compiler object can be passed to -# run_command(). If the compiler has been launched, it is expected -# to output something either to stdout or to stderr. -result = run_command(cc, '--version') -if result.stdout() == '' and result.stderr() == '' - error('No output in stdout and stderr. Did the compiler run at all?') -endif diff --git a/test cases/unit/23 non-permitted kwargs/meson.build b/test cases/unit/23 non-permitted kwargs/meson.build deleted file mode 100644 index 9f7dc1f76..000000000 --- a/test cases/unit/23 non-permitted kwargs/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('non-permitted kwargs', 'c') -cc = meson.get_compiler('c') -cc.has_header_symbol('stdio.h', 'printf', prefixxx: '#define XXX') -cc.links('int main(){}', argsxx: '') -cc.get_id(invalidxx: '') diff --git a/test cases/unit/23 unfound pkgconfig/meson.build b/test cases/unit/23 unfound pkgconfig/meson.build new file mode 100644 index 000000000..1285c0a10 --- /dev/null +++ b/test cases/unit/23 unfound pkgconfig/meson.build @@ -0,0 +1,15 @@ +project('foobar', 'c') + +unfound = dependency('blub_blob_blib', required : false) + +pkgg = import('pkgconfig') + +l = shared_library('somename', 'some.c', + dependencies : unfound) + +pkgg.generate( + libraries : l, + name : 'somename', + version : '1.0.0', + description : 'A test library.', +) diff --git a/test cases/unit/23 unfound pkgconfig/some.c b/test cases/unit/23 unfound pkgconfig/some.c new file mode 100644 index 000000000..fb765fb1f --- /dev/null +++ b/test cases/unit/23 unfound pkgconfig/some.c @@ -0,0 +1,3 @@ +int some() { + return 6; +} diff --git a/test cases/unit/24 compiler run_command/meson.build b/test cases/unit/24 compiler run_command/meson.build new file mode 100644 index 000000000..6d9e0b969 --- /dev/null +++ b/test cases/unit/24 compiler run_command/meson.build @@ -0,0 +1,10 @@ +project('compiler_object_in_run_command', 'c') +cc = meson.get_compiler('c') + +# This test only checks that the compiler object can be passed to +# run_command(). If the compiler has been launched, it is expected +# to output something either to stdout or to stderr. +result = run_command(cc, '--version') +if result.stdout() == '' and result.stderr() == '' + error('No output in stdout and stderr. Did the compiler run at all?') +endif diff --git a/test cases/unit/24 install umask/datafile.cat b/test cases/unit/24 install umask/datafile.cat deleted file mode 100644 index 53d81fc2a..000000000 --- a/test cases/unit/24 install umask/datafile.cat +++ /dev/null @@ -1 +0,0 @@ -Installed cat is installed. diff --git a/test cases/unit/24 install umask/meson.build b/test cases/unit/24 install umask/meson.build deleted file mode 100644 index 225f71c67..000000000 --- a/test cases/unit/24 install umask/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('install umask', 'c') -executable('prog', 'prog.c', install : true) -install_headers('sample.h') -install_man('prog.1') -install_data('datafile.cat', install_dir : get_option('prefix') + '/share') -install_subdir('subdir', install_dir : get_option('prefix') + '/share') -meson.add_install_script('myinstall.py', 'share', 'file.dat') diff --git a/test cases/unit/24 install umask/myinstall.py b/test cases/unit/24 install umask/myinstall.py deleted file mode 100644 index db6a51c2b..000000000 --- a/test cases/unit/24 install umask/myinstall.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -prefix = os.environ['MESON_INSTALL_DESTDIR_PREFIX'] - -dirname = os.path.join(prefix, sys.argv[1]) - -try: - os.makedirs(dirname) -except FileExistsError: - if not os.path.isdir(dirname): - raise - -with open(os.path.join(dirname, sys.argv[2]), 'w') as f: - f.write('') diff --git a/test cases/unit/24 install umask/prog.1 b/test cases/unit/24 install umask/prog.1 deleted file mode 100644 index 08ef7da62..000000000 --- a/test cases/unit/24 install umask/prog.1 +++ /dev/null @@ -1 +0,0 @@ -Man up, you. diff --git a/test cases/unit/24 install umask/prog.c b/test cases/unit/24 install umask/prog.c deleted file mode 100644 index 0f0061d2a..000000000 --- a/test cases/unit/24 install umask/prog.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(int argc, char **arv) { - return 0; -} diff --git a/test cases/unit/24 install umask/sample.h b/test cases/unit/24 install umask/sample.h deleted file mode 100644 index dc030dac1..000000000 --- a/test cases/unit/24 install umask/sample.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SAMPLE_H -#define SAMPLE_H - -int wackiness(); - -#endif diff --git a/test cases/unit/24 install umask/subdir/datafile.dog b/test cases/unit/24 install umask/subdir/datafile.dog deleted file mode 100644 index 7a5bcb765..000000000 --- a/test cases/unit/24 install umask/subdir/datafile.dog +++ /dev/null @@ -1 +0,0 @@ -Installed dog is installed. diff --git a/test cases/unit/24 install umask/subdir/sayhello b/test cases/unit/24 install umask/subdir/sayhello deleted file mode 100755 index 1e1c90a85..000000000 --- a/test cases/unit/24 install umask/subdir/sayhello +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo 'Hello, World!' diff --git a/test cases/unit/24 pkgconfig usage/dependee/meson.build b/test cases/unit/24 pkgconfig usage/dependee/meson.build deleted file mode 100644 index beb446c18..000000000 --- a/test cases/unit/24 pkgconfig usage/dependee/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('pkgconfig user', 'c') - -pkgdep = dependency('libpkgdep') - -executable('pkguser', 'pkguser.c', - dependencies : pkgdep) - diff --git a/test cases/unit/24 pkgconfig usage/dependee/pkguser.c b/test cases/unit/24 pkgconfig usage/dependee/pkguser.c deleted file mode 100644 index 2bff316f1..000000000 --- a/test cases/unit/24 pkgconfig usage/dependee/pkguser.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - int res = pkgdep(); - return res != 99; -} diff --git a/test cases/unit/24 pkgconfig usage/dependency/meson.build b/test cases/unit/24 pkgconfig usage/dependency/meson.build deleted file mode 100644 index 89fae8e00..000000000 --- a/test cases/unit/24 pkgconfig usage/dependency/meson.build +++ /dev/null @@ -1,24 +0,0 @@ -project('pkgconfig dep', 'c', - version : '1.0.0') - -# This is not used in the code, only to check that it does not -# leak out to --libs. -glib_dep = dependency('glib-2.0') - -pkgconfig = import('pkgconfig') - -intlib = static_library('libpkgdep-int', 'privatelib.c') -intdep = declare_dependency(link_with : intlib) - -lib = shared_library('pkgdep', 'pkgdep.c', - dependencies : [glib_dep, intdep], - install : true) - -install_headers('pkgdep.h') - -pkgconfig.generate( - filebase : 'libpkgdep', - name : 'Libpkgdep', - description : 'Sample pkgconfig dependency library', - version : meson.project_version(), - libraries : lib) diff --git a/test cases/unit/24 pkgconfig usage/dependency/pkgdep.c b/test cases/unit/24 pkgconfig usage/dependency/pkgdep.c deleted file mode 100644 index bd5c3f4d3..000000000 --- a/test cases/unit/24 pkgconfig usage/dependency/pkgdep.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int internal_thingy(); - -int pkgdep() { - return internal_thingy(); -} diff --git a/test cases/unit/24 pkgconfig usage/dependency/pkgdep.h b/test cases/unit/24 pkgconfig usage/dependency/pkgdep.h deleted file mode 100644 index 16d622eb1..000000000 --- a/test cases/unit/24 pkgconfig usage/dependency/pkgdep.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -int pkgdep(); diff --git a/test cases/unit/24 pkgconfig usage/dependency/privatelib.c b/test cases/unit/24 pkgconfig usage/dependency/privatelib.c deleted file mode 100644 index 71d2179c3..000000000 --- a/test cases/unit/24 pkgconfig usage/dependency/privatelib.c +++ /dev/null @@ -1,3 +0,0 @@ -int internal_thingy() { - return 99; -} diff --git a/test cases/unit/25 ndebug if-release/main.c b/test cases/unit/25 ndebug if-release/main.c deleted file mode 100644 index 70b3d044a..000000000 --- a/test cases/unit/25 ndebug if-release/main.c +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main(void) { -#ifdef NDEBUG - printf("NDEBUG=1\n"); -#else - printf("NDEBUG=0\n"); -#endif - return 0; -} diff --git a/test cases/unit/25 ndebug if-release/meson.build b/test cases/unit/25 ndebug if-release/meson.build deleted file mode 100644 index 4af2406d2..000000000 --- a/test cases/unit/25 ndebug if-release/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('ndebug enabled', 'c') - -executable('main', 'main.c') diff --git a/test cases/unit/25 non-permitted kwargs/meson.build b/test cases/unit/25 non-permitted kwargs/meson.build new file mode 100644 index 000000000..9f7dc1f76 --- /dev/null +++ b/test cases/unit/25 non-permitted kwargs/meson.build @@ -0,0 +1,5 @@ +project('non-permitted kwargs', 'c') +cc = meson.get_compiler('c') +cc.has_header_symbol('stdio.h', 'printf', prefixxx: '#define XXX') +cc.links('int main(){}', argsxx: '') +cc.get_id(invalidxx: '') diff --git a/test cases/unit/26 guessed linker dependencies/exe/app.c b/test cases/unit/26 guessed linker dependencies/exe/app.c deleted file mode 100644 index 1031a4204..000000000 --- a/test cases/unit/26 guessed linker dependencies/exe/app.c +++ /dev/null @@ -1,6 +0,0 @@ -void liba_func(); - -int main() { - liba_func(); - return 0; -} diff --git a/test cases/unit/26 guessed linker dependencies/exe/meson.build b/test cases/unit/26 guessed linker dependencies/exe/meson.build deleted file mode 100644 index 8bb1bd7f6..000000000 --- a/test cases/unit/26 guessed linker dependencies/exe/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('exe', ['c']) - -executable('app', - 'app.c', - # Use uninterpreted strings to avoid path finding by dependency or compiler.find_library - link_args: ['-ltest-lib'] - ) diff --git a/test cases/unit/26 guessed linker dependencies/lib/lib.c b/test cases/unit/26 guessed linker dependencies/lib/lib.c deleted file mode 100644 index 1a8f94ddb..000000000 --- a/test cases/unit/26 guessed linker dependencies/lib/lib.c +++ /dev/null @@ -1,20 +0,0 @@ -#if defined _WIN32 - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -void DLL_PUBLIC liba_func() { -} - -#ifdef MORE_EXPORTS - -void DLL_PUBLIC libb_func() { -} - -#endif diff --git a/test cases/unit/26 guessed linker dependencies/lib/meson.build b/test cases/unit/26 guessed linker dependencies/lib/meson.build deleted file mode 100644 index 36df112b2..000000000 --- a/test cases/unit/26 guessed linker dependencies/lib/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('lib1', ['c']) - -c_args = [] - -# Microsoft's compiler is quite smart about touching import libs on changes, -# so ensure that there is actually a change in symbols. -if get_option('more_exports') - c_args += '-DMORE_EXPORTS' -endif - -a = library('test-lib', 'lib.c', c_args: c_args, install: true) diff --git a/test cases/unit/26 guessed linker dependencies/lib/meson_options.txt b/test cases/unit/26 guessed linker dependencies/lib/meson_options.txt deleted file mode 100644 index 2123e457a..000000000 --- a/test cases/unit/26 guessed linker dependencies/lib/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('more_exports', type : 'boolean', value : false) diff --git a/test cases/unit/26 install umask/datafile.cat b/test cases/unit/26 install umask/datafile.cat new file mode 100644 index 000000000..53d81fc2a --- /dev/null +++ b/test cases/unit/26 install umask/datafile.cat @@ -0,0 +1 @@ +Installed cat is installed. diff --git a/test cases/unit/26 install umask/meson.build b/test cases/unit/26 install umask/meson.build new file mode 100644 index 000000000..225f71c67 --- /dev/null +++ b/test cases/unit/26 install umask/meson.build @@ -0,0 +1,7 @@ +project('install umask', 'c') +executable('prog', 'prog.c', install : true) +install_headers('sample.h') +install_man('prog.1') +install_data('datafile.cat', install_dir : get_option('prefix') + '/share') +install_subdir('subdir', install_dir : get_option('prefix') + '/share') +meson.add_install_script('myinstall.py', 'share', 'file.dat') diff --git a/test cases/unit/26 install umask/myinstall.py b/test cases/unit/26 install umask/myinstall.py new file mode 100644 index 000000000..db6a51c2b --- /dev/null +++ b/test cases/unit/26 install umask/myinstall.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import os +import sys + +prefix = os.environ['MESON_INSTALL_DESTDIR_PREFIX'] + +dirname = os.path.join(prefix, sys.argv[1]) + +try: + os.makedirs(dirname) +except FileExistsError: + if not os.path.isdir(dirname): + raise + +with open(os.path.join(dirname, sys.argv[2]), 'w') as f: + f.write('') diff --git a/test cases/unit/26 install umask/prog.1 b/test cases/unit/26 install umask/prog.1 new file mode 100644 index 000000000..08ef7da62 --- /dev/null +++ b/test cases/unit/26 install umask/prog.1 @@ -0,0 +1 @@ +Man up, you. diff --git a/test cases/unit/26 install umask/prog.c b/test cases/unit/26 install umask/prog.c new file mode 100644 index 000000000..0f0061d2a --- /dev/null +++ b/test cases/unit/26 install umask/prog.c @@ -0,0 +1,3 @@ +int main(int argc, char **arv) { + return 0; +} diff --git a/test cases/unit/26 install umask/sample.h b/test cases/unit/26 install umask/sample.h new file mode 100644 index 000000000..dc030dac1 --- /dev/null +++ b/test cases/unit/26 install umask/sample.h @@ -0,0 +1,6 @@ +#ifndef SAMPLE_H +#define SAMPLE_H + +int wackiness(); + +#endif diff --git a/test cases/unit/26 install umask/subdir/datafile.dog b/test cases/unit/26 install umask/subdir/datafile.dog new file mode 100644 index 000000000..7a5bcb765 --- /dev/null +++ b/test cases/unit/26 install umask/subdir/datafile.dog @@ -0,0 +1 @@ +Installed dog is installed. diff --git a/test cases/unit/26 install umask/subdir/sayhello b/test cases/unit/26 install umask/subdir/sayhello new file mode 100755 index 000000000..1e1c90a85 --- /dev/null +++ b/test cases/unit/26 install umask/subdir/sayhello @@ -0,0 +1,2 @@ +#!/bin/sh +echo 'Hello, World!' diff --git a/test cases/unit/26 shared_mod linking/libfile.c b/test cases/unit/26 shared_mod linking/libfile.c deleted file mode 100644 index 44f7667d4..000000000 --- a/test cases/unit/26 shared_mod linking/libfile.c +++ /dev/null @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC func() { - return 0; -} diff --git a/test cases/unit/26 shared_mod linking/main.c b/test cases/unit/26 shared_mod linking/main.c deleted file mode 100644 index 12f9c984b..000000000 --- a/test cases/unit/26 shared_mod linking/main.c +++ /dev/null @@ -1,11 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_IMPORT __declspec(dllimport) -#else - #define DLL_IMPORT -#endif - -int DLL_IMPORT func(); - -int main(int argc, char **arg) { - return func(); -} diff --git a/test cases/unit/26 shared_mod linking/meson.build b/test cases/unit/26 shared_mod linking/meson.build deleted file mode 100644 index 994a5d390..000000000 --- a/test cases/unit/26 shared_mod linking/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('shared library linking test', 'c', 'cpp') - -mod = shared_module('mymod', 'libfile.c') - -exe = executable('prog', 'main.c', link_with : mod, install : true) \ No newline at end of file diff --git a/test cases/unit/27 forcefallback/meson.build b/test cases/unit/27 forcefallback/meson.build deleted file mode 100644 index 8d84a6035..000000000 --- a/test cases/unit/27 forcefallback/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -project('mainproj', 'c', - default_options : []) - -zlib_dep = dependency('zlib', fallback: ['notzlib', 'zlib_dep']) -notfound_dep = dependency('cannotabletofind', fallback: ['definitelynotfound', 'some_var'], required : false) - -test_not_zlib = executable('test_not_zlib', ['test_not_zlib.c'], dependencies: [zlib_dep, notfound_dep]) - -test('test_not_zlib', test_not_zlib) diff --git a/test cases/unit/27 forcefallback/subprojects/notzlib/meson.build b/test cases/unit/27 forcefallback/subprojects/notzlib/meson.build deleted file mode 100644 index 254a1367b..000000000 --- a/test cases/unit/27 forcefallback/subprojects/notzlib/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('notzlib', 'c') - -notzlib_sources = ['notzlib.c'] - -notzlib = library('notzlib', notzlib_sources) - -zlib_dep = declare_dependency(link_with: notzlib, include_directories: include_directories(['.'])) diff --git a/test cases/unit/27 forcefallback/subprojects/notzlib/notzlib.c b/test cases/unit/27 forcefallback/subprojects/notzlib/notzlib.c deleted file mode 100644 index c3b6bf9c2..000000000 --- a/test cases/unit/27 forcefallback/subprojects/notzlib/notzlib.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "notzlib.h" - -int not_a_zlib_function (void) -{ - return 42; -} diff --git a/test cases/unit/27 forcefallback/subprojects/notzlib/notzlib.h b/test cases/unit/27 forcefallback/subprojects/notzlib/notzlib.h deleted file mode 100644 index 695921d75..000000000 --- a/test cases/unit/27 forcefallback/subprojects/notzlib/notzlib.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#if defined _WIN32 || defined __CYGWIN__ -#if defined BUILDING_DLL - #define DLL_PUBLIC __declspec(dllexport) -#else - #define DLL_PUBLIC __declspec(dllimport) -#endif -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC not_a_zlib_function (void); diff --git a/test cases/unit/27 forcefallback/test_not_zlib.c b/test cases/unit/27 forcefallback/test_not_zlib.c deleted file mode 100644 index 36256af32..000000000 --- a/test cases/unit/27 forcefallback/test_not_zlib.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main (int ac, char **av) -{ - if (not_a_zlib_function () != 42) - return 1; - return 0; -} diff --git a/test cases/unit/27 pkgconfig usage/dependee/meson.build b/test cases/unit/27 pkgconfig usage/dependee/meson.build new file mode 100644 index 000000000..beb446c18 --- /dev/null +++ b/test cases/unit/27 pkgconfig usage/dependee/meson.build @@ -0,0 +1,7 @@ +project('pkgconfig user', 'c') + +pkgdep = dependency('libpkgdep') + +executable('pkguser', 'pkguser.c', + dependencies : pkgdep) + diff --git a/test cases/unit/27 pkgconfig usage/dependee/pkguser.c b/test cases/unit/27 pkgconfig usage/dependee/pkguser.c new file mode 100644 index 000000000..2bff316f1 --- /dev/null +++ b/test cases/unit/27 pkgconfig usage/dependee/pkguser.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + int res = pkgdep(); + return res != 99; +} diff --git a/test cases/unit/27 pkgconfig usage/dependency/meson.build b/test cases/unit/27 pkgconfig usage/dependency/meson.build new file mode 100644 index 000000000..89fae8e00 --- /dev/null +++ b/test cases/unit/27 pkgconfig usage/dependency/meson.build @@ -0,0 +1,24 @@ +project('pkgconfig dep', 'c', + version : '1.0.0') + +# This is not used in the code, only to check that it does not +# leak out to --libs. +glib_dep = dependency('glib-2.0') + +pkgconfig = import('pkgconfig') + +intlib = static_library('libpkgdep-int', 'privatelib.c') +intdep = declare_dependency(link_with : intlib) + +lib = shared_library('pkgdep', 'pkgdep.c', + dependencies : [glib_dep, intdep], + install : true) + +install_headers('pkgdep.h') + +pkgconfig.generate( + filebase : 'libpkgdep', + name : 'Libpkgdep', + description : 'Sample pkgconfig dependency library', + version : meson.project_version(), + libraries : lib) diff --git a/test cases/unit/27 pkgconfig usage/dependency/pkgdep.c b/test cases/unit/27 pkgconfig usage/dependency/pkgdep.c new file mode 100644 index 000000000..bd5c3f4d3 --- /dev/null +++ b/test cases/unit/27 pkgconfig usage/dependency/pkgdep.c @@ -0,0 +1,7 @@ +#include + +int internal_thingy(); + +int pkgdep() { + return internal_thingy(); +} diff --git a/test cases/unit/27 pkgconfig usage/dependency/pkgdep.h b/test cases/unit/27 pkgconfig usage/dependency/pkgdep.h new file mode 100644 index 000000000..16d622eb1 --- /dev/null +++ b/test cases/unit/27 pkgconfig usage/dependency/pkgdep.h @@ -0,0 +1,3 @@ +#pragma once + +int pkgdep(); diff --git a/test cases/unit/27 pkgconfig usage/dependency/privatelib.c b/test cases/unit/27 pkgconfig usage/dependency/privatelib.c new file mode 100644 index 000000000..71d2179c3 --- /dev/null +++ b/test cases/unit/27 pkgconfig usage/dependency/privatelib.c @@ -0,0 +1,3 @@ +int internal_thingy() { + return 99; +} diff --git a/test cases/unit/28 ndebug if-release/main.c b/test cases/unit/28 ndebug if-release/main.c new file mode 100644 index 000000000..70b3d044a --- /dev/null +++ b/test cases/unit/28 ndebug if-release/main.c @@ -0,0 +1,11 @@ +#include +#include + +int main(void) { +#ifdef NDEBUG + printf("NDEBUG=1\n"); +#else + printf("NDEBUG=0\n"); +#endif + return 0; +} diff --git a/test cases/unit/28 ndebug if-release/meson.build b/test cases/unit/28 ndebug if-release/meson.build new file mode 100644 index 000000000..4af2406d2 --- /dev/null +++ b/test cases/unit/28 ndebug if-release/meson.build @@ -0,0 +1,3 @@ +project('ndebug enabled', 'c') + +executable('main', 'main.c') diff --git a/test cases/unit/28 pkgconfig use libraries/app/app.c b/test cases/unit/28 pkgconfig use libraries/app/app.c deleted file mode 100644 index b271a9e61..000000000 --- a/test cases/unit/28 pkgconfig use libraries/app/app.c +++ /dev/null @@ -1,6 +0,0 @@ -void libb_func(); - -int main() { - libb_func(); - return 0; -} diff --git a/test cases/unit/28 pkgconfig use libraries/app/meson.build b/test cases/unit/28 pkgconfig use libraries/app/meson.build deleted file mode 100644 index 3d85a32f4..000000000 --- a/test cases/unit/28 pkgconfig use libraries/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/28 pkgconfig use libraries/lib/liba.c b/test cases/unit/28 pkgconfig use libraries/lib/liba.c deleted file mode 100644 index e98906b9c..000000000 --- a/test cases/unit/28 pkgconfig use libraries/lib/liba.c +++ /dev/null @@ -1,2 +0,0 @@ -void liba_func() { -} diff --git a/test cases/unit/28 pkgconfig use libraries/lib/libb.c b/test cases/unit/28 pkgconfig use libraries/lib/libb.c deleted file mode 100644 index 3160e5f52..000000000 --- a/test cases/unit/28 pkgconfig use libraries/lib/libb.c +++ /dev/null @@ -1,5 +0,0 @@ -void liba_func(); - -void libb_func() { - liba_func(); -} diff --git a/test cases/unit/28 pkgconfig use libraries/lib/meson.build b/test cases/unit/28 pkgconfig use libraries/lib/meson.build deleted file mode 100644 index 748adf47a..000000000 --- a/test cases/unit/28 pkgconfig use libraries/lib/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('lib', ['c']) - -a = library('test-a', 'liba.c', install: true) - -b = library('test-b', 'libb.c', link_with: a, install: true) - -import('pkgconfig').generate( - version: '0.0', - description: 'test library', - filebase: 'test-b', - name: 'test library', - libraries: [b], - subdirs: ['.'] -) - - diff --git a/test cases/unit/29 cross file overrides always args/meson.build b/test cases/unit/29 cross file overrides always args/meson.build deleted file mode 100644 index ef6556e54..000000000 --- a/test cases/unit/29 cross file overrides always args/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('cross compile args override always args', 'c') - -executable('no-file-offset-bits', 'test.c') diff --git a/test cases/unit/29 cross file overrides always args/test.c b/test cases/unit/29 cross file overrides always args/test.c deleted file mode 100644 index 315f92e96..000000000 --- a/test cases/unit/29 cross file overrides always args/test.c +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef _FILE_OFFSET_BITS - #error "_FILE_OFFSET_BITS should not be set" -#endif - -int main(int argc, char *argv[]) -{ - return 0; -} diff --git a/test cases/unit/29 cross file overrides always args/ubuntu-armhf-overrides.txt b/test cases/unit/29 cross file overrides always args/ubuntu-armhf-overrides.txt deleted file mode 100644 index a00a7d136..000000000 --- a/test cases/unit/29 cross file overrides always args/ubuntu-armhf-overrides.txt +++ /dev/null @@ -1,19 +0,0 @@ -[binaries] -# we could set exe_wrapper = qemu-arm-static but to test the case -# when cross compiled binaries can't be run we don't do that -c = '/usr/bin/arm-linux-gnueabihf-gcc' -cpp = '/usr/bin/arm-linux-gnueabihf-g++' -rust = ['rustc', '--target', 'arm-unknown-linux-gnueabihf', '-C', 'linker=/usr/bin/arm-linux-gnueabihf-gcc-7'] -ar = '/usr/arm-linux-gnueabihf/bin/ar' -strip = '/usr/arm-linux-gnueabihf/bin/strip' -pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' - -[properties] -root = '/usr/arm-linux-gnueabihf' -c_args = ['-U_FILE_OFFSET_BITS'] - -[host_machine] -system = 'linux' -cpu_family = 'arm' -cpu = 'armv7' # Not sure if correct. -endian = 'little' diff --git a/test cases/unit/29 guessed linker dependencies/exe/app.c b/test cases/unit/29 guessed linker dependencies/exe/app.c new file mode 100644 index 000000000..1031a4204 --- /dev/null +++ b/test cases/unit/29 guessed linker dependencies/exe/app.c @@ -0,0 +1,6 @@ +void liba_func(); + +int main() { + liba_func(); + return 0; +} diff --git a/test cases/unit/29 guessed linker dependencies/exe/meson.build b/test cases/unit/29 guessed linker dependencies/exe/meson.build new file mode 100644 index 000000000..8bb1bd7f6 --- /dev/null +++ b/test cases/unit/29 guessed linker dependencies/exe/meson.build @@ -0,0 +1,7 @@ +project('exe', ['c']) + +executable('app', + 'app.c', + # Use uninterpreted strings to avoid path finding by dependency or compiler.find_library + link_args: ['-ltest-lib'] + ) diff --git a/test cases/unit/29 guessed linker dependencies/lib/lib.c b/test cases/unit/29 guessed linker dependencies/lib/lib.c new file mode 100644 index 000000000..1a8f94ddb --- /dev/null +++ b/test cases/unit/29 guessed linker dependencies/lib/lib.c @@ -0,0 +1,20 @@ +#if defined _WIN32 + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +void DLL_PUBLIC liba_func() { +} + +#ifdef MORE_EXPORTS + +void DLL_PUBLIC libb_func() { +} + +#endif diff --git a/test cases/unit/29 guessed linker dependencies/lib/meson.build b/test cases/unit/29 guessed linker dependencies/lib/meson.build new file mode 100644 index 000000000..36df112b2 --- /dev/null +++ b/test cases/unit/29 guessed linker dependencies/lib/meson.build @@ -0,0 +1,11 @@ +project('lib1', ['c']) + +c_args = [] + +# Microsoft's compiler is quite smart about touching import libs on changes, +# so ensure that there is actually a change in symbols. +if get_option('more_exports') + c_args += '-DMORE_EXPORTS' +endif + +a = library('test-lib', 'lib.c', c_args: c_args, install: true) diff --git a/test cases/unit/29 guessed linker dependencies/lib/meson_options.txt b/test cases/unit/29 guessed linker dependencies/lib/meson_options.txt new file mode 100644 index 000000000..2123e457a --- /dev/null +++ b/test cases/unit/29 guessed linker dependencies/lib/meson_options.txt @@ -0,0 +1 @@ +option('more_exports', type : 'boolean', value : false) diff --git a/test cases/unit/30 command line/meson.build b/test cases/unit/30 command line/meson.build deleted file mode 100644 index 6207ca5e2..000000000 --- a/test cases/unit/30 command line/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -project('command line test', 'c', - default_options : ['default_library=static', 'set_sub_opt=true'] -) - -if get_option('set_sub_opt') - subproject('subp', default_options : ['subp_opt=default3']) -else - subproject('subp') -endif diff --git a/test cases/unit/30 command line/meson_options.txt b/test cases/unit/30 command line/meson_options.txt deleted file mode 100644 index 7acc112d8..000000000 --- a/test cases/unit/30 command line/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('set_sub_opt', type : 'boolean', value : false) diff --git a/test cases/unit/30 command line/subprojects/subp/meson.build b/test cases/unit/30 command line/subprojects/subp/meson.build deleted file mode 100644 index cf79fa42a..000000000 --- a/test cases/unit/30 command line/subprojects/subp/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('subp', - default_options : ['subp_opt=default2'] -) diff --git a/test cases/unit/30 command line/subprojects/subp/meson_options.txt b/test cases/unit/30 command line/subprojects/subp/meson_options.txt deleted file mode 100644 index 8c50615dd..000000000 --- a/test cases/unit/30 command line/subprojects/subp/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('subp_opt', type : 'string', value : 'default1') diff --git a/test cases/unit/30 mixed command line args/meson.build b/test cases/unit/30 mixed command line args/meson.build deleted file mode 100644 index af5cdc790..000000000 --- a/test cases/unit/30 mixed command line args/meson.build +++ /dev/null @@ -1 +0,0 @@ -project('Mixed command line arguments') diff --git a/test cases/unit/30 mixed command line args/meson_options.txt b/test cases/unit/30 mixed command line args/meson_options.txt deleted file mode 100644 index 5a4bc22bf..000000000 --- a/test cases/unit/30 mixed command line args/meson_options.txt +++ /dev/null @@ -1,10 +0,0 @@ -option( - 'one', - type : 'string', -) -option( - 'two', - type : 'combo', - choices : ['foo', 'bar'], - value : 'foo', -) diff --git a/test cases/unit/30 shared_mod linking/libfile.c b/test cases/unit/30 shared_mod linking/libfile.c new file mode 100644 index 000000000..44f7667d4 --- /dev/null +++ b/test cases/unit/30 shared_mod linking/libfile.c @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func() { + return 0; +} diff --git a/test cases/unit/30 shared_mod linking/main.c b/test cases/unit/30 shared_mod linking/main.c new file mode 100644 index 000000000..12f9c984b --- /dev/null +++ b/test cases/unit/30 shared_mod linking/main.c @@ -0,0 +1,11 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_IMPORT __declspec(dllimport) +#else + #define DLL_IMPORT +#endif + +int DLL_IMPORT func(); + +int main(int argc, char **arg) { + return func(); +} diff --git a/test cases/unit/30 shared_mod linking/meson.build b/test cases/unit/30 shared_mod linking/meson.build new file mode 100644 index 000000000..994a5d390 --- /dev/null +++ b/test cases/unit/30 shared_mod linking/meson.build @@ -0,0 +1,5 @@ +project('shared library linking test', 'c', 'cpp') + +mod = shared_module('mymod', 'libfile.c') + +exe = executable('prog', 'main.c', link_with : mod, install : true) \ No newline at end of file diff --git a/test cases/unit/31 forcefallback/meson.build b/test cases/unit/31 forcefallback/meson.build new file mode 100644 index 000000000..8d84a6035 --- /dev/null +++ b/test cases/unit/31 forcefallback/meson.build @@ -0,0 +1,9 @@ +project('mainproj', 'c', + default_options : []) + +zlib_dep = dependency('zlib', fallback: ['notzlib', 'zlib_dep']) +notfound_dep = dependency('cannotabletofind', fallback: ['definitelynotfound', 'some_var'], required : false) + +test_not_zlib = executable('test_not_zlib', ['test_not_zlib.c'], dependencies: [zlib_dep, notfound_dep]) + +test('test_not_zlib', test_not_zlib) diff --git a/test cases/unit/31 forcefallback/subprojects/notzlib/meson.build b/test cases/unit/31 forcefallback/subprojects/notzlib/meson.build new file mode 100644 index 000000000..254a1367b --- /dev/null +++ b/test cases/unit/31 forcefallback/subprojects/notzlib/meson.build @@ -0,0 +1,7 @@ +project('notzlib', 'c') + +notzlib_sources = ['notzlib.c'] + +notzlib = library('notzlib', notzlib_sources) + +zlib_dep = declare_dependency(link_with: notzlib, include_directories: include_directories(['.'])) diff --git a/test cases/unit/31 forcefallback/subprojects/notzlib/notzlib.c b/test cases/unit/31 forcefallback/subprojects/notzlib/notzlib.c new file mode 100644 index 000000000..c3b6bf9c2 --- /dev/null +++ b/test cases/unit/31 forcefallback/subprojects/notzlib/notzlib.c @@ -0,0 +1,6 @@ +#include "notzlib.h" + +int not_a_zlib_function (void) +{ + return 42; +} diff --git a/test cases/unit/31 forcefallback/subprojects/notzlib/notzlib.h b/test cases/unit/31 forcefallback/subprojects/notzlib/notzlib.h new file mode 100644 index 000000000..695921d75 --- /dev/null +++ b/test cases/unit/31 forcefallback/subprojects/notzlib/notzlib.h @@ -0,0 +1,18 @@ +#pragma once + +#if defined _WIN32 || defined __CYGWIN__ +#if defined BUILDING_DLL + #define DLL_PUBLIC __declspec(dllexport) +#else + #define DLL_PUBLIC __declspec(dllimport) +#endif +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC not_a_zlib_function (void); diff --git a/test cases/unit/31 forcefallback/test_not_zlib.c b/test cases/unit/31 forcefallback/test_not_zlib.c new file mode 100644 index 000000000..36256af32 --- /dev/null +++ b/test cases/unit/31 forcefallback/test_not_zlib.c @@ -0,0 +1,8 @@ +#include + +int main (int ac, char **av) +{ + if (not_a_zlib_function () != 42) + return 1; + return 0; +} diff --git a/test cases/unit/31 pkgconfig format/meson.build b/test cases/unit/31 pkgconfig format/meson.build deleted file mode 100644 index ea00f5df4..000000000 --- a/test cases/unit/31 pkgconfig format/meson.build +++ /dev/null @@ -1,18 +0,0 @@ -project('pkgformat', 'c', - version : '1.0') - -gio = dependency('gio-2.0', required: false) -if not gio.found() - error('MESON_SKIP_TEST glib not found.') -endif - -pkgg = import('pkgconfig') - -s = static_library('returner', 'someret.c') -l = library('something', 'somelib.c', link_whole: s) - -pkgg.generate(libraries: l, - version: '1.0', - name: 'libsomething', - description: 'A library that does something', - requires: 'gobject-2.0 >= 2.0, gio-2.0 >= 2.0') diff --git a/test cases/unit/31 pkgconfig format/somelib.c b/test cases/unit/31 pkgconfig format/somelib.c deleted file mode 100644 index 0558024b3..000000000 --- a/test cases/unit/31 pkgconfig format/somelib.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int get_returnvalue (void); - -int some_func() { - return get_returnvalue(); -} diff --git a/test cases/unit/31 pkgconfig format/someret.c b/test cases/unit/31 pkgconfig format/someret.c deleted file mode 100644 index 69f429928..000000000 --- a/test cases/unit/31 pkgconfig format/someret.c +++ /dev/null @@ -1,3 +0,0 @@ -int get_returnvalue (void) { - return 0; -} diff --git a/test cases/unit/32 pkgconfig use libraries/app/app.c b/test cases/unit/32 pkgconfig use libraries/app/app.c new file mode 100644 index 000000000..b271a9e61 --- /dev/null +++ b/test cases/unit/32 pkgconfig use libraries/app/app.c @@ -0,0 +1,6 @@ +void libb_func(); + +int main() { + libb_func(); + return 0; +} diff --git a/test cases/unit/32 pkgconfig use libraries/app/meson.build b/test cases/unit/32 pkgconfig use libraries/app/meson.build new file mode 100644 index 000000000..3d85a32f4 --- /dev/null +++ b/test cases/unit/32 pkgconfig use libraries/app/meson.build @@ -0,0 +1,5 @@ +project('app', ['c']) + +b = dependency('test-b') + +executable('app', 'app.c', dependencies : [b]) diff --git a/test cases/unit/32 pkgconfig use libraries/lib/liba.c b/test cases/unit/32 pkgconfig use libraries/lib/liba.c new file mode 100644 index 000000000..e98906b9c --- /dev/null +++ b/test cases/unit/32 pkgconfig use libraries/lib/liba.c @@ -0,0 +1,2 @@ +void liba_func() { +} diff --git a/test cases/unit/32 pkgconfig use libraries/lib/libb.c b/test cases/unit/32 pkgconfig use libraries/lib/libb.c new file mode 100644 index 000000000..3160e5f52 --- /dev/null +++ b/test cases/unit/32 pkgconfig use libraries/lib/libb.c @@ -0,0 +1,5 @@ +void liba_func(); + +void libb_func() { + liba_func(); +} diff --git a/test cases/unit/32 pkgconfig use libraries/lib/meson.build b/test cases/unit/32 pkgconfig use libraries/lib/meson.build new file mode 100644 index 000000000..748adf47a --- /dev/null +++ b/test cases/unit/32 pkgconfig use libraries/lib/meson.build @@ -0,0 +1,16 @@ +project('lib', ['c']) + +a = library('test-a', 'liba.c', install: true) + +b = library('test-b', 'libb.c', link_with: a, install: true) + +import('pkgconfig').generate( + version: '0.0', + description: 'test library', + filebase: 'test-b', + name: 'test library', + libraries: [b], + subdirs: ['.'] +) + + diff --git a/test cases/unit/32 python extmodule/blaster.py b/test cases/unit/32 python extmodule/blaster.py deleted file mode 100755 index 163b6d426..000000000 --- a/test cases/unit/32 python extmodule/blaster.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python - -import sys -import tachyon - -result = tachyon.phaserize('shoot') - -if not isinstance(result, int): - print('Returned result not an integer.') - sys.exit(1) - -if result != 1: - print('Returned result {} is not 1.'.format(result)) - sys.exit(1) diff --git a/test cases/unit/32 python extmodule/ext/meson.build b/test cases/unit/32 python extmodule/ext/meson.build deleted file mode 100644 index b13bb326f..000000000 --- a/test cases/unit/32 python extmodule/ext/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -pylib = py.extension_module('tachyon', - 'tachyon_module.c', - dependencies : py_dep, -) - -pypathdir = meson.current_build_dir() diff --git a/test cases/unit/32 python extmodule/ext/tachyon_module.c b/test cases/unit/32 python extmodule/ext/tachyon_module.c deleted file mode 100644 index 68eda5380..000000000 --- a/test cases/unit/32 python extmodule/ext/tachyon_module.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2018 The Meson development team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* A very simple Python extension module. */ - -#include -#include - -static PyObject* phaserize(PyObject *self, PyObject *args) { - const char *message; - int result; - - if(!PyArg_ParseTuple(args, "s", &message)) - return NULL; - - result = strcmp(message, "shoot") ? 0 : 1; -#if PY_VERSION_HEX < 0x03000000 - return PyInt_FromLong(result); -#else - return PyLong_FromLong(result); -#endif -} - -static PyMethodDef TachyonMethods[] = { - {"phaserize", phaserize, METH_VARARGS, - "Shoot tachyon cannons."}, - {NULL, NULL, 0, NULL} -}; - -#if PY_VERSION_HEX < 0x03000000 -PyMODINIT_FUNC inittachyon(void) { - Py_InitModule("tachyon", TachyonMethods); -} -#else -static struct PyModuleDef tachyonmodule = { - PyModuleDef_HEAD_INIT, - "tachyon", - NULL, - -1, - TachyonMethods -}; - -PyMODINIT_FUNC PyInit_tachyon(void) { - return PyModule_Create(&tachyonmodule); -} -#endif diff --git a/test cases/unit/32 python extmodule/meson.build b/test cases/unit/32 python extmodule/meson.build deleted file mode 100644 index 479865482..000000000 --- a/test cases/unit/32 python extmodule/meson.build +++ /dev/null @@ -1,23 +0,0 @@ -project('Python extension module', 'c', - default_options : ['buildtype=release']) - -py_mod = import('python') - -py = py_mod.find_installation(get_option('python'), required : false) - -if py.found() - py_dep = py.dependency() - - if py_dep.found() - subdir('ext') - - test('extmod', - py, - args : files('blaster.py'), - env : ['PYTHONPATH=' + pypathdir]) - else - error('MESON_SKIP_TEST: Python libraries not found, skipping test.') - endif -else - error('MESON_SKIP_TEST: Python not found, skipping test.') -endif diff --git a/test cases/unit/32 python extmodule/meson_options.txt b/test cases/unit/32 python extmodule/meson_options.txt deleted file mode 100644 index b8f645d09..000000000 --- a/test cases/unit/32 python extmodule/meson_options.txt +++ /dev/null @@ -1,3 +0,0 @@ -option('python', type: 'string', - description: 'Name of or path to the python executable' -) diff --git a/test cases/unit/33 cross file overrides always args/meson.build b/test cases/unit/33 cross file overrides always args/meson.build new file mode 100644 index 000000000..ef6556e54 --- /dev/null +++ b/test cases/unit/33 cross file overrides always args/meson.build @@ -0,0 +1,3 @@ +project('cross compile args override always args', 'c') + +executable('no-file-offset-bits', 'test.c') diff --git a/test cases/unit/33 cross file overrides always args/test.c b/test cases/unit/33 cross file overrides always args/test.c new file mode 100644 index 000000000..315f92e96 --- /dev/null +++ b/test cases/unit/33 cross file overrides always args/test.c @@ -0,0 +1,8 @@ +#ifdef _FILE_OFFSET_BITS + #error "_FILE_OFFSET_BITS should not be set" +#endif + +int main(int argc, char *argv[]) +{ + return 0; +} diff --git a/test cases/unit/33 cross file overrides always args/ubuntu-armhf-overrides.txt b/test cases/unit/33 cross file overrides always args/ubuntu-armhf-overrides.txt new file mode 100644 index 000000000..a00a7d136 --- /dev/null +++ b/test cases/unit/33 cross file overrides always args/ubuntu-armhf-overrides.txt @@ -0,0 +1,19 @@ +[binaries] +# we could set exe_wrapper = qemu-arm-static but to test the case +# when cross compiled binaries can't be run we don't do that +c = '/usr/bin/arm-linux-gnueabihf-gcc' +cpp = '/usr/bin/arm-linux-gnueabihf-g++' +rust = ['rustc', '--target', 'arm-unknown-linux-gnueabihf', '-C', 'linker=/usr/bin/arm-linux-gnueabihf-gcc-7'] +ar = '/usr/arm-linux-gnueabihf/bin/ar' +strip = '/usr/arm-linux-gnueabihf/bin/strip' +pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' + +[properties] +root = '/usr/arm-linux-gnueabihf' +c_args = ['-U_FILE_OFFSET_BITS'] + +[host_machine] +system = 'linux' +cpu_family = 'arm' +cpu = 'armv7' # Not sure if correct. +endian = 'little' diff --git a/test cases/unit/33 external, internal library rpath/built library/bar.c b/test cases/unit/33 external, internal library rpath/built library/bar.c deleted file mode 100644 index 4f5662ebd..000000000 --- a/test cases/unit/33 external, internal library rpath/built library/bar.c +++ /dev/null @@ -1,7 +0,0 @@ -int foo_system_value (void); -int faa_system_value (void); - -int bar_built_value (int in) -{ - return faa_system_value() + foo_system_value() + in; -} diff --git a/test cases/unit/33 external, internal library rpath/built library/meson.build b/test cases/unit/33 external, internal library rpath/built library/meson.build deleted file mode 100644 index 2b422f438..000000000 --- a/test cases/unit/33 external, internal library rpath/built library/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -project('built library', 'c') - -cc = meson.get_compiler('c') -foo_system_dep = cc.find_library('foo_in_system') -faa_pkg_dep = dependency('faa_pkg') - -l = shared_library('bar_built', 'bar.c', - install: true, - dependencies : [foo_system_dep, faa_pkg_dep]) - -e = executable('prog', 'prog.c', link_with: l, install: true) -test('testprog', e) diff --git a/test cases/unit/33 external, internal library rpath/built library/meson_options.txt b/test cases/unit/33 external, internal library rpath/built library/meson_options.txt deleted file mode 100644 index aa1d2ec9b..000000000 --- a/test cases/unit/33 external, internal library rpath/built library/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('foo_system_path', type: 'string', value: '') diff --git a/test cases/unit/33 external, internal library rpath/built library/prog.c b/test cases/unit/33 external, internal library rpath/built library/prog.c deleted file mode 100644 index e3d4cf63f..000000000 --- a/test cases/unit/33 external, internal library rpath/built library/prog.c +++ /dev/null @@ -1,7 +0,0 @@ -int bar_built_value (int in); - -int main (int argc, char *argv[]) -{ - // this will evaluate to 0 - return bar_built_value(10) - (42 + 1969 + 10); -} diff --git a/test cases/unit/33 external, internal library rpath/external library/faa.c b/test cases/unit/33 external, internal library rpath/external library/faa.c deleted file mode 100644 index 473357516..000000000 --- a/test cases/unit/33 external, internal library rpath/external library/faa.c +++ /dev/null @@ -1,4 +0,0 @@ -int faa_system_value (void) -{ - return 1969; -} diff --git a/test cases/unit/33 external, internal library rpath/external library/foo.c b/test cases/unit/33 external, internal library rpath/external library/foo.c deleted file mode 100644 index a34e4a885..000000000 --- a/test cases/unit/33 external, internal library rpath/external library/foo.c +++ /dev/null @@ -1,4 +0,0 @@ -int foo_system_value (void) -{ - return 42; -} diff --git a/test cases/unit/33 external, internal library rpath/external library/meson.build b/test cases/unit/33 external, internal library rpath/external library/meson.build deleted file mode 100644 index 6dcc97e79..000000000 --- a/test cases/unit/33 external, internal library rpath/external library/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -project('system library', 'c') - -shared_library('foo_in_system', 'foo.c', install : true) -l = shared_library('faa_pkg', 'faa.c', install: true) - -pkg = import('pkgconfig') -pkg.generate(name: 'faa_pkg', - libraries: [l, '-framework', 'CoreFoundation', '-framework', 'CoreMedia'], - description: 'FAA, a pkg-config test library') diff --git a/test cases/unit/34 command line/meson.build b/test cases/unit/34 command line/meson.build new file mode 100644 index 000000000..6207ca5e2 --- /dev/null +++ b/test cases/unit/34 command line/meson.build @@ -0,0 +1,9 @@ +project('command line test', 'c', + default_options : ['default_library=static', 'set_sub_opt=true'] +) + +if get_option('set_sub_opt') + subproject('subp', default_options : ['subp_opt=default3']) +else + subproject('subp') +endif diff --git a/test cases/unit/34 command line/meson_options.txt b/test cases/unit/34 command line/meson_options.txt new file mode 100644 index 000000000..7acc112d8 --- /dev/null +++ b/test cases/unit/34 command line/meson_options.txt @@ -0,0 +1 @@ +option('set_sub_opt', type : 'boolean', value : false) diff --git a/test cases/unit/34 command line/subprojects/subp/meson.build b/test cases/unit/34 command line/subprojects/subp/meson.build new file mode 100644 index 000000000..cf79fa42a --- /dev/null +++ b/test cases/unit/34 command line/subprojects/subp/meson.build @@ -0,0 +1,3 @@ +project('subp', + default_options : ['subp_opt=default2'] +) diff --git a/test cases/unit/34 command line/subprojects/subp/meson_options.txt b/test cases/unit/34 command line/subprojects/subp/meson_options.txt new file mode 100644 index 000000000..8c50615dd --- /dev/null +++ b/test cases/unit/34 command line/subprojects/subp/meson_options.txt @@ -0,0 +1 @@ +option('subp_opt', type : 'string', value : 'default1') diff --git a/test cases/unit/34 featurenew subprojects/meson.build b/test cases/unit/34 featurenew subprojects/meson.build deleted file mode 100644 index 27898cd79..000000000 --- a/test cases/unit/34 featurenew subprojects/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('featurenew subproject', meson_version: '>=0.45') - -foo = {} - -subproject('foo') -subproject('bar') diff --git a/test cases/unit/34 featurenew subprojects/subprojects/bar/meson.build b/test cases/unit/34 featurenew subprojects/subprojects/bar/meson.build deleted file mode 100644 index 712a125f7..000000000 --- a/test cases/unit/34 featurenew subprojects/subprojects/bar/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('foo subproject', meson_version: '>=0.46') - -import('python') diff --git a/test cases/unit/34 featurenew subprojects/subprojects/foo/meson.build b/test cases/unit/34 featurenew subprojects/subprojects/foo/meson.build deleted file mode 100644 index 0ef4472bd..000000000 --- a/test cases/unit/34 featurenew subprojects/subprojects/foo/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('foo subproject', meson_version: '>=0.40') - -disabler() diff --git a/test cases/unit/35 mixed command line args/meson.build b/test cases/unit/35 mixed command line args/meson.build new file mode 100644 index 000000000..af5cdc790 --- /dev/null +++ b/test cases/unit/35 mixed command line args/meson.build @@ -0,0 +1 @@ +project('Mixed command line arguments') diff --git a/test cases/unit/35 mixed command line args/meson_options.txt b/test cases/unit/35 mixed command line args/meson_options.txt new file mode 100644 index 000000000..5a4bc22bf --- /dev/null +++ b/test cases/unit/35 mixed command line args/meson_options.txt @@ -0,0 +1,10 @@ +option( + 'one', + type : 'string', +) +option( + 'two', + type : 'combo', + choices : ['foo', 'bar'], + value : 'foo', +) diff --git a/test cases/unit/35 rpath order/meson.build b/test cases/unit/35 rpath order/meson.build deleted file mode 100644 index a722894e5..000000000 --- a/test cases/unit/35 rpath order/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('myexe', 'c') - -sub1 = subproject('sub1') -sub1_dep = sub1.get_variable('sub1_dep') - -sub2 = subproject('sub2') -sub2_dep = sub2.get_variable('sub2_dep') - -executable('myexe', - 'myexe.c', - dependencies: [sub1_dep, sub2_dep]) diff --git a/test cases/unit/35 rpath order/myexe.c b/test cases/unit/35 rpath order/myexe.c deleted file mode 100644 index 03b2213bb..000000000 --- a/test cases/unit/35 rpath order/myexe.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(void) { - return 0; -} diff --git a/test cases/unit/35 rpath order/subprojects/sub1/lib.c b/test cases/unit/35 rpath order/subprojects/sub1/lib.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/35 rpath order/subprojects/sub1/meson.build b/test cases/unit/35 rpath order/subprojects/sub1/meson.build deleted file mode 100644 index 4dd5d0843..000000000 --- a/test cases/unit/35 rpath order/subprojects/sub1/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('sub1', 'c') - -sub1_lib = library('sub1', 'lib.c') - -sub1_dep = declare_dependency(link_with : sub1_lib) diff --git a/test cases/unit/35 rpath order/subprojects/sub2/lib.c b/test cases/unit/35 rpath order/subprojects/sub2/lib.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/35 rpath order/subprojects/sub2/meson.build b/test cases/unit/35 rpath order/subprojects/sub2/meson.build deleted file mode 100644 index bc3510db3..000000000 --- a/test cases/unit/35 rpath order/subprojects/sub2/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('sub2', 'c') - -sub2_lib = library('sub2', 'lib.c') - -sub2_dep = declare_dependency(link_with : sub2_lib) diff --git a/test cases/unit/36 dep order/lib1.c b/test cases/unit/36 dep order/lib1.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/36 dep order/lib2.c b/test cases/unit/36 dep order/lib2.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/36 dep order/meson.build b/test cases/unit/36 dep order/meson.build deleted file mode 100644 index 17cf9dfba..000000000 --- a/test cases/unit/36 dep order/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -project('myexe', 'c') - -lib1 = static_library('lib1', 'lib1.c') -lib2 = static_library('lib2', 'lib2.c') - -executable('myexe', - 'myexe.c', - link_with: [lib1, lib2]) diff --git a/test cases/unit/36 dep order/myexe.c b/test cases/unit/36 dep order/myexe.c deleted file mode 100644 index 8f4c045ee..000000000 --- a/test cases/unit/36 dep order/myexe.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(int ac, char** av) { - return 0; -} diff --git a/test cases/unit/36 pkgconfig format/meson.build b/test cases/unit/36 pkgconfig format/meson.build new file mode 100644 index 000000000..ea00f5df4 --- /dev/null +++ b/test cases/unit/36 pkgconfig format/meson.build @@ -0,0 +1,18 @@ +project('pkgformat', 'c', + version : '1.0') + +gio = dependency('gio-2.0', required: false) +if not gio.found() + error('MESON_SKIP_TEST glib not found.') +endif + +pkgg = import('pkgconfig') + +s = static_library('returner', 'someret.c') +l = library('something', 'somelib.c', link_whole: s) + +pkgg.generate(libraries: l, + version: '1.0', + name: 'libsomething', + description: 'A library that does something', + requires: 'gobject-2.0 >= 2.0, gio-2.0 >= 2.0') diff --git a/test cases/unit/36 pkgconfig format/somelib.c b/test cases/unit/36 pkgconfig format/somelib.c new file mode 100644 index 000000000..0558024b3 --- /dev/null +++ b/test cases/unit/36 pkgconfig format/somelib.c @@ -0,0 +1,7 @@ +#include + +int get_returnvalue (void); + +int some_func() { + return get_returnvalue(); +} diff --git a/test cases/unit/36 pkgconfig format/someret.c b/test cases/unit/36 pkgconfig format/someret.c new file mode 100644 index 000000000..69f429928 --- /dev/null +++ b/test cases/unit/36 pkgconfig format/someret.c @@ -0,0 +1,3 @@ +int get_returnvalue (void) { + return 0; +} diff --git a/test cases/unit/37 python extmodule/blaster.py b/test cases/unit/37 python extmodule/blaster.py new file mode 100755 index 000000000..163b6d426 --- /dev/null +++ b/test cases/unit/37 python extmodule/blaster.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import sys +import tachyon + +result = tachyon.phaserize('shoot') + +if not isinstance(result, int): + print('Returned result not an integer.') + sys.exit(1) + +if result != 1: + print('Returned result {} is not 1.'.format(result)) + sys.exit(1) diff --git a/test cases/unit/37 python extmodule/ext/meson.build b/test cases/unit/37 python extmodule/ext/meson.build new file mode 100644 index 000000000..b13bb326f --- /dev/null +++ b/test cases/unit/37 python extmodule/ext/meson.build @@ -0,0 +1,6 @@ +pylib = py.extension_module('tachyon', + 'tachyon_module.c', + dependencies : py_dep, +) + +pypathdir = meson.current_build_dir() diff --git a/test cases/unit/37 python extmodule/ext/tachyon_module.c b/test cases/unit/37 python extmodule/ext/tachyon_module.c new file mode 100644 index 000000000..68eda5380 --- /dev/null +++ b/test cases/unit/37 python extmodule/ext/tachyon_module.c @@ -0,0 +1,59 @@ +/* + Copyright 2018 The Meson development team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* A very simple Python extension module. */ + +#include +#include + +static PyObject* phaserize(PyObject *self, PyObject *args) { + const char *message; + int result; + + if(!PyArg_ParseTuple(args, "s", &message)) + return NULL; + + result = strcmp(message, "shoot") ? 0 : 1; +#if PY_VERSION_HEX < 0x03000000 + return PyInt_FromLong(result); +#else + return PyLong_FromLong(result); +#endif +} + +static PyMethodDef TachyonMethods[] = { + {"phaserize", phaserize, METH_VARARGS, + "Shoot tachyon cannons."}, + {NULL, NULL, 0, NULL} +}; + +#if PY_VERSION_HEX < 0x03000000 +PyMODINIT_FUNC inittachyon(void) { + Py_InitModule("tachyon", TachyonMethods); +} +#else +static struct PyModuleDef tachyonmodule = { + PyModuleDef_HEAD_INIT, + "tachyon", + NULL, + -1, + TachyonMethods +}; + +PyMODINIT_FUNC PyInit_tachyon(void) { + return PyModule_Create(&tachyonmodule); +} +#endif diff --git a/test cases/unit/37 python extmodule/meson.build b/test cases/unit/37 python extmodule/meson.build new file mode 100644 index 000000000..479865482 --- /dev/null +++ b/test cases/unit/37 python extmodule/meson.build @@ -0,0 +1,23 @@ +project('Python extension module', 'c', + default_options : ['buildtype=release']) + +py_mod = import('python') + +py = py_mod.find_installation(get_option('python'), required : false) + +if py.found() + py_dep = py.dependency() + + if py_dep.found() + subdir('ext') + + test('extmod', + py, + args : files('blaster.py'), + env : ['PYTHONPATH=' + pypathdir]) + else + error('MESON_SKIP_TEST: Python libraries not found, skipping test.') + endif +else + error('MESON_SKIP_TEST: Python not found, skipping test.') +endif diff --git a/test cases/unit/37 python extmodule/meson_options.txt b/test cases/unit/37 python extmodule/meson_options.txt new file mode 100644 index 000000000..b8f645d09 --- /dev/null +++ b/test cases/unit/37 python extmodule/meson_options.txt @@ -0,0 +1,3 @@ +option('python', type: 'string', + description: 'Name of or path to the python executable' +) diff --git a/test cases/unit/38 external, internal library rpath/built library/bar.c b/test cases/unit/38 external, internal library rpath/built library/bar.c new file mode 100644 index 000000000..4f5662ebd --- /dev/null +++ b/test cases/unit/38 external, internal library rpath/built library/bar.c @@ -0,0 +1,7 @@ +int foo_system_value (void); +int faa_system_value (void); + +int bar_built_value (int in) +{ + return faa_system_value() + foo_system_value() + in; +} diff --git a/test cases/unit/38 external, internal library rpath/built library/meson.build b/test cases/unit/38 external, internal library rpath/built library/meson.build new file mode 100644 index 000000000..2b422f438 --- /dev/null +++ b/test cases/unit/38 external, internal library rpath/built library/meson.build @@ -0,0 +1,12 @@ +project('built library', 'c') + +cc = meson.get_compiler('c') +foo_system_dep = cc.find_library('foo_in_system') +faa_pkg_dep = dependency('faa_pkg') + +l = shared_library('bar_built', 'bar.c', + install: true, + dependencies : [foo_system_dep, faa_pkg_dep]) + +e = executable('prog', 'prog.c', link_with: l, install: true) +test('testprog', e) diff --git a/test cases/unit/38 external, internal library rpath/built library/meson_options.txt b/test cases/unit/38 external, internal library rpath/built library/meson_options.txt new file mode 100644 index 000000000..aa1d2ec9b --- /dev/null +++ b/test cases/unit/38 external, internal library rpath/built library/meson_options.txt @@ -0,0 +1 @@ +option('foo_system_path', type: 'string', value: '') diff --git a/test cases/unit/38 external, internal library rpath/built library/prog.c b/test cases/unit/38 external, internal library rpath/built library/prog.c new file mode 100644 index 000000000..e3d4cf63f --- /dev/null +++ b/test cases/unit/38 external, internal library rpath/built library/prog.c @@ -0,0 +1,7 @@ +int bar_built_value (int in); + +int main (int argc, char *argv[]) +{ + // this will evaluate to 0 + return bar_built_value(10) - (42 + 1969 + 10); +} diff --git a/test cases/unit/38 external, internal library rpath/external library/faa.c b/test cases/unit/38 external, internal library rpath/external library/faa.c new file mode 100644 index 000000000..473357516 --- /dev/null +++ b/test cases/unit/38 external, internal library rpath/external library/faa.c @@ -0,0 +1,4 @@ +int faa_system_value (void) +{ + return 1969; +} diff --git a/test cases/unit/38 external, internal library rpath/external library/foo.c b/test cases/unit/38 external, internal library rpath/external library/foo.c new file mode 100644 index 000000000..a34e4a885 --- /dev/null +++ b/test cases/unit/38 external, internal library rpath/external library/foo.c @@ -0,0 +1,4 @@ +int foo_system_value (void) +{ + return 42; +} diff --git a/test cases/unit/38 external, internal library rpath/external library/meson.build b/test cases/unit/38 external, internal library rpath/external library/meson.build new file mode 100644 index 000000000..6dcc97e79 --- /dev/null +++ b/test cases/unit/38 external, internal library rpath/external library/meson.build @@ -0,0 +1,9 @@ +project('system library', 'c') + +shared_library('foo_in_system', 'foo.c', install : true) +l = shared_library('faa_pkg', 'faa.c', install: true) + +pkg = import('pkgconfig') +pkg.generate(name: 'faa_pkg', + libraries: [l, '-framework', 'CoreFoundation', '-framework', 'CoreMedia'], + description: 'FAA, a pkg-config test library') diff --git a/test cases/unit/39 featurenew subprojects/meson.build b/test cases/unit/39 featurenew subprojects/meson.build new file mode 100644 index 000000000..27898cd79 --- /dev/null +++ b/test cases/unit/39 featurenew subprojects/meson.build @@ -0,0 +1,6 @@ +project('featurenew subproject', meson_version: '>=0.45') + +foo = {} + +subproject('foo') +subproject('bar') diff --git a/test cases/unit/39 featurenew subprojects/subprojects/bar/meson.build b/test cases/unit/39 featurenew subprojects/subprojects/bar/meson.build new file mode 100644 index 000000000..712a125f7 --- /dev/null +++ b/test cases/unit/39 featurenew subprojects/subprojects/bar/meson.build @@ -0,0 +1,3 @@ +project('foo subproject', meson_version: '>=0.46') + +import('python') diff --git a/test cases/unit/39 featurenew subprojects/subprojects/foo/meson.build b/test cases/unit/39 featurenew subprojects/subprojects/foo/meson.build new file mode 100644 index 000000000..0ef4472bd --- /dev/null +++ b/test cases/unit/39 featurenew subprojects/subprojects/foo/meson.build @@ -0,0 +1,3 @@ +project('foo subproject', meson_version: '>=0.40') + +disabler() diff --git a/test cases/unit/40 rpath order/meson.build b/test cases/unit/40 rpath order/meson.build new file mode 100644 index 000000000..a722894e5 --- /dev/null +++ b/test cases/unit/40 rpath order/meson.build @@ -0,0 +1,11 @@ +project('myexe', 'c') + +sub1 = subproject('sub1') +sub1_dep = sub1.get_variable('sub1_dep') + +sub2 = subproject('sub2') +sub2_dep = sub2.get_variable('sub2_dep') + +executable('myexe', + 'myexe.c', + dependencies: [sub1_dep, sub2_dep]) diff --git a/test cases/unit/40 rpath order/myexe.c b/test cases/unit/40 rpath order/myexe.c new file mode 100644 index 000000000..03b2213bb --- /dev/null +++ b/test cases/unit/40 rpath order/myexe.c @@ -0,0 +1,3 @@ +int main(void) { + return 0; +} diff --git a/test cases/unit/40 rpath order/subprojects/sub1/lib.c b/test cases/unit/40 rpath order/subprojects/sub1/lib.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/40 rpath order/subprojects/sub1/meson.build b/test cases/unit/40 rpath order/subprojects/sub1/meson.build new file mode 100644 index 000000000..4dd5d0843 --- /dev/null +++ b/test cases/unit/40 rpath order/subprojects/sub1/meson.build @@ -0,0 +1,5 @@ +project('sub1', 'c') + +sub1_lib = library('sub1', 'lib.c') + +sub1_dep = declare_dependency(link_with : sub1_lib) diff --git a/test cases/unit/40 rpath order/subprojects/sub2/lib.c b/test cases/unit/40 rpath order/subprojects/sub2/lib.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/40 rpath order/subprojects/sub2/meson.build b/test cases/unit/40 rpath order/subprojects/sub2/meson.build new file mode 100644 index 000000000..bc3510db3 --- /dev/null +++ b/test cases/unit/40 rpath order/subprojects/sub2/meson.build @@ -0,0 +1,5 @@ +project('sub2', 'c') + +sub2_lib = library('sub2', 'lib.c') + +sub2_dep = declare_dependency(link_with : sub2_lib) diff --git a/test cases/unit/41 dep order/lib1.c b/test cases/unit/41 dep order/lib1.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/41 dep order/lib2.c b/test cases/unit/41 dep order/lib2.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/41 dep order/meson.build b/test cases/unit/41 dep order/meson.build new file mode 100644 index 000000000..17cf9dfba --- /dev/null +++ b/test cases/unit/41 dep order/meson.build @@ -0,0 +1,8 @@ +project('myexe', 'c') + +lib1 = static_library('lib1', 'lib1.c') +lib2 = static_library('lib2', 'lib2.c') + +executable('myexe', + 'myexe.c', + link_with: [lib1, lib2]) diff --git a/test cases/unit/41 dep order/myexe.c b/test cases/unit/41 dep order/myexe.c new file mode 100644 index 000000000..8f4c045ee --- /dev/null +++ b/test cases/unit/41 dep order/myexe.c @@ -0,0 +1,3 @@ +int main(int ac, char** av) { + return 0; +} diff --git a/test cases/unit/8 -L -l order/first.pc b/test cases/unit/8 -L -l order/first.pc new file mode 100644 index 000000000..3b811b2e2 --- /dev/null +++ b/test cases/unit/8 -L -l order/first.pc @@ -0,0 +1,13 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${prefix}/lib/x86_64-linux-gnu +sharedlibdir=${libdir} +includedir=${prefix}/include + +Name: jonne +Description: jonne library +Version: 1.0.0 + +Requires: +Libs: -L/me/first -lfoo1 -L/me/second -lfoo2 +Cflags: -I${includedir} diff --git a/test cases/unit/8 -L -l order/meson.build b/test cases/unit/8 -L -l order/meson.build new file mode 100644 index 000000000..cfcf033fa --- /dev/null +++ b/test cases/unit/8 -L -l order/meson.build @@ -0,0 +1,6 @@ +project('jonne', 'c') + +firstdep = dependency('first') +seconddep = dependency('second') + +executable('lprog', 'prog.c', dependencies : [firstdep, seconddep]) diff --git a/test cases/unit/8 -L -l order/prog.c b/test cases/unit/8 -L -l order/prog.c new file mode 100644 index 000000000..3a16ac3dc --- /dev/null +++ b/test cases/unit/8 -L -l order/prog.c @@ -0,0 +1,5 @@ +#include + +int main(int argc, char **argv) { + return 0; +} diff --git a/test cases/unit/8 -L -l order/second.pc b/test cases/unit/8 -L -l order/second.pc new file mode 100644 index 000000000..196824b74 --- /dev/null +++ b/test cases/unit/8 -L -l order/second.pc @@ -0,0 +1,13 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${prefix}/lib/x86_64-linux-gnu +sharedlibdir=${libdir} +includedir=${prefix}/include + +Name: jonne2 +Description: jonne2 library +Version: 1.0.0 + +Requires: +Libs: -L/me/third -lfoo3 -L/me/fourth -lfoo4 +Cflags: -I${includedir} diff --git a/test cases/unit/9 -L -l order/first.pc b/test cases/unit/9 -L -l order/first.pc deleted file mode 100644 index 3b811b2e2..000000000 --- a/test cases/unit/9 -L -l order/first.pc +++ /dev/null @@ -1,13 +0,0 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=${prefix}/lib/x86_64-linux-gnu -sharedlibdir=${libdir} -includedir=${prefix}/include - -Name: jonne -Description: jonne library -Version: 1.0.0 - -Requires: -Libs: -L/me/first -lfoo1 -L/me/second -lfoo2 -Cflags: -I${includedir} diff --git a/test cases/unit/9 -L -l order/meson.build b/test cases/unit/9 -L -l order/meson.build deleted file mode 100644 index cfcf033fa..000000000 --- a/test cases/unit/9 -L -l order/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('jonne', 'c') - -firstdep = dependency('first') -seconddep = dependency('second') - -executable('lprog', 'prog.c', dependencies : [firstdep, seconddep]) diff --git a/test cases/unit/9 -L -l order/prog.c b/test cases/unit/9 -L -l order/prog.c deleted file mode 100644 index 3a16ac3dc..000000000 --- a/test cases/unit/9 -L -l order/prog.c +++ /dev/null @@ -1,5 +0,0 @@ -#include - -int main(int argc, char **argv) { - return 0; -} diff --git a/test cases/unit/9 -L -l order/second.pc b/test cases/unit/9 -L -l order/second.pc deleted file mode 100644 index 196824b74..000000000 --- a/test cases/unit/9 -L -l order/second.pc +++ /dev/null @@ -1,13 +0,0 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=${prefix}/lib/x86_64-linux-gnu -sharedlibdir=${libdir} -includedir=${prefix}/include - -Name: jonne2 -Description: jonne2 library -Version: 1.0.0 - -Requires: -Libs: -L/me/third -lfoo3 -L/me/fourth -lfoo4 -Cflags: -I${includedir} diff --git a/test cases/unit/9 d dedup/meson.build b/test cases/unit/9 d dedup/meson.build new file mode 100644 index 000000000..08f3a6c67 --- /dev/null +++ b/test cases/unit/9 d dedup/meson.build @@ -0,0 +1,6 @@ +project('d dedup', 'c') + +add_project_arguments('-D', 'FOO', '-D', 'BAR', language : 'c') + +executable('prog', 'prog.c') + diff --git a/test cases/unit/9 d dedup/prog.c b/test cases/unit/9 d dedup/prog.c new file mode 100644 index 000000000..505f12280 --- /dev/null +++ b/test cases/unit/9 d dedup/prog.c @@ -0,0 +1,14 @@ +#include + +#ifndef FOO +#error FOO is not defined. +#endif + +#ifndef BAR +#error BAR is not defined. +#endif + +int main(int argc, char **argv) { + printf("All is well.\n"); + return 0; +} diff --git a/test cases/windows/10 vs module defs generated custom target/meson.build b/test cases/windows/10 vs module defs generated custom target/meson.build new file mode 100644 index 000000000..fe594c878 --- /dev/null +++ b/test cases/windows/10 vs module defs generated custom target/meson.build @@ -0,0 +1,10 @@ +project('generated_dll_module_defs', 'c') + +if meson.backend().startswith('vs') + # FIXME: Broken on the VS backends + error('MESON_SKIP_TEST see https://github.com/mesonbuild/meson/issues/1799') +endif + +subdir('subdir') +exe = executable('prog', 'prog.c', link_with : shlib) +test('runtest', exe) 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 new file mode 100644 index 000000000..f35f4a02d --- /dev/null +++ b/test cases/windows/10 vs module defs generated custom target/prog.c @@ -0,0 +1,5 @@ +int somedllfunc(); + +int main(int argc, char **argv) { + return somedllfunc() == 42 ? 0 : 1; +} diff --git a/test cases/windows/10 vs module defs generated custom target/subdir/make_def.py b/test cases/windows/10 vs module defs generated custom target/subdir/make_def.py new file mode 100755 index 000000000..50acfb5ef --- /dev/null +++ b/test cases/windows/10 vs module defs generated custom target/subdir/make_def.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +import sys + +with open(sys.argv[1], 'w') as f: + print('EXPORTS', file=f) + print(' somedllfunc', file=f) diff --git a/test cases/windows/10 vs module defs generated custom target/subdir/meson.build b/test cases/windows/10 vs module defs generated custom target/subdir/meson.build new file mode 100644 index 000000000..c4ae33ae4 --- /dev/null +++ b/test cases/windows/10 vs module defs generated custom target/subdir/meson.build @@ -0,0 +1,7 @@ +make_def = find_program('make_def.py') + +def_file = custom_target('gen_def', + command: [make_def, '@OUTPUT@'], + output: 'somedll.def') + +shlib = shared_library('somedll', 'somedll.c', vs_module_defs: def_file) diff --git a/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c b/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c new file mode 100644 index 000000000..b23d8fed5 --- /dev/null +++ b/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c @@ -0,0 +1,3 @@ +int somedllfunc() { + return 42; +} diff --git a/test cases/windows/10 vs module defs generated/meson.build b/test cases/windows/10 vs module defs generated/meson.build deleted file mode 100644 index 7728ca77a..000000000 --- a/test cases/windows/10 vs module defs generated/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('generated_dll_module_defs', 'c') - -subdir('subdir') -exe = executable('prog', 'prog.c', link_with : shlib) -test('runtest', exe) diff --git a/test cases/windows/10 vs module defs generated/prog.c b/test cases/windows/10 vs module defs generated/prog.c deleted file mode 100644 index f35f4a02d..000000000 --- a/test cases/windows/10 vs module defs generated/prog.c +++ /dev/null @@ -1,5 +0,0 @@ -int somedllfunc(); - -int main(int argc, char **argv) { - return somedllfunc() == 42 ? 0 : 1; -} diff --git a/test cases/windows/10 vs module defs generated/subdir/meson.build b/test cases/windows/10 vs module defs generated/subdir/meson.build deleted file mode 100644 index 5d390a0b5..000000000 --- a/test cases/windows/10 vs module defs generated/subdir/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -conf = configuration_data() -conf.set('func', 'somedllfunc') -def_file = configure_file( - input: 'somedll.def.in', - output: 'somedll.def', - configuration : conf, -) - -shlib = shared_library('somedll', 'somedll.c', vs_module_defs : def_file) diff --git a/test cases/windows/10 vs module defs generated/subdir/somedll.c b/test cases/windows/10 vs module defs generated/subdir/somedll.c deleted file mode 100644 index b23d8fed5..000000000 --- a/test cases/windows/10 vs module defs generated/subdir/somedll.c +++ /dev/null @@ -1,3 +0,0 @@ -int somedllfunc() { - return 42; -} diff --git a/test cases/windows/10 vs module defs generated/subdir/somedll.def.in b/test cases/windows/10 vs module defs generated/subdir/somedll.def.in deleted file mode 100644 index c29207c71..000000000 --- a/test cases/windows/10 vs module defs generated/subdir/somedll.def.in +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS - @func@ diff --git a/test cases/windows/11 exe implib/installed_files.txt b/test cases/windows/11 exe implib/installed_files.txt new file mode 100644 index 000000000..bd2abe92b --- /dev/null +++ b/test cases/windows/11 exe implib/installed_files.txt @@ -0,0 +1,8 @@ +usr/bin/prog.exe +usr/bin/prog.pdb +usr/bin/prog2.exe +usr/bin/prog2.pdb +?gcc:usr/lib/libprog.exe.a +?gcc:usr/lib/libburble.a +?msvc:usr/lib/prog.exe.lib +?msvc:usr/lib/burble.lib diff --git a/test cases/windows/11 exe implib/meson.build b/test cases/windows/11 exe implib/meson.build new file mode 100644 index 000000000..0a38ec13e --- /dev/null +++ b/test cases/windows/11 exe implib/meson.build @@ -0,0 +1,7 @@ +project('wintest', 'c') + +# Test that we can produce an implib for an executable on Windows, and that it's +# name can be set, and that it is installed along with the executable + +executable('prog', 'prog.c', install: true, implib: true) +executable('prog2', 'prog.c', install: true, implib: 'burble', install_dir: get_option('bindir')) diff --git a/test cases/windows/11 exe implib/prog.c b/test cases/windows/11 exe implib/prog.c new file mode 100644 index 000000000..6d5a9f501 --- /dev/null +++ b/test cases/windows/11 exe implib/prog.c @@ -0,0 +1,6 @@ +#include + +int __declspec(dllexport) +main(int argc, char **argv) { + return 0; +} diff --git a/test cases/windows/11 vs module defs generated custom target/meson.build b/test cases/windows/11 vs module defs generated custom target/meson.build deleted file mode 100644 index fe594c878..000000000 --- a/test cases/windows/11 vs module defs generated custom target/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -project('generated_dll_module_defs', 'c') - -if meson.backend().startswith('vs') - # FIXME: Broken on the VS backends - error('MESON_SKIP_TEST see https://github.com/mesonbuild/meson/issues/1799') -endif - -subdir('subdir') -exe = executable('prog', 'prog.c', link_with : shlib) -test('runtest', exe) diff --git a/test cases/windows/11 vs module defs generated custom target/prog.c b/test cases/windows/11 vs module defs generated custom target/prog.c deleted file mode 100644 index f35f4a02d..000000000 --- a/test cases/windows/11 vs module defs generated custom target/prog.c +++ /dev/null @@ -1,5 +0,0 @@ -int somedllfunc(); - -int main(int argc, char **argv) { - return somedllfunc() == 42 ? 0 : 1; -} diff --git a/test cases/windows/11 vs module defs generated custom target/subdir/make_def.py b/test cases/windows/11 vs module defs generated custom target/subdir/make_def.py deleted file mode 100755 index 50acfb5ef..000000000 --- a/test cases/windows/11 vs module defs generated custom target/subdir/make_def.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 -import sys - -with open(sys.argv[1], 'w') as f: - print('EXPORTS', file=f) - print(' somedllfunc', file=f) diff --git a/test cases/windows/11 vs module defs generated custom target/subdir/meson.build b/test cases/windows/11 vs module defs generated custom target/subdir/meson.build deleted file mode 100644 index c4ae33ae4..000000000 --- a/test cases/windows/11 vs module defs generated custom target/subdir/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -make_def = find_program('make_def.py') - -def_file = custom_target('gen_def', - command: [make_def, '@OUTPUT@'], - output: 'somedll.def') - -shlib = shared_library('somedll', 'somedll.c', vs_module_defs: def_file) diff --git a/test cases/windows/11 vs module defs generated custom target/subdir/somedll.c b/test cases/windows/11 vs module defs generated custom target/subdir/somedll.c deleted file mode 100644 index b23d8fed5..000000000 --- a/test cases/windows/11 vs module defs generated custom target/subdir/somedll.c +++ /dev/null @@ -1,3 +0,0 @@ -int somedllfunc() { - return 42; -} diff --git a/test cases/windows/12 exe implib/installed_files.txt b/test cases/windows/12 exe implib/installed_files.txt deleted file mode 100644 index bd2abe92b..000000000 --- a/test cases/windows/12 exe implib/installed_files.txt +++ /dev/null @@ -1,8 +0,0 @@ -usr/bin/prog.exe -usr/bin/prog.pdb -usr/bin/prog2.exe -usr/bin/prog2.pdb -?gcc:usr/lib/libprog.exe.a -?gcc:usr/lib/libburble.a -?msvc:usr/lib/prog.exe.lib -?msvc:usr/lib/burble.lib diff --git a/test cases/windows/12 exe implib/meson.build b/test cases/windows/12 exe implib/meson.build deleted file mode 100644 index 0a38ec13e..000000000 --- a/test cases/windows/12 exe implib/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('wintest', 'c') - -# Test that we can produce an implib for an executable on Windows, and that it's -# name can be set, and that it is installed along with the executable - -executable('prog', 'prog.c', install: true, implib: true) -executable('prog2', 'prog.c', install: true, implib: 'burble', install_dir: get_option('bindir')) diff --git a/test cases/windows/12 exe implib/prog.c b/test cases/windows/12 exe implib/prog.c deleted file mode 100644 index 6d5a9f501..000000000 --- a/test cases/windows/12 exe implib/prog.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int __declspec(dllexport) -main(int argc, char **argv) { - return 0; -} diff --git a/test cases/windows/12 resources with custom targets/meson.build b/test cases/windows/12 resources with custom targets/meson.build new file mode 100644 index 000000000..b1e2b091b --- /dev/null +++ b/test cases/windows/12 resources with custom targets/meson.build @@ -0,0 +1,70 @@ +project('winmain', 'c') + +# MinGW windres has a bug due to which it doesn't parse args with space properly: +# https://github.com/mesonbuild/meson/pull/1346 +# https://sourceware.org/bugzilla/show_bug.cgi?id=4933 +if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windows' + # Construct build_to_src and skip this test if it has spaces + # because then the -I flag to windres will also have spaces + # and we know the test will fail + src_parts = meson.source_root().split('/') + build_parts = meson.build_root().split('/') + + # Get the common path (which might just be '/' or 'C:/') + common = [] + done = false + count = 0 + if src_parts.length() > build_parts.length() + parts = build_parts + other = src_parts + else + parts = src_parts + other = build_parts + endif + foreach part : parts + if not done and part == other.get(count) + common += [part] + else + done = true + endif + count += 1 + endforeach + + # Create path components to go down from the build root to the common path + count = 0 + rel = build_parts + foreach build : build_parts + if count < build_parts.length() - common.length() + rel += ['..'] + endif + count += 1 + endforeach + + # Create path components to go up from the common path to the build root + count = 0 + foreach src : src_parts + if count >= common.length() + rel += [src] + endif + count += 1 + endforeach + + build_to_src = '/'.join(rel) + + if build_to_src.contains(' ') + message('build_to_src is: ' + build_to_src) + error('MESON_SKIP_TEST build_to_src has spaces') + endif + # Welcome to the end of this conditional. + # We hope you never have to implement something like this. +endif + +subdir('res') + +foreach id : [0, 1, 2] + exe = executable('prog_@0@'.format(id), 'prog.c', + res[id], + gui_app : true) + + test('winmain_@0@'.format(id), exe) +endforeach diff --git a/test cases/windows/12 resources with custom targets/prog.c b/test cases/windows/12 resources with custom targets/prog.c new file mode 100644 index 000000000..2bef6a278 --- /dev/null +++ b/test cases/windows/12 resources with custom targets/prog.c @@ -0,0 +1,14 @@ +#include + +#define MY_ICON 1 + +int APIENTRY +WinMain( + HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpszCmdLine, + int nCmdShow) { + HICON hIcon; + hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); + return hIcon ? 0 : 1; +} diff --git a/test cases/windows/12 resources with custom targets/res/gen-res.py b/test cases/windows/12 resources with custom targets/res/gen-res.py new file mode 100755 index 000000000..2feb02f5b --- /dev/null +++ b/test cases/windows/12 resources with custom targets/res/gen-res.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys + +with open(sys.argv[1], 'r') as infile, open(sys.argv[2], 'w') as outfile: + outfile.write(infile.read().format(icon=sys.argv[3])) diff --git a/test cases/windows/12 resources with custom targets/res/meson.build b/test cases/windows/12 resources with custom targets/res/meson.build new file mode 100644 index 000000000..97976370b --- /dev/null +++ b/test cases/windows/12 resources with custom targets/res/meson.build @@ -0,0 +1,19 @@ +win = import('windows') + +rc_writer = find_program('./gen-res.py') + +rc_sources = [] + +foreach id : [1, 2] + rc_sources += custom_target('RC source file @0@'.format(id), + input : 'myres.rc.in', + output : 'myres_@0@.rc'.format(id), + command : [rc_writer, '@INPUT@', '@OUTPUT@', files('sample.ico')], + install : false, + build_always : false) +endforeach + +rc_sources += files('myres_static.rc') + +res = win.compile_resources(rc_sources, + include_directories: include_directories('.')) diff --git a/test cases/windows/12 resources with custom targets/res/myres.rc.in b/test cases/windows/12 resources with custom targets/res/myres.rc.in new file mode 100644 index 000000000..0cff642ba --- /dev/null +++ b/test cases/windows/12 resources with custom targets/res/myres.rc.in @@ -0,0 +1,4 @@ +#include +#include + +1 ICON "{icon}" diff --git a/test cases/windows/12 resources with custom targets/res/myres_static.rc b/test cases/windows/12 resources with custom targets/res/myres_static.rc new file mode 100644 index 000000000..12838aee2 --- /dev/null +++ b/test cases/windows/12 resources with custom targets/res/myres_static.rc @@ -0,0 +1,3 @@ +#include + +1 ICON "sample.ico" diff --git a/test cases/windows/12 resources with custom targets/res/resource.h b/test cases/windows/12 resources with custom targets/res/resource.h new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/windows/12 resources with custom targets/res/sample.ico b/test cases/windows/12 resources with custom targets/res/sample.ico new file mode 100644 index 000000000..24bd3d9e9 Binary files /dev/null and b/test cases/windows/12 resources with custom targets/res/sample.ico differ diff --git a/test cases/windows/13 resources with custom targets/meson.build b/test cases/windows/13 resources with custom targets/meson.build deleted file mode 100644 index b1e2b091b..000000000 --- a/test cases/windows/13 resources with custom targets/meson.build +++ /dev/null @@ -1,70 +0,0 @@ -project('winmain', 'c') - -# MinGW windres has a bug due to which it doesn't parse args with space properly: -# https://github.com/mesonbuild/meson/pull/1346 -# https://sourceware.org/bugzilla/show_bug.cgi?id=4933 -if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windows' - # Construct build_to_src and skip this test if it has spaces - # because then the -I flag to windres will also have spaces - # and we know the test will fail - src_parts = meson.source_root().split('/') - build_parts = meson.build_root().split('/') - - # Get the common path (which might just be '/' or 'C:/') - common = [] - done = false - count = 0 - if src_parts.length() > build_parts.length() - parts = build_parts - other = src_parts - else - parts = src_parts - other = build_parts - endif - foreach part : parts - if not done and part == other.get(count) - common += [part] - else - done = true - endif - count += 1 - endforeach - - # Create path components to go down from the build root to the common path - count = 0 - rel = build_parts - foreach build : build_parts - if count < build_parts.length() - common.length() - rel += ['..'] - endif - count += 1 - endforeach - - # Create path components to go up from the common path to the build root - count = 0 - foreach src : src_parts - if count >= common.length() - rel += [src] - endif - count += 1 - endforeach - - build_to_src = '/'.join(rel) - - if build_to_src.contains(' ') - message('build_to_src is: ' + build_to_src) - error('MESON_SKIP_TEST build_to_src has spaces') - endif - # Welcome to the end of this conditional. - # We hope you never have to implement something like this. -endif - -subdir('res') - -foreach id : [0, 1, 2] - exe = executable('prog_@0@'.format(id), 'prog.c', - res[id], - gui_app : true) - - test('winmain_@0@'.format(id), exe) -endforeach diff --git a/test cases/windows/13 resources with custom targets/prog.c b/test cases/windows/13 resources with custom targets/prog.c deleted file mode 100644 index 2bef6a278..000000000 --- a/test cases/windows/13 resources with custom targets/prog.c +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#define MY_ICON 1 - -int APIENTRY -WinMain( - HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpszCmdLine, - int nCmdShow) { - HICON hIcon; - hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); - return hIcon ? 0 : 1; -} diff --git a/test cases/windows/13 resources with custom targets/res/gen-res.py b/test cases/windows/13 resources with custom targets/res/gen-res.py deleted file mode 100755 index 2feb02f5b..000000000 --- a/test cases/windows/13 resources with custom targets/res/gen-res.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -with open(sys.argv[1], 'r') as infile, open(sys.argv[2], 'w') as outfile: - outfile.write(infile.read().format(icon=sys.argv[3])) diff --git a/test cases/windows/13 resources with custom targets/res/meson.build b/test cases/windows/13 resources with custom targets/res/meson.build deleted file mode 100644 index 97976370b..000000000 --- a/test cases/windows/13 resources with custom targets/res/meson.build +++ /dev/null @@ -1,19 +0,0 @@ -win = import('windows') - -rc_writer = find_program('./gen-res.py') - -rc_sources = [] - -foreach id : [1, 2] - rc_sources += custom_target('RC source file @0@'.format(id), - input : 'myres.rc.in', - output : 'myres_@0@.rc'.format(id), - command : [rc_writer, '@INPUT@', '@OUTPUT@', files('sample.ico')], - install : false, - build_always : false) -endforeach - -rc_sources += files('myres_static.rc') - -res = win.compile_resources(rc_sources, - include_directories: include_directories('.')) diff --git a/test cases/windows/13 resources with custom targets/res/myres.rc.in b/test cases/windows/13 resources with custom targets/res/myres.rc.in deleted file mode 100644 index 0cff642ba..000000000 --- a/test cases/windows/13 resources with custom targets/res/myres.rc.in +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include - -1 ICON "{icon}" diff --git a/test cases/windows/13 resources with custom targets/res/myres_static.rc b/test cases/windows/13 resources with custom targets/res/myres_static.rc deleted file mode 100644 index 12838aee2..000000000 --- a/test cases/windows/13 resources with custom targets/res/myres_static.rc +++ /dev/null @@ -1,3 +0,0 @@ -#include - -1 ICON "sample.ico" diff --git a/test cases/windows/13 resources with custom targets/res/resource.h b/test cases/windows/13 resources with custom targets/res/resource.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/windows/13 resources with custom targets/res/sample.ico b/test cases/windows/13 resources with custom targets/res/sample.ico deleted file mode 100644 index 24bd3d9e9..000000000 Binary files a/test cases/windows/13 resources with custom targets/res/sample.ico and /dev/null differ diff --git a/test cases/windows/13 test argument extra paths/exe/main.c b/test cases/windows/13 test argument extra paths/exe/main.c new file mode 100644 index 000000000..0ac9e3892 --- /dev/null +++ b/test cases/windows/13 test argument extra paths/exe/main.c @@ -0,0 +1,5 @@ +#include + +int main(int ac, char **av) { + return foo_process(); +} diff --git a/test cases/windows/13 test argument extra paths/exe/meson.build b/test cases/windows/13 test argument extra paths/exe/meson.build new file mode 100644 index 000000000..138500a58 --- /dev/null +++ b/test cases/windows/13 test argument extra paths/exe/meson.build @@ -0,0 +1,3 @@ +barexe = executable('bar', 'main.c', + include_directories: incfoo, + link_with: libfoo) diff --git a/test cases/windows/13 test argument extra paths/lib/foo.c b/test cases/windows/13 test argument extra paths/lib/foo.c new file mode 100644 index 000000000..86b1a03cd --- /dev/null +++ b/test cases/windows/13 test argument extra paths/lib/foo.c @@ -0,0 +1,6 @@ +#include "foo.h" + +int +foo_process(void) { + return 42; +} diff --git a/test cases/windows/13 test argument extra paths/lib/foo.h b/test cases/windows/13 test argument extra paths/lib/foo.h new file mode 100644 index 000000000..5078c583a --- /dev/null +++ b/test cases/windows/13 test argument extra paths/lib/foo.h @@ -0,0 +1,14 @@ +#pragma once + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +DLL_PUBLIC int foo_process(void); diff --git a/test cases/windows/13 test argument extra paths/lib/meson.build b/test cases/windows/13 test argument extra paths/lib/meson.build new file mode 100644 index 000000000..aa0bf145c --- /dev/null +++ b/test cases/windows/13 test argument extra paths/lib/meson.build @@ -0,0 +1,3 @@ +incfoo = include_directories('.') + +libfoo = library('foo', 'foo.c') diff --git a/test cases/windows/13 test argument extra paths/meson.build b/test cases/windows/13 test argument extra paths/meson.build new file mode 100644 index 000000000..f105946e9 --- /dev/null +++ b/test cases/windows/13 test argument extra paths/meson.build @@ -0,0 +1,5 @@ +project('test argument extra paths', 'c') + +subdir('lib') +subdir('exe') +subdir('test') diff --git a/test cases/windows/13 test argument extra paths/test/meson.build b/test cases/windows/13 test argument extra paths/test/meson.build new file mode 100644 index 000000000..2e608be5d --- /dev/null +++ b/test cases/windows/13 test argument extra paths/test/meson.build @@ -0,0 +1,3 @@ +python3 = import('python').find_installation('') + +test('run_exe', python3, args: [files('test_run_exe.py')[0], barexe]) diff --git a/test cases/windows/13 test argument extra paths/test/test_run_exe.py b/test cases/windows/13 test argument extra paths/test/test_run_exe.py new file mode 100644 index 000000000..77c7ddc59 --- /dev/null +++ b/test cases/windows/13 test argument extra paths/test/test_run_exe.py @@ -0,0 +1,12 @@ +import subprocess +import argparse +import sys + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('prog') + args = parser.parse_args() + + res = subprocess.run(args.prog) + + sys.exit(res.returncode - 42) diff --git a/test cases/windows/14 resources with custom target depend_files/ico/gen-ico.py b/test cases/windows/14 resources with custom target depend_files/ico/gen-ico.py new file mode 100755 index 000000000..c49e0dd59 --- /dev/null +++ b/test cases/windows/14 resources with custom target depend_files/ico/gen-ico.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys + +with open(sys.argv[1], 'rb') as infile, open(sys.argv[2], 'wb') as outfile: + outfile.write(infile.read()) diff --git a/test cases/windows/14 resources with custom target depend_files/ico/meson.build b/test cases/windows/14 resources with custom target depend_files/ico/meson.build new file mode 100644 index 000000000..3fae9e86c --- /dev/null +++ b/test cases/windows/14 resources with custom target depend_files/ico/meson.build @@ -0,0 +1,8 @@ +ico_writer = find_program('gen-ico.py') + +ico = custom_target('makeico', + input : 'sample.ico.in', + output : 'sample.ico', + command : [ico_writer, '@INPUT@', '@OUTPUT@'], + install : false, + build_always : false) diff --git a/test cases/windows/14 resources with custom target depend_files/ico/sample.ico.in b/test cases/windows/14 resources with custom target depend_files/ico/sample.ico.in new file mode 100644 index 000000000..24bd3d9e9 Binary files /dev/null and b/test cases/windows/14 resources with custom target depend_files/ico/sample.ico.in differ diff --git a/test cases/windows/14 resources with custom target depend_files/meson.build b/test cases/windows/14 resources with custom target depend_files/meson.build new file mode 100644 index 000000000..85ba06fa2 --- /dev/null +++ b/test cases/windows/14 resources with custom target depend_files/meson.build @@ -0,0 +1,69 @@ +project('winmain', 'c') + +# MinGW windres has a bug due to which it doesn't parse args with space properly: +# https://github.com/mesonbuild/meson/pull/1346 +# https://sourceware.org/bugzilla/show_bug.cgi?id=4933 +if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windows' + # Construct build_to_src and skip this test if it has spaces + # because then the -I flag to windres will also have spaces + # and we know the test will fail + src_parts = meson.source_root().split('/') + build_parts = meson.build_root().split('/') + + # Get the common path (which might just be '/' or 'C:/') + common = [] + done = false + count = 0 + if src_parts.length() > build_parts.length() + parts = build_parts + other = src_parts + else + parts = src_parts + other = build_parts + endif + foreach part : parts + if not done and part == other.get(count) + common += [part] + else + done = true + endif + count += 1 + endforeach + + # Create path components to go down from the build root to the common path + count = 0 + rel = build_parts + foreach build : build_parts + if count < build_parts.length() - common.length() + rel += ['..'] + endif + count += 1 + endforeach + + # Create path components to go up from the common path to the build root + count = 0 + foreach src : src_parts + if count >= common.length() + rel += [src] + endif + count += 1 + endforeach + + build_to_src = '/'.join(rel) + + if build_to_src.contains(' ') + message('build_to_src is: ' + build_to_src) + error('MESON_SKIP_TEST build_to_src has spaces') + endif + # Welcome to the end of this conditional. + # We hope you never have to implement something like this. +endif + +subdir('ico') +subdir('res') + +exe = executable('prog', 'prog.c', + res, + gui_app : true) + +test('winmain', exe) diff --git a/test cases/windows/14 resources with custom target depend_files/prog.c b/test cases/windows/14 resources with custom target depend_files/prog.c new file mode 100644 index 000000000..2bef6a278 --- /dev/null +++ b/test cases/windows/14 resources with custom target depend_files/prog.c @@ -0,0 +1,14 @@ +#include + +#define MY_ICON 1 + +int APIENTRY +WinMain( + HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpszCmdLine, + int nCmdShow) { + HICON hIcon; + hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); + return hIcon ? 0 : 1; +} diff --git a/test cases/windows/14 resources with custom target depend_files/res/meson.build b/test cases/windows/14 resources with custom target depend_files/res/meson.build new file mode 100644 index 000000000..3d43b3f51 --- /dev/null +++ b/test cases/windows/14 resources with custom target depend_files/res/meson.build @@ -0,0 +1,4 @@ +win = import('windows') + +res = win.compile_resources('myres.rc', + depends: ico) diff --git a/test cases/windows/14 resources with custom target depend_files/res/myres.rc b/test cases/windows/14 resources with custom target depend_files/res/myres.rc new file mode 100644 index 000000000..12838aee2 --- /dev/null +++ b/test cases/windows/14 resources with custom target depend_files/res/myres.rc @@ -0,0 +1,3 @@ +#include + +1 ICON "sample.ico" diff --git a/test cases/windows/14 test argument extra paths/exe/main.c b/test cases/windows/14 test argument extra paths/exe/main.c deleted file mode 100644 index 0ac9e3892..000000000 --- a/test cases/windows/14 test argument extra paths/exe/main.c +++ /dev/null @@ -1,5 +0,0 @@ -#include - -int main(int ac, char **av) { - return foo_process(); -} diff --git a/test cases/windows/14 test argument extra paths/exe/meson.build b/test cases/windows/14 test argument extra paths/exe/meson.build deleted file mode 100644 index 138500a58..000000000 --- a/test cases/windows/14 test argument extra paths/exe/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -barexe = executable('bar', 'main.c', - include_directories: incfoo, - link_with: libfoo) diff --git a/test cases/windows/14 test argument extra paths/lib/foo.c b/test cases/windows/14 test argument extra paths/lib/foo.c deleted file mode 100644 index 86b1a03cd..000000000 --- a/test cases/windows/14 test argument extra paths/lib/foo.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "foo.h" - -int -foo_process(void) { - return 42; -} diff --git a/test cases/windows/14 test argument extra paths/lib/foo.h b/test cases/windows/14 test argument extra paths/lib/foo.h deleted file mode 100644 index 5078c583a..000000000 --- a/test cases/windows/14 test argument extra paths/lib/foo.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -DLL_PUBLIC int foo_process(void); diff --git a/test cases/windows/14 test argument extra paths/lib/meson.build b/test cases/windows/14 test argument extra paths/lib/meson.build deleted file mode 100644 index aa0bf145c..000000000 --- a/test cases/windows/14 test argument extra paths/lib/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -incfoo = include_directories('.') - -libfoo = library('foo', 'foo.c') diff --git a/test cases/windows/14 test argument extra paths/meson.build b/test cases/windows/14 test argument extra paths/meson.build deleted file mode 100644 index f105946e9..000000000 --- a/test cases/windows/14 test argument extra paths/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('test argument extra paths', 'c') - -subdir('lib') -subdir('exe') -subdir('test') diff --git a/test cases/windows/14 test argument extra paths/test/meson.build b/test cases/windows/14 test argument extra paths/test/meson.build deleted file mode 100644 index 2e608be5d..000000000 --- a/test cases/windows/14 test argument extra paths/test/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -python3 = import('python').find_installation('') - -test('run_exe', python3, args: [files('test_run_exe.py')[0], barexe]) diff --git a/test cases/windows/14 test argument extra paths/test/test_run_exe.py b/test cases/windows/14 test argument extra paths/test/test_run_exe.py deleted file mode 100644 index 77c7ddc59..000000000 --- a/test cases/windows/14 test argument extra paths/test/test_run_exe.py +++ /dev/null @@ -1,12 +0,0 @@ -import subprocess -import argparse -import sys - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('prog') - args = parser.parse_args() - - res = subprocess.run(args.prog) - - sys.exit(res.returncode - 42) diff --git a/test cases/windows/15 resource scripts with duplicate filenames/a/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/a/meson.build new file mode 100644 index 000000000..73f18c8b6 --- /dev/null +++ b/test cases/windows/15 resource scripts with duplicate filenames/a/meson.build @@ -0,0 +1 @@ +a = win.compile_resources('rsrc.rc') diff --git a/test cases/windows/15 resource scripts with duplicate filenames/a/rsrc.rc b/test cases/windows/15 resource scripts with duplicate filenames/a/rsrc.rc new file mode 100644 index 000000000..1997b8ecb --- /dev/null +++ b/test cases/windows/15 resource scripts with duplicate filenames/a/rsrc.rc @@ -0,0 +1 @@ +a RCDATA { "a" } diff --git a/test cases/windows/15 resource scripts with duplicate filenames/b/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/b/meson.build new file mode 100644 index 000000000..d0b0aabb5 --- /dev/null +++ b/test cases/windows/15 resource scripts with duplicate filenames/b/meson.build @@ -0,0 +1,2 @@ +bf = files('rsrc.rc') +b = win.compile_resources(bf) diff --git a/test cases/windows/15 resource scripts with duplicate filenames/b/rsrc.rc b/test cases/windows/15 resource scripts with duplicate filenames/b/rsrc.rc new file mode 100644 index 000000000..a8e3b27b4 --- /dev/null +++ b/test cases/windows/15 resource scripts with duplicate filenames/b/rsrc.rc @@ -0,0 +1 @@ +b RCDATA { "b" } diff --git a/test cases/windows/15 resource scripts with duplicate filenames/c/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/c/meson.build new file mode 100644 index 000000000..a7b7e309c --- /dev/null +++ b/test cases/windows/15 resource scripts with duplicate filenames/c/meson.build @@ -0,0 +1,2 @@ +cf = files('rsrc.rc') +c = win.compile_resources(cf) diff --git a/test cases/windows/15 resource scripts with duplicate filenames/c/rsrc.rc b/test cases/windows/15 resource scripts with duplicate filenames/c/rsrc.rc new file mode 100644 index 000000000..1fa2c1cfa --- /dev/null +++ b/test cases/windows/15 resource scripts with duplicate filenames/c/rsrc.rc @@ -0,0 +1 @@ +c RCDATA { "c" } diff --git a/test cases/windows/15 resource scripts with duplicate filenames/meson.build b/test cases/windows/15 resource scripts with duplicate filenames/meson.build new file mode 100644 index 000000000..4073a8e7c --- /dev/null +++ b/test cases/windows/15 resource scripts with duplicate filenames/meson.build @@ -0,0 +1,19 @@ +project('foobar', 'c') + +win = import('windows') + +subdir('a') +subdir('b') +subdir('c') + +main = win.compile_resources('rsrc.rc') + +testa = executable('testa', 'verify.c', a) +testb = executable('testb', 'verify.c', b) +testc = executable('testc', 'verify.c', c) +testmain = executable('testmain', 'verify.c', main) + +test('a', testa, args: 'a') +test('b', testb, args: 'b') +test('c', testc, args: 'c') +test('main', testmain, args: 'main') diff --git a/test cases/windows/15 resource scripts with duplicate filenames/rsrc.rc b/test cases/windows/15 resource scripts with duplicate filenames/rsrc.rc new file mode 100644 index 000000000..8f6aa1f5c --- /dev/null +++ b/test cases/windows/15 resource scripts with duplicate filenames/rsrc.rc @@ -0,0 +1 @@ +main RCDATA { "main" } diff --git a/test cases/windows/15 resource scripts with duplicate filenames/verify.c b/test cases/windows/15 resource scripts with duplicate filenames/verify.c new file mode 100644 index 000000000..4d2ccf028 --- /dev/null +++ b/test cases/windows/15 resource scripts with duplicate filenames/verify.c @@ -0,0 +1,23 @@ +#include +#include + +int main(int arc, char *argv[]) +{ + // verify that the expected resource exists and has the expected contents + HRSRC hRsrc; + unsigned int size; + HGLOBAL hGlobal; + void* data; + + hRsrc = FindResource(NULL, argv[1], RT_RCDATA); + assert(hRsrc); + + size = SizeofResource(NULL, hRsrc); + hGlobal = LoadResource(NULL, hRsrc); + data = LockResource(hGlobal); + + assert(size == strlen(argv[1])); + assert(memcmp(data, argv[1], size) == 0); + + return 0; +} diff --git a/test cases/windows/15 resources with custom target depend_files/ico/gen-ico.py b/test cases/windows/15 resources with custom target depend_files/ico/gen-ico.py deleted file mode 100755 index c49e0dd59..000000000 --- a/test cases/windows/15 resources with custom target depend_files/ico/gen-ico.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -with open(sys.argv[1], 'rb') as infile, open(sys.argv[2], 'wb') as outfile: - outfile.write(infile.read()) diff --git a/test cases/windows/15 resources with custom target depend_files/ico/meson.build b/test cases/windows/15 resources with custom target depend_files/ico/meson.build deleted file mode 100644 index 3fae9e86c..000000000 --- a/test cases/windows/15 resources with custom target depend_files/ico/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -ico_writer = find_program('gen-ico.py') - -ico = custom_target('makeico', - input : 'sample.ico.in', - output : 'sample.ico', - command : [ico_writer, '@INPUT@', '@OUTPUT@'], - install : false, - build_always : false) diff --git a/test cases/windows/15 resources with custom target depend_files/ico/sample.ico.in b/test cases/windows/15 resources with custom target depend_files/ico/sample.ico.in deleted file mode 100644 index 24bd3d9e9..000000000 Binary files a/test cases/windows/15 resources with custom target depend_files/ico/sample.ico.in and /dev/null differ diff --git a/test cases/windows/15 resources with custom target depend_files/meson.build b/test cases/windows/15 resources with custom target depend_files/meson.build deleted file mode 100644 index 85ba06fa2..000000000 --- a/test cases/windows/15 resources with custom target depend_files/meson.build +++ /dev/null @@ -1,69 +0,0 @@ -project('winmain', 'c') - -# MinGW windres has a bug due to which it doesn't parse args with space properly: -# https://github.com/mesonbuild/meson/pull/1346 -# https://sourceware.org/bugzilla/show_bug.cgi?id=4933 -if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windows' - # Construct build_to_src and skip this test if it has spaces - # because then the -I flag to windres will also have spaces - # and we know the test will fail - src_parts = meson.source_root().split('/') - build_parts = meson.build_root().split('/') - - # Get the common path (which might just be '/' or 'C:/') - common = [] - done = false - count = 0 - if src_parts.length() > build_parts.length() - parts = build_parts - other = src_parts - else - parts = src_parts - other = build_parts - endif - foreach part : parts - if not done and part == other.get(count) - common += [part] - else - done = true - endif - count += 1 - endforeach - - # Create path components to go down from the build root to the common path - count = 0 - rel = build_parts - foreach build : build_parts - if count < build_parts.length() - common.length() - rel += ['..'] - endif - count += 1 - endforeach - - # Create path components to go up from the common path to the build root - count = 0 - foreach src : src_parts - if count >= common.length() - rel += [src] - endif - count += 1 - endforeach - - build_to_src = '/'.join(rel) - - if build_to_src.contains(' ') - message('build_to_src is: ' + build_to_src) - error('MESON_SKIP_TEST build_to_src has spaces') - endif - # Welcome to the end of this conditional. - # We hope you never have to implement something like this. -endif - -subdir('ico') -subdir('res') - -exe = executable('prog', 'prog.c', - res, - gui_app : true) - -test('winmain', exe) diff --git a/test cases/windows/15 resources with custom target depend_files/prog.c b/test cases/windows/15 resources with custom target depend_files/prog.c deleted file mode 100644 index 2bef6a278..000000000 --- a/test cases/windows/15 resources with custom target depend_files/prog.c +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#define MY_ICON 1 - -int APIENTRY -WinMain( - HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpszCmdLine, - int nCmdShow) { - HICON hIcon; - hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); - return hIcon ? 0 : 1; -} diff --git a/test cases/windows/15 resources with custom target depend_files/res/meson.build b/test cases/windows/15 resources with custom target depend_files/res/meson.build deleted file mode 100644 index 3d43b3f51..000000000 --- a/test cases/windows/15 resources with custom target depend_files/res/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -win = import('windows') - -res = win.compile_resources('myres.rc', - depends: ico) diff --git a/test cases/windows/15 resources with custom target depend_files/res/myres.rc b/test cases/windows/15 resources with custom target depend_files/res/myres.rc deleted file mode 100644 index 12838aee2..000000000 --- a/test cases/windows/15 resources with custom target depend_files/res/myres.rc +++ /dev/null @@ -1,3 +0,0 @@ -#include - -1 ICON "sample.ico" diff --git a/test cases/windows/16 resource scripts with duplicate filenames/a/meson.build b/test cases/windows/16 resource scripts with duplicate filenames/a/meson.build deleted file mode 100644 index 73f18c8b6..000000000 --- a/test cases/windows/16 resource scripts with duplicate filenames/a/meson.build +++ /dev/null @@ -1 +0,0 @@ -a = win.compile_resources('rsrc.rc') diff --git a/test cases/windows/16 resource scripts with duplicate filenames/a/rsrc.rc b/test cases/windows/16 resource scripts with duplicate filenames/a/rsrc.rc deleted file mode 100644 index 1997b8ecb..000000000 --- a/test cases/windows/16 resource scripts with duplicate filenames/a/rsrc.rc +++ /dev/null @@ -1 +0,0 @@ -a RCDATA { "a" } diff --git a/test cases/windows/16 resource scripts with duplicate filenames/b/meson.build b/test cases/windows/16 resource scripts with duplicate filenames/b/meson.build deleted file mode 100644 index d0b0aabb5..000000000 --- a/test cases/windows/16 resource scripts with duplicate filenames/b/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -bf = files('rsrc.rc') -b = win.compile_resources(bf) diff --git a/test cases/windows/16 resource scripts with duplicate filenames/b/rsrc.rc b/test cases/windows/16 resource scripts with duplicate filenames/b/rsrc.rc deleted file mode 100644 index a8e3b27b4..000000000 --- a/test cases/windows/16 resource scripts with duplicate filenames/b/rsrc.rc +++ /dev/null @@ -1 +0,0 @@ -b RCDATA { "b" } diff --git a/test cases/windows/16 resource scripts with duplicate filenames/c/meson.build b/test cases/windows/16 resource scripts with duplicate filenames/c/meson.build deleted file mode 100644 index a7b7e309c..000000000 --- a/test cases/windows/16 resource scripts with duplicate filenames/c/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -cf = files('rsrc.rc') -c = win.compile_resources(cf) diff --git a/test cases/windows/16 resource scripts with duplicate filenames/c/rsrc.rc b/test cases/windows/16 resource scripts with duplicate filenames/c/rsrc.rc deleted file mode 100644 index 1fa2c1cfa..000000000 --- a/test cases/windows/16 resource scripts with duplicate filenames/c/rsrc.rc +++ /dev/null @@ -1 +0,0 @@ -c RCDATA { "c" } diff --git a/test cases/windows/16 resource scripts with duplicate filenames/meson.build b/test cases/windows/16 resource scripts with duplicate filenames/meson.build deleted file mode 100644 index 4073a8e7c..000000000 --- a/test cases/windows/16 resource scripts with duplicate filenames/meson.build +++ /dev/null @@ -1,19 +0,0 @@ -project('foobar', 'c') - -win = import('windows') - -subdir('a') -subdir('b') -subdir('c') - -main = win.compile_resources('rsrc.rc') - -testa = executable('testa', 'verify.c', a) -testb = executable('testb', 'verify.c', b) -testc = executable('testc', 'verify.c', c) -testmain = executable('testmain', 'verify.c', main) - -test('a', testa, args: 'a') -test('b', testb, args: 'b') -test('c', testc, args: 'c') -test('main', testmain, args: 'main') diff --git a/test cases/windows/16 resource scripts with duplicate filenames/rsrc.rc b/test cases/windows/16 resource scripts with duplicate filenames/rsrc.rc deleted file mode 100644 index 8f6aa1f5c..000000000 --- a/test cases/windows/16 resource scripts with duplicate filenames/rsrc.rc +++ /dev/null @@ -1 +0,0 @@ -main RCDATA { "main" } diff --git a/test cases/windows/16 resource scripts with duplicate filenames/verify.c b/test cases/windows/16 resource scripts with duplicate filenames/verify.c deleted file mode 100644 index 4d2ccf028..000000000 --- a/test cases/windows/16 resource scripts with duplicate filenames/verify.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include - -int main(int arc, char *argv[]) -{ - // verify that the expected resource exists and has the expected contents - HRSRC hRsrc; - unsigned int size; - HGLOBAL hGlobal; - void* data; - - hRsrc = FindResource(NULL, argv[1], RT_RCDATA); - assert(hRsrc); - - size = SizeofResource(NULL, hRsrc); - hGlobal = LoadResource(NULL, hRsrc); - data = LockResource(hGlobal); - - assert(size == strlen(argv[1])); - assert(memcmp(data, argv[1], size) == 0); - - return 0; -} diff --git a/test cases/windows/7 dll versioning/copyfile.py b/test cases/windows/7 dll versioning/copyfile.py new file mode 100644 index 000000000..ff42ac359 --- /dev/null +++ b/test cases/windows/7 dll versioning/copyfile.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +shutil.copyfile(sys.argv[1], sys.argv[2]) diff --git a/test cases/windows/7 dll versioning/exe.orig.c b/test cases/windows/7 dll versioning/exe.orig.c new file mode 100644 index 000000000..86c4adc38 --- /dev/null +++ b/test cases/windows/7 dll versioning/exe.orig.c @@ -0,0 +1,9 @@ +int myFunc (void); + +int +main (int argc, char *argv[]) +{ + if (myFunc() == 55) + return 0; + return 1; +} diff --git a/test cases/windows/7 dll versioning/installed_files.txt b/test cases/windows/7 dll versioning/installed_files.txt new file mode 100644 index 000000000..20482bff5 --- /dev/null +++ b/test cases/windows/7 dll versioning/installed_files.txt @@ -0,0 +1,26 @@ +?msvc:usr/bin/some-0.dll +?msvc:usr/bin/some-0.pdb +?msvc:usr/lib/some.lib +?msvc:usr/bin/noversion.dll +?msvc:usr/bin/noversion.pdb +?msvc:usr/lib/noversion.lib +?msvc:usr/bin/onlyversion-1.dll +?msvc:usr/lib/onlyversion.lib +?msvc:usr/bin/onlysoversion-5.dll +?msvc:usr/lib/onlysoversion.lib +?msvc:usr/libexec/customdir.dll +?msvc:usr/libexec/customdir.lib +?msvc:usr/lib/module.dll +?msvc:usr/lib/module.lib +?gcc:usr/bin/?libsome-0.dll +?gcc:usr/lib/libsome.dll.a +?gcc:usr/bin/?libnoversion.dll +?gcc:usr/lib/libnoversion.dll.a +?gcc:usr/bin/?libonlyversion-1.dll +?gcc:usr/lib/libonlyversion.dll.a +?gcc:usr/bin/?libonlysoversion-5.dll +?gcc:usr/lib/libonlysoversion.dll.a +?gcc:usr/libexec/?libcustomdir.dll +?gcc:usr/libexec/libcustomdir.dll.a +?gcc:usr/lib/?libmodule.dll +?gcc:usr/lib/libmodule.dll.a diff --git a/test cases/windows/7 dll versioning/lib.c b/test cases/windows/7 dll versioning/lib.c new file mode 100644 index 000000000..cf7dfdd07 --- /dev/null +++ b/test cases/windows/7 dll versioning/lib.c @@ -0,0 +1,6 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int myFunc() { + return 55; +} diff --git a/test cases/windows/7 dll versioning/meson.build b/test cases/windows/7 dll versioning/meson.build new file mode 100644 index 000000000..80acf880a --- /dev/null +++ b/test cases/windows/7 dll versioning/meson.build @@ -0,0 +1,52 @@ +project('msvc dll versioning', 'c') + +cc = meson.get_compiler('c') + +# Test that we create correctly-named dll and import lib files, +# and also install them in the right place +some = shared_library('some', 'lib.c', + version : '1.2.3', + soversion : '0', + install : true) + +noversion = shared_library('noversion', 'lib.c', + install : true) + +onlyversion = shared_library('onlyversion', 'lib.c', + version : '1.4.5', + install : true) + +onlysoversion = shared_library('onlysoversion', 'lib.c', + # Also test that int soversion is acceptable + soversion : 5, + install : true) + +# Hack to make the executables below depend on the shared libraries above +# without actually adding them as `link_with` dependencies since we want to try +# linking to them with -lfoo linker arguments. +cp = find_program('copyfile.py') +out = custom_target('library-dependency-hack', + input : 'exe.orig.c', + output : 'exe.c', + depends : [some, noversion, onlyversion, onlysoversion], + command : [cp, '@INPUT@', '@OUTPUT@']) + +# Manually test if the linker can find the above libraries +# i.e., whether they were generated with the right naming scheme +test('manually linked 1', executable('manuallink1', out, + link_args : ['-L.', '-lsome'])) + +test('manually linked 2', executable('manuallink2', out, + link_args : ['-L.', '-lnoversion'])) + +test('manually linked 3', executable('manuallink3', out, + link_args : ['-L.', '-lonlyversion'])) + +test('manually linked 4', executable('manuallink4', out, + link_args : ['-L.', '-lonlysoversion'])) + +shared_library('customdir', 'lib.c', + install : true, + install_dir : get_option('libexecdir')) + +shared_module('module', 'lib.c', install : true) diff --git a/test cases/windows/8 dll versioning/copyfile.py b/test cases/windows/8 dll versioning/copyfile.py deleted file mode 100644 index ff42ac359..000000000 --- a/test cases/windows/8 dll versioning/copyfile.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -shutil.copyfile(sys.argv[1], sys.argv[2]) diff --git a/test cases/windows/8 dll versioning/exe.orig.c b/test cases/windows/8 dll versioning/exe.orig.c deleted file mode 100644 index 86c4adc38..000000000 --- a/test cases/windows/8 dll versioning/exe.orig.c +++ /dev/null @@ -1,9 +0,0 @@ -int myFunc (void); - -int -main (int argc, char *argv[]) -{ - if (myFunc() == 55) - return 0; - return 1; -} diff --git a/test cases/windows/8 dll versioning/installed_files.txt b/test cases/windows/8 dll versioning/installed_files.txt deleted file mode 100644 index 20482bff5..000000000 --- a/test cases/windows/8 dll versioning/installed_files.txt +++ /dev/null @@ -1,26 +0,0 @@ -?msvc:usr/bin/some-0.dll -?msvc:usr/bin/some-0.pdb -?msvc:usr/lib/some.lib -?msvc:usr/bin/noversion.dll -?msvc:usr/bin/noversion.pdb -?msvc:usr/lib/noversion.lib -?msvc:usr/bin/onlyversion-1.dll -?msvc:usr/lib/onlyversion.lib -?msvc:usr/bin/onlysoversion-5.dll -?msvc:usr/lib/onlysoversion.lib -?msvc:usr/libexec/customdir.dll -?msvc:usr/libexec/customdir.lib -?msvc:usr/lib/module.dll -?msvc:usr/lib/module.lib -?gcc:usr/bin/?libsome-0.dll -?gcc:usr/lib/libsome.dll.a -?gcc:usr/bin/?libnoversion.dll -?gcc:usr/lib/libnoversion.dll.a -?gcc:usr/bin/?libonlyversion-1.dll -?gcc:usr/lib/libonlyversion.dll.a -?gcc:usr/bin/?libonlysoversion-5.dll -?gcc:usr/lib/libonlysoversion.dll.a -?gcc:usr/libexec/?libcustomdir.dll -?gcc:usr/libexec/libcustomdir.dll.a -?gcc:usr/lib/?libmodule.dll -?gcc:usr/lib/libmodule.dll.a diff --git a/test cases/windows/8 dll versioning/lib.c b/test cases/windows/8 dll versioning/lib.c deleted file mode 100644 index cf7dfdd07..000000000 --- a/test cases/windows/8 dll versioning/lib.c +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif -int myFunc() { - return 55; -} diff --git a/test cases/windows/8 dll versioning/meson.build b/test cases/windows/8 dll versioning/meson.build deleted file mode 100644 index 80acf880a..000000000 --- a/test cases/windows/8 dll versioning/meson.build +++ /dev/null @@ -1,52 +0,0 @@ -project('msvc dll versioning', 'c') - -cc = meson.get_compiler('c') - -# Test that we create correctly-named dll and import lib files, -# and also install them in the right place -some = shared_library('some', 'lib.c', - version : '1.2.3', - soversion : '0', - install : true) - -noversion = shared_library('noversion', 'lib.c', - install : true) - -onlyversion = shared_library('onlyversion', 'lib.c', - version : '1.4.5', - install : true) - -onlysoversion = shared_library('onlysoversion', 'lib.c', - # Also test that int soversion is acceptable - soversion : 5, - install : true) - -# Hack to make the executables below depend on the shared libraries above -# without actually adding them as `link_with` dependencies since we want to try -# linking to them with -lfoo linker arguments. -cp = find_program('copyfile.py') -out = custom_target('library-dependency-hack', - input : 'exe.orig.c', - output : 'exe.c', - depends : [some, noversion, onlyversion, onlysoversion], - command : [cp, '@INPUT@', '@OUTPUT@']) - -# Manually test if the linker can find the above libraries -# i.e., whether they were generated with the right naming scheme -test('manually linked 1', executable('manuallink1', out, - link_args : ['-L.', '-lsome'])) - -test('manually linked 2', executable('manuallink2', out, - link_args : ['-L.', '-lnoversion'])) - -test('manually linked 3', executable('manuallink3', out, - link_args : ['-L.', '-lonlyversion'])) - -test('manually linked 4', executable('manuallink4', out, - link_args : ['-L.', '-lonlysoversion'])) - -shared_library('customdir', 'lib.c', - install : true, - install_dir : get_option('libexecdir')) - -shared_module('module', 'lib.c', install : true) diff --git a/test cases/windows/8 find program/meson.build b/test cases/windows/8 find program/meson.build new file mode 100644 index 000000000..565fb626d --- /dev/null +++ b/test cases/windows/8 find program/meson.build @@ -0,0 +1,12 @@ +project('find program', 'c') + +# Test that we can find native windows executables +find_program('cmd') +find_program('cmd.exe') + +# Test that a script file with an extension can be found +ext = find_program('test-script-ext.py') +test('ext', ext) +# Test that a script file without an extension can be found +prog = find_program('test-script') +test('script', prog) diff --git a/test cases/windows/8 find program/test-script b/test cases/windows/8 find program/test-script new file mode 100644 index 000000000..d105a818d --- /dev/null +++ b/test cases/windows/8 find program/test-script @@ -0,0 +1,3 @@ +#!/usr/bin/env python + +print('1') diff --git a/test cases/windows/8 find program/test-script-ext.py b/test cases/windows/8 find program/test-script-ext.py new file mode 100644 index 000000000..ae9adfb8e --- /dev/null +++ b/test cases/windows/8 find program/test-script-ext.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 + +print('ext/noext') diff --git a/test cases/windows/9 find program/meson.build b/test cases/windows/9 find program/meson.build deleted file mode 100644 index 565fb626d..000000000 --- a/test cases/windows/9 find program/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -project('find program', 'c') - -# Test that we can find native windows executables -find_program('cmd') -find_program('cmd.exe') - -# Test that a script file with an extension can be found -ext = find_program('test-script-ext.py') -test('ext', ext) -# Test that a script file without an extension can be found -prog = find_program('test-script') -test('script', prog) diff --git a/test cases/windows/9 find program/test-script b/test cases/windows/9 find program/test-script deleted file mode 100644 index d105a818d..000000000 --- a/test cases/windows/9 find program/test-script +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python - -print('1') diff --git a/test cases/windows/9 find program/test-script-ext.py b/test cases/windows/9 find program/test-script-ext.py deleted file mode 100644 index ae9adfb8e..000000000 --- a/test cases/windows/9 find program/test-script-ext.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python3 - -print('ext/noext') diff --git a/test cases/windows/9 vs module defs generated/meson.build b/test cases/windows/9 vs module defs generated/meson.build new file mode 100644 index 000000000..7728ca77a --- /dev/null +++ b/test cases/windows/9 vs module defs generated/meson.build @@ -0,0 +1,5 @@ +project('generated_dll_module_defs', 'c') + +subdir('subdir') +exe = executable('prog', 'prog.c', link_with : shlib) +test('runtest', exe) diff --git a/test cases/windows/9 vs module defs generated/prog.c b/test cases/windows/9 vs module defs generated/prog.c new file mode 100644 index 000000000..f35f4a02d --- /dev/null +++ b/test cases/windows/9 vs module defs generated/prog.c @@ -0,0 +1,5 @@ +int somedllfunc(); + +int main(int argc, char **argv) { + return somedllfunc() == 42 ? 0 : 1; +} diff --git a/test cases/windows/9 vs module defs generated/subdir/meson.build b/test cases/windows/9 vs module defs generated/subdir/meson.build new file mode 100644 index 000000000..5d390a0b5 --- /dev/null +++ b/test cases/windows/9 vs module defs generated/subdir/meson.build @@ -0,0 +1,9 @@ +conf = configuration_data() +conf.set('func', 'somedllfunc') +def_file = configure_file( + input: 'somedll.def.in', + output: 'somedll.def', + configuration : conf, +) + +shlib = shared_library('somedll', 'somedll.c', vs_module_defs : def_file) diff --git a/test cases/windows/9 vs module defs generated/subdir/somedll.c b/test cases/windows/9 vs module defs generated/subdir/somedll.c new file mode 100644 index 000000000..b23d8fed5 --- /dev/null +++ b/test cases/windows/9 vs module defs generated/subdir/somedll.c @@ -0,0 +1,3 @@ +int somedllfunc() { + return 42; +} diff --git a/test cases/windows/9 vs module defs generated/subdir/somedll.def.in b/test cases/windows/9 vs module defs generated/subdir/somedll.def.in new file mode 100644 index 000000000..c29207c71 --- /dev/null +++ b/test cases/windows/9 vs module defs generated/subdir/somedll.def.in @@ -0,0 +1,2 @@ +EXPORTS + @func@ -- cgit v1.2.3