From e75e3976facda7de244fbb9a02eebf0d043ea1c8 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 26 Apr 2021 16:52:13 +0300 Subject: Condense test directory names. --- test cases/unit/63 cmake_prefix_path/meson.build | 4 ++ .../lib/cmake/mesontest/mesontest-config.cmake | 4 ++ test cases/unit/64 cmake parser/meson.build | 19 +++++ .../lib/cmake/mesontest/mesontest-config.cmake | 63 ++++++++++++++++ test cases/unit/64 cmake_prefix_path/meson.build | 4 -- .../lib/cmake/mesontest/mesontest-config.cmake | 4 -- test cases/unit/65 alias target/main.c | 3 + test cases/unit/65 alias target/meson.build | 15 ++++ test cases/unit/65 cmake parser/meson.build | 19 ----- .../lib/cmake/mesontest/mesontest-config.cmake | 63 ---------------- test cases/unit/66 alias target/main.c | 3 - test cases/unit/66 alias target/meson.build | 15 ---- .../unit/66 static archive stripping/app/appA.c | 4 ++ .../unit/66 static archive stripping/app/appB.c | 4 ++ .../66 static archive stripping/app/meson.build | 7 ++ .../unit/66 static archive stripping/lib/libA.c | 5 ++ .../unit/66 static archive stripping/lib/libA.h | 1 + .../unit/66 static archive stripping/lib/libB.c | 5 ++ .../unit/66 static archive stripping/lib/libB.h | 1 + .../66 static archive stripping/lib/meson.build | 23 ++++++ .../unit/67 static archive stripping/app/appA.c | 4 -- .../unit/67 static archive stripping/app/appB.c | 4 -- .../67 static archive stripping/app/meson.build | 7 -- .../unit/67 static archive stripping/lib/libA.c | 5 -- .../unit/67 static archive stripping/lib/libA.h | 1 - .../unit/67 static archive stripping/lib/libB.c | 5 -- .../unit/67 static archive stripping/lib/libB.h | 1 - .../67 static archive stripping/lib/meson.build | 23 ------ test cases/unit/67 static link/lib/func1.c | 9 +++ test cases/unit/67 static link/lib/func10.c | 4 ++ test cases/unit/67 static link/lib/func11.c | 6 ++ test cases/unit/67 static link/lib/func12.c | 7 ++ test cases/unit/67 static link/lib/func14.c | 4 ++ test cases/unit/67 static link/lib/func15.c | 6 ++ test cases/unit/67 static link/lib/func16.c | 6 ++ test cases/unit/67 static link/lib/func17.c | 4 ++ test cases/unit/67 static link/lib/func18.c | 6 ++ test cases/unit/67 static link/lib/func19.c | 7 ++ test cases/unit/67 static link/lib/func2.c | 6 ++ test cases/unit/67 static link/lib/func3.c | 4 ++ test cases/unit/67 static link/lib/func4.c | 6 ++ test cases/unit/67 static link/lib/func5.c | 4 ++ test cases/unit/67 static link/lib/func6.c | 6 ++ test cases/unit/67 static link/lib/func7.c | 4 ++ test cases/unit/67 static link/lib/func8.c | 6 ++ test cases/unit/67 static link/lib/func9.c | 6 ++ test cases/unit/67 static link/lib/meson.build | 80 +++++++++++++++++++++ test cases/unit/67 static link/meson.build | 32 +++++++++ test cases/unit/67 static link/test1.c | 7 ++ test cases/unit/67 static link/test2.c | 6 ++ test cases/unit/67 static link/test3.c | 6 ++ test cases/unit/67 static link/test4.c | 6 ++ test cases/unit/67 static link/test5.c | 6 ++ test cases/unit/68 static link/lib/func1.c | 9 --- test cases/unit/68 static link/lib/func10.c | 4 -- test cases/unit/68 static link/lib/func11.c | 6 -- test cases/unit/68 static link/lib/func12.c | 7 -- test cases/unit/68 static link/lib/func14.c | 4 -- test cases/unit/68 static link/lib/func15.c | 6 -- test cases/unit/68 static link/lib/func16.c | 6 -- test cases/unit/68 static link/lib/func17.c | 4 -- test cases/unit/68 static link/lib/func18.c | 6 -- test cases/unit/68 static link/lib/func19.c | 7 -- test cases/unit/68 static link/lib/func2.c | 6 -- test cases/unit/68 static link/lib/func3.c | 4 -- test cases/unit/68 static link/lib/func4.c | 6 -- test cases/unit/68 static link/lib/func5.c | 4 -- test cases/unit/68 static link/lib/func6.c | 6 -- test cases/unit/68 static link/lib/func7.c | 4 -- test cases/unit/68 static link/lib/func8.c | 6 -- test cases/unit/68 static link/lib/func9.c | 6 -- test cases/unit/68 static link/lib/meson.build | 80 --------------------- test cases/unit/68 static link/meson.build | 32 --------- test cases/unit/68 static link/test1.c | 7 -- test cases/unit/68 static link/test2.c | 6 -- test cases/unit/68 static link/test3.c | 6 -- test cases/unit/68 static link/test4.c | 6 -- test cases/unit/68 static link/test5.c | 6 -- test cases/unit/68 test env value/meson.build | 10 +++ test cases/unit/68 test env value/test.py | 6 ++ test cases/unit/69 clang-tidy/.clang-tidy | 1 + test cases/unit/69 clang-tidy/cttest.cpp | 7 ++ test cases/unit/69 clang-tidy/dummydir.h/dummy.dat | 1 + test cases/unit/69 clang-tidy/meson.build | 3 + test cases/unit/69 test env value/meson.build | 10 --- test cases/unit/69 test env value/test.py | 6 -- test cases/unit/70 clang-tidy/.clang-tidy | 1 - test cases/unit/70 clang-tidy/cttest.cpp | 7 -- test cases/unit/70 clang-tidy/dummydir.h/dummy.dat | 1 - test cases/unit/70 clang-tidy/meson.build | 3 - test cases/unit/70 cross/crossfile.in | 5 ++ test cases/unit/70 cross/meson.build | 16 +++++ test cases/unit/70 cross/meson_options.txt | 1 + test cases/unit/71 cross test passed/exewrapper.py | 24 +++++++ test cases/unit/71 cross test passed/meson.build | 19 +++++ .../unit/71 cross test passed/meson_options.txt | 5 ++ test cases/unit/71 cross test passed/script.py | 7 ++ test cases/unit/71 cross test passed/src/main.c | 6 ++ test cases/unit/71 cross/crossfile.in | 5 -- test cases/unit/71 cross/meson.build | 16 ----- test cases/unit/71 cross/meson_options.txt | 1 - test cases/unit/72 cross test passed/exewrapper.py | 24 ------- test cases/unit/72 cross test passed/meson.build | 19 ----- .../unit/72 cross test passed/meson_options.txt | 5 -- test cases/unit/72 cross test passed/script.py | 7 -- test cases/unit/72 cross test passed/src/main.c | 6 -- test cases/unit/72 summary/meson.build | 22 ++++++ test cases/unit/72 summary/meson_options.txt | 1 + .../unit/72 summary/subprojects/sub/meson.build | 4 ++ .../unit/72 summary/subprojects/sub2/meson.build | 5 ++ test cases/unit/73 summary/meson.build | 22 ------ test cases/unit/73 summary/meson_options.txt | 1 - .../unit/73 summary/subprojects/sub/meson.build | 4 -- .../unit/73 summary/subprojects/sub2/meson.build | 5 -- test cases/unit/73 wrap file url/meson.build | 4 ++ .../73 wrap file url/subprojects/foo-patch.tar.xz | Bin 0 -> 228 bytes .../unit/73 wrap file url/subprojects/foo.tar.xz | Bin 0 -> 216 bytes test cases/unit/74 dep files/foo.c | 0 test cases/unit/74 dep files/meson.build | 16 +++++ test cases/unit/74 wrap file url/meson.build | 4 -- .../74 wrap file url/subprojects/foo-patch.tar.xz | Bin 228 -> 0 bytes .../unit/74 wrap file url/subprojects/foo.tar.xz | Bin 216 -> 0 bytes test cases/unit/75 dep files/foo.c | 0 test cases/unit/75 dep files/meson.build | 16 ----- .../unit/75 pkgconfig prefixes/client/client.c | 8 +++ .../unit/75 pkgconfig prefixes/client/meson.build | 3 + .../unit/75 pkgconfig prefixes/val1/meson.build | 5 ++ test cases/unit/75 pkgconfig prefixes/val1/val1.c | 3 + test cases/unit/75 pkgconfig prefixes/val1/val1.h | 1 + .../unit/75 pkgconfig prefixes/val2/meson.build | 8 +++ test cases/unit/75 pkgconfig prefixes/val2/val2.c | 4 ++ test cases/unit/75 pkgconfig prefixes/val2/val2.h | 1 + .../unit/76 pkgconfig prefixes/client/client.c | 8 --- .../unit/76 pkgconfig prefixes/client/meson.build | 3 - .../unit/76 pkgconfig prefixes/val1/meson.build | 5 -- test cases/unit/76 pkgconfig prefixes/val1/val1.c | 3 - test cases/unit/76 pkgconfig prefixes/val1/val1.h | 1 - .../unit/76 pkgconfig prefixes/val2/meson.build | 8 --- test cases/unit/76 pkgconfig prefixes/val2/val2.c | 4 -- test cases/unit/76 pkgconfig prefixes/val2/val2.h | 1 - test cases/unit/76 subdir libdir/meson.build | 2 + .../76 subdir libdir/subprojects/flub/meson.build | 1 + test cases/unit/77 as link whole/bar.c | 6 ++ test cases/unit/77 as link whole/foo.c | 6 ++ test cases/unit/77 as link whole/meson.build | 11 +++ test cases/unit/77 subdir libdir/meson.build | 2 - .../77 subdir libdir/subprojects/flub/meson.build | 1 - test cases/unit/78 as link whole/bar.c | 6 -- test cases/unit/78 as link whole/foo.c | 6 -- test cases/unit/78 as link whole/meson.build | 11 --- test cases/unit/78 nostdlib/meson.build | 14 ++++ test cases/unit/78 nostdlib/prog.c | 7 ++ .../unit/78 nostdlib/subprojects/mylibc/libc.c | 35 +++++++++ .../78 nostdlib/subprojects/mylibc/meson.build | 13 ++++ .../unit/78 nostdlib/subprojects/mylibc/stdio.h | 5 ++ .../78 nostdlib/subprojects/mylibc/stubstart.s | 8 +++ test cases/unit/79 nostdlib/meson.build | 14 ---- test cases/unit/79 nostdlib/prog.c | 7 -- .../unit/79 nostdlib/subprojects/mylibc/libc.c | 35 --------- .../79 nostdlib/subprojects/mylibc/meson.build | 13 ---- .../unit/79 nostdlib/subprojects/mylibc/stdio.h | 5 -- .../79 nostdlib/subprojects/mylibc/stubstart.s | 8 --- .../unit/79 user options for subproject/.gitignore | 1 + .../75 user options for subproject/.gitignore | 1 + .../75 user options for subproject/meson.build | 3 + test cases/unit/80 global-rpath/meson.build | 3 + test cases/unit/80 global-rpath/rpathified.cpp | 6 ++ test cases/unit/80 global-rpath/yonder/meson.build | 5 ++ test cases/unit/80 global-rpath/yonder/yonder.cpp | 3 + test cases/unit/80 global-rpath/yonder/yonder.h | 1 + .../unit/80 user options for subproject/.gitignore | 1 - .../75 user options for subproject/.gitignore | 1 - .../75 user options for subproject/meson.build | 3 - test cases/unit/81 global-rpath/meson.build | 3 - test cases/unit/81 global-rpath/rpathified.cpp | 6 -- test cases/unit/81 global-rpath/yonder/meson.build | 5 -- test cases/unit/81 global-rpath/yonder/yonder.cpp | 3 - test cases/unit/81 global-rpath/yonder/yonder.h | 1 - test cases/unit/81 wrap-git/meson.build | 4 ++ .../packagefiles/wrap_git_builddef/meson.build | 3 + .../subprojects/wrap_git_upstream/main.c | 4 ++ .../unit/82 meson version compare/meson.build | 17 +++++ test cases/unit/82 wrap-git/meson.build | 4 -- .../packagefiles/wrap_git_builddef/meson.build | 3 - .../subprojects/wrap_git_upstream/main.c | 4 -- .../unit/83 cross only introspect/meson.build | 2 + .../unit/83 meson version compare/meson.build | 17 ----- .../unit/84 change option choices/meson.build | 1 + .../84 change option choices/meson_options.1.txt | 13 ++++ .../84 change option choices/meson_options.2.txt | 13 ++++ .../unit/84 cross only introspect/meson.build | 2 - .../unit/85 change option choices/meson.build | 1 - .../85 change option choices/meson_options.1.txt | 13 ---- .../85 change option choices/meson_options.2.txt | 13 ---- .../85 nested subproject regenerate depends/main.c | 3 + .../meson.build | 6 ++ .../subprojects/sub1/meson.build | 4 ++ .../subprojects/sub2/CMakeLists.txt | 1 + test cases/unit/86 cpp modules/main.cpp | 7 ++ test cases/unit/86 cpp modules/meson.build | 17 +++++ test cases/unit/86 cpp modules/src0.ixx | 7 ++ test cases/unit/86 cpp modules/src1.ixx | 7 ++ test cases/unit/86 cpp modules/src2.ixx | 7 ++ test cases/unit/86 cpp modules/src3.ixx | 7 ++ test cases/unit/86 cpp modules/src4.ixx | 7 ++ test cases/unit/86 cpp modules/src5.ixx | 7 ++ test cases/unit/86 cpp modules/src6.ixx | 7 ++ test cases/unit/86 cpp modules/src7.ixx | 7 ++ test cases/unit/86 cpp modules/src8.ixx | 7 ++ test cases/unit/86 cpp modules/src9.ixx | 5 ++ .../86 nested subproject regenerate depends/main.c | 3 - .../meson.build | 6 -- .../subprojects/sub1/meson.build | 4 -- .../subprojects/sub2/CMakeLists.txt | 1 - test cases/unit/87 cpp modules/main.cpp | 7 -- test cases/unit/87 cpp modules/meson.build | 17 ----- test cases/unit/87 cpp modules/src0.ixx | 7 -- test cases/unit/87 cpp modules/src1.ixx | 7 -- test cases/unit/87 cpp modules/src2.ixx | 7 -- test cases/unit/87 cpp modules/src3.ixx | 7 -- test cases/unit/87 cpp modules/src4.ixx | 7 -- test cases/unit/87 cpp modules/src5.ixx | 7 -- test cases/unit/87 cpp modules/src6.ixx | 7 -- test cases/unit/87 cpp modules/src7.ixx | 7 -- test cases/unit/87 cpp modules/src8.ixx | 7 -- test cases/unit/87 cpp modules/src9.ixx | 5 -- test cases/unit/87 prelinking/file1.c | 14 ++++ test cases/unit/87 prelinking/file2.c | 9 +++ test cases/unit/87 prelinking/file3.c | 9 +++ test cases/unit/87 prelinking/file4.c | 9 +++ test cases/unit/87 prelinking/main.c | 10 +++ test cases/unit/87 prelinking/meson.build | 8 +++ test cases/unit/87 prelinking/private_header.h | 11 +++ test cases/unit/87 prelinking/public_header.h | 3 + test cases/unit/88 prelinking/file1.c | 14 ---- test cases/unit/88 prelinking/file2.c | 9 --- test cases/unit/88 prelinking/file3.c | 9 --- test cases/unit/88 prelinking/file4.c | 9 --- test cases/unit/88 prelinking/main.c | 10 --- test cases/unit/88 prelinking/meson.build | 8 --- test cases/unit/88 prelinking/private_header.h | 11 --- test cases/unit/88 prelinking/public_header.h | 3 - test cases/unit/88 run native test/main.c | 17 +++++ test cases/unit/88 run native test/meson.build | 6 ++ test cases/unit/89 multiple envvars/meson.build | 4 ++ test cases/unit/89 multiple envvars/prog.c | 18 +++++ test cases/unit/89 multiple envvars/prog.cpp | 18 +++++ test cases/unit/89 run native test/main.c | 17 ----- test cases/unit/89 run native test/meson.build | 6 -- test cases/unit/90 multiple envvars/meson.build | 4 -- test cases/unit/90 multiple envvars/prog.c | 18 ----- test cases/unit/90 multiple envvars/prog.cpp | 18 ----- test cases/unit/91 install skip subprojects/foo.c | 4 -- .../unit/91 install skip subprojects/foo.dat | 1 - test cases/unit/91 install skip subprojects/foo.h | 1 - .../unit/91 install skip subprojects/foo/foofile | 0 .../unit/91 install skip subprojects/meson.build | 8 --- .../subprojects/bar/bar.c | 4 -- .../subprojects/bar/bar.dat | 1 - .../subprojects/bar/bar.h | 1 - .../subprojects/bar/bar/barfile | 1 - .../subprojects/bar/meson.build | 6 -- test cases/unit/92 install skip subprojects/foo.c | 4 ++ .../unit/92 install skip subprojects/foo.dat | 1 + test cases/unit/92 install skip subprojects/foo.h | 1 + .../unit/92 install skip subprojects/foo/foofile | 0 .../unit/92 install skip subprojects/meson.build | 8 +++ .../subprojects/bar/bar.c | 4 ++ .../subprojects/bar/bar.dat | 1 + .../subprojects/bar/bar.h | 1 + .../subprojects/bar/bar/barfile | 1 + .../subprojects/bar/meson.build | 6 ++ .../meson.build | 7 -- .../meson_options.txt | 3 - .../subprojects/sub/foo.c | 6 -- .../subprojects/sub/meson.build | 7 -- test cases/unit/93 clangformat/.clang-format | 4 -- .../unit/93 clangformat/.clang-format-ignore | 3 - .../unit/93 clangformat/.clang-format-include | 3 - test cases/unit/93 clangformat/meson.build | 1 - .../unit/93 clangformat/not-included/badformat.cpp | 2 - test cases/unit/93 clangformat/src/badformat.c | 2 - test cases/unit/93 clangformat/src/badformat.cpp | 2 - .../meson.build | 7 ++ .../meson_options.txt | 3 + .../subprojects/sub/foo.c | 6 ++ .../subprojects/sub/meson.build | 7 ++ test cases/unit/94 clangformat/.clang-format | 4 ++ .../unit/94 clangformat/.clang-format-ignore | 3 + .../unit/94 clangformat/.clang-format-include | 3 + test cases/unit/94 clangformat/meson.build | 1 + .../unit/94 clangformat/not-included/badformat.cpp | 2 + test cases/unit/94 clangformat/src/badformat.c | 2 + test cases/unit/94 clangformat/src/badformat.cpp | 2 + test cases/unit/94 custominc/easytogrepfor/genh.py | 7 -- .../unit/94 custominc/easytogrepfor/meson.build | 3 - test cases/unit/94 custominc/helper.c | 5 -- test cases/unit/94 custominc/meson.build | 9 --- test cases/unit/94 custominc/prog.c | 9 --- test cases/unit/94 custominc/prog2.c | 10 --- test cases/unit/95 custominc/easytogrepfor/genh.py | 7 ++ .../unit/95 custominc/easytogrepfor/meson.build | 3 + test cases/unit/95 custominc/helper.c | 5 ++ test cases/unit/95 custominc/meson.build | 9 +++ test cases/unit/95 custominc/prog.c | 9 +++ test cases/unit/95 custominc/prog2.c | 10 +++ 306 files changed, 1138 insertions(+), 1138 deletions(-) create mode 100644 test cases/unit/63 cmake_prefix_path/meson.build create mode 100644 test cases/unit/63 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake create mode 100644 test cases/unit/64 cmake parser/meson.build create mode 100644 test cases/unit/64 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake delete mode 100644 test cases/unit/64 cmake_prefix_path/meson.build delete mode 100644 test cases/unit/64 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake create mode 100644 test cases/unit/65 alias target/main.c create mode 100644 test cases/unit/65 alias target/meson.build delete mode 100644 test cases/unit/65 cmake parser/meson.build delete mode 100644 test cases/unit/65 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake delete mode 100644 test cases/unit/66 alias target/main.c delete mode 100644 test cases/unit/66 alias target/meson.build create mode 100644 test cases/unit/66 static archive stripping/app/appA.c create mode 100644 test cases/unit/66 static archive stripping/app/appB.c create mode 100644 test cases/unit/66 static archive stripping/app/meson.build create mode 100644 test cases/unit/66 static archive stripping/lib/libA.c create mode 100644 test cases/unit/66 static archive stripping/lib/libA.h create mode 100644 test cases/unit/66 static archive stripping/lib/libB.c create mode 100644 test cases/unit/66 static archive stripping/lib/libB.h create mode 100644 test cases/unit/66 static archive stripping/lib/meson.build delete mode 100644 test cases/unit/67 static archive stripping/app/appA.c delete mode 100644 test cases/unit/67 static archive stripping/app/appB.c delete mode 100644 test cases/unit/67 static archive stripping/app/meson.build delete mode 100644 test cases/unit/67 static archive stripping/lib/libA.c delete mode 100644 test cases/unit/67 static archive stripping/lib/libA.h delete mode 100644 test cases/unit/67 static archive stripping/lib/libB.c delete mode 100644 test cases/unit/67 static archive stripping/lib/libB.h delete mode 100644 test cases/unit/67 static archive stripping/lib/meson.build create mode 100644 test cases/unit/67 static link/lib/func1.c create mode 100644 test cases/unit/67 static link/lib/func10.c create mode 100644 test cases/unit/67 static link/lib/func11.c create mode 100644 test cases/unit/67 static link/lib/func12.c create mode 100644 test cases/unit/67 static link/lib/func14.c create mode 100644 test cases/unit/67 static link/lib/func15.c create mode 100644 test cases/unit/67 static link/lib/func16.c create mode 100644 test cases/unit/67 static link/lib/func17.c create mode 100644 test cases/unit/67 static link/lib/func18.c create mode 100644 test cases/unit/67 static link/lib/func19.c create mode 100644 test cases/unit/67 static link/lib/func2.c create mode 100644 test cases/unit/67 static link/lib/func3.c create mode 100644 test cases/unit/67 static link/lib/func4.c create mode 100644 test cases/unit/67 static link/lib/func5.c create mode 100644 test cases/unit/67 static link/lib/func6.c create mode 100644 test cases/unit/67 static link/lib/func7.c create mode 100644 test cases/unit/67 static link/lib/func8.c create mode 100644 test cases/unit/67 static link/lib/func9.c create mode 100644 test cases/unit/67 static link/lib/meson.build create mode 100644 test cases/unit/67 static link/meson.build create mode 100644 test cases/unit/67 static link/test1.c create mode 100644 test cases/unit/67 static link/test2.c create mode 100644 test cases/unit/67 static link/test3.c create mode 100644 test cases/unit/67 static link/test4.c create mode 100644 test cases/unit/67 static link/test5.c delete mode 100644 test cases/unit/68 static link/lib/func1.c delete mode 100644 test cases/unit/68 static link/lib/func10.c delete mode 100644 test cases/unit/68 static link/lib/func11.c delete mode 100644 test cases/unit/68 static link/lib/func12.c delete mode 100644 test cases/unit/68 static link/lib/func14.c delete mode 100644 test cases/unit/68 static link/lib/func15.c delete mode 100644 test cases/unit/68 static link/lib/func16.c delete mode 100644 test cases/unit/68 static link/lib/func17.c delete mode 100644 test cases/unit/68 static link/lib/func18.c delete mode 100644 test cases/unit/68 static link/lib/func19.c delete mode 100644 test cases/unit/68 static link/lib/func2.c delete mode 100644 test cases/unit/68 static link/lib/func3.c delete mode 100644 test cases/unit/68 static link/lib/func4.c delete mode 100644 test cases/unit/68 static link/lib/func5.c delete mode 100644 test cases/unit/68 static link/lib/func6.c delete mode 100644 test cases/unit/68 static link/lib/func7.c delete mode 100644 test cases/unit/68 static link/lib/func8.c delete mode 100644 test cases/unit/68 static link/lib/func9.c delete mode 100644 test cases/unit/68 static link/lib/meson.build delete mode 100644 test cases/unit/68 static link/meson.build delete mode 100644 test cases/unit/68 static link/test1.c delete mode 100644 test cases/unit/68 static link/test2.c delete mode 100644 test cases/unit/68 static link/test3.c delete mode 100644 test cases/unit/68 static link/test4.c delete mode 100644 test cases/unit/68 static link/test5.c create mode 100644 test cases/unit/68 test env value/meson.build create mode 100755 test cases/unit/68 test env value/test.py create mode 100644 test cases/unit/69 clang-tidy/.clang-tidy create mode 100644 test cases/unit/69 clang-tidy/cttest.cpp create mode 100644 test cases/unit/69 clang-tidy/dummydir.h/dummy.dat create mode 100644 test cases/unit/69 clang-tidy/meson.build delete mode 100644 test cases/unit/69 test env value/meson.build delete mode 100755 test cases/unit/69 test env value/test.py delete mode 100644 test cases/unit/70 clang-tidy/.clang-tidy delete mode 100644 test cases/unit/70 clang-tidy/cttest.cpp delete mode 100644 test cases/unit/70 clang-tidy/dummydir.h/dummy.dat delete mode 100644 test cases/unit/70 clang-tidy/meson.build create mode 100644 test cases/unit/70 cross/crossfile.in create mode 100644 test cases/unit/70 cross/meson.build create mode 100644 test cases/unit/70 cross/meson_options.txt create mode 100755 test cases/unit/71 cross test passed/exewrapper.py create mode 100644 test cases/unit/71 cross test passed/meson.build create mode 100644 test cases/unit/71 cross test passed/meson_options.txt create mode 100644 test cases/unit/71 cross test passed/script.py create mode 100644 test cases/unit/71 cross test passed/src/main.c delete mode 100644 test cases/unit/71 cross/crossfile.in delete mode 100644 test cases/unit/71 cross/meson.build delete mode 100644 test cases/unit/71 cross/meson_options.txt delete mode 100755 test cases/unit/72 cross test passed/exewrapper.py delete mode 100644 test cases/unit/72 cross test passed/meson.build delete mode 100644 test cases/unit/72 cross test passed/meson_options.txt delete mode 100644 test cases/unit/72 cross test passed/script.py delete mode 100644 test cases/unit/72 cross test passed/src/main.c create mode 100644 test cases/unit/72 summary/meson.build create mode 100644 test cases/unit/72 summary/meson_options.txt create mode 100644 test cases/unit/72 summary/subprojects/sub/meson.build create mode 100644 test cases/unit/72 summary/subprojects/sub2/meson.build delete mode 100644 test cases/unit/73 summary/meson.build delete mode 100644 test cases/unit/73 summary/meson_options.txt delete mode 100644 test cases/unit/73 summary/subprojects/sub/meson.build delete mode 100644 test cases/unit/73 summary/subprojects/sub2/meson.build create mode 100644 test cases/unit/73 wrap file url/meson.build create mode 100644 test cases/unit/73 wrap file url/subprojects/foo-patch.tar.xz create mode 100644 test cases/unit/73 wrap file url/subprojects/foo.tar.xz create mode 100644 test cases/unit/74 dep files/foo.c create mode 100644 test cases/unit/74 dep files/meson.build delete mode 100644 test cases/unit/74 wrap file url/meson.build delete mode 100644 test cases/unit/74 wrap file url/subprojects/foo-patch.tar.xz delete mode 100644 test cases/unit/74 wrap file url/subprojects/foo.tar.xz delete mode 100644 test cases/unit/75 dep files/foo.c delete mode 100644 test cases/unit/75 dep files/meson.build create mode 100644 test cases/unit/75 pkgconfig prefixes/client/client.c create mode 100644 test cases/unit/75 pkgconfig prefixes/client/meson.build create mode 100644 test cases/unit/75 pkgconfig prefixes/val1/meson.build create mode 100644 test cases/unit/75 pkgconfig prefixes/val1/val1.c create mode 100644 test cases/unit/75 pkgconfig prefixes/val1/val1.h create mode 100644 test cases/unit/75 pkgconfig prefixes/val2/meson.build create mode 100644 test cases/unit/75 pkgconfig prefixes/val2/val2.c create mode 100644 test cases/unit/75 pkgconfig prefixes/val2/val2.h delete mode 100644 test cases/unit/76 pkgconfig prefixes/client/client.c delete mode 100644 test cases/unit/76 pkgconfig prefixes/client/meson.build delete mode 100644 test cases/unit/76 pkgconfig prefixes/val1/meson.build delete mode 100644 test cases/unit/76 pkgconfig prefixes/val1/val1.c delete mode 100644 test cases/unit/76 pkgconfig prefixes/val1/val1.h delete mode 100644 test cases/unit/76 pkgconfig prefixes/val2/meson.build delete mode 100644 test cases/unit/76 pkgconfig prefixes/val2/val2.c delete mode 100644 test cases/unit/76 pkgconfig prefixes/val2/val2.h create mode 100644 test cases/unit/76 subdir libdir/meson.build create mode 100644 test cases/unit/76 subdir libdir/subprojects/flub/meson.build create mode 100644 test cases/unit/77 as link whole/bar.c create mode 100644 test cases/unit/77 as link whole/foo.c create mode 100644 test cases/unit/77 as link whole/meson.build delete mode 100644 test cases/unit/77 subdir libdir/meson.build delete mode 100644 test cases/unit/77 subdir libdir/subprojects/flub/meson.build delete mode 100644 test cases/unit/78 as link whole/bar.c delete mode 100644 test cases/unit/78 as link whole/foo.c delete mode 100644 test cases/unit/78 as link whole/meson.build create mode 100644 test cases/unit/78 nostdlib/meson.build create mode 100644 test cases/unit/78 nostdlib/prog.c create mode 100644 test cases/unit/78 nostdlib/subprojects/mylibc/libc.c create mode 100644 test cases/unit/78 nostdlib/subprojects/mylibc/meson.build create mode 100644 test cases/unit/78 nostdlib/subprojects/mylibc/stdio.h create mode 100644 test cases/unit/78 nostdlib/subprojects/mylibc/stubstart.s delete mode 100644 test cases/unit/79 nostdlib/meson.build delete mode 100644 test cases/unit/79 nostdlib/prog.c delete mode 100644 test cases/unit/79 nostdlib/subprojects/mylibc/libc.c delete mode 100644 test cases/unit/79 nostdlib/subprojects/mylibc/meson.build delete mode 100644 test cases/unit/79 nostdlib/subprojects/mylibc/stdio.h delete mode 100644 test cases/unit/79 nostdlib/subprojects/mylibc/stubstart.s create mode 100644 test cases/unit/79 user options for subproject/.gitignore create mode 100644 test cases/unit/79 user options for subproject/75 user options for subproject/.gitignore create mode 100644 test cases/unit/79 user options for subproject/75 user options for subproject/meson.build create mode 100644 test cases/unit/80 global-rpath/meson.build create mode 100644 test cases/unit/80 global-rpath/rpathified.cpp create mode 100644 test cases/unit/80 global-rpath/yonder/meson.build create mode 100644 test cases/unit/80 global-rpath/yonder/yonder.cpp create mode 100644 test cases/unit/80 global-rpath/yonder/yonder.h delete mode 100644 test cases/unit/80 user options for subproject/.gitignore delete mode 100644 test cases/unit/80 user options for subproject/75 user options for subproject/.gitignore delete mode 100644 test cases/unit/80 user options for subproject/75 user options for subproject/meson.build delete mode 100644 test cases/unit/81 global-rpath/meson.build delete mode 100644 test cases/unit/81 global-rpath/rpathified.cpp delete mode 100644 test cases/unit/81 global-rpath/yonder/meson.build delete mode 100644 test cases/unit/81 global-rpath/yonder/yonder.cpp delete mode 100644 test cases/unit/81 global-rpath/yonder/yonder.h create mode 100644 test cases/unit/81 wrap-git/meson.build create mode 100644 test cases/unit/81 wrap-git/subprojects/packagefiles/wrap_git_builddef/meson.build create mode 100644 test cases/unit/81 wrap-git/subprojects/wrap_git_upstream/main.c create mode 100644 test cases/unit/82 meson version compare/meson.build delete mode 100644 test cases/unit/82 wrap-git/meson.build delete mode 100644 test cases/unit/82 wrap-git/subprojects/packagefiles/wrap_git_builddef/meson.build delete mode 100644 test cases/unit/82 wrap-git/subprojects/wrap_git_upstream/main.c create mode 100644 test cases/unit/83 cross only introspect/meson.build delete mode 100644 test cases/unit/83 meson version compare/meson.build create mode 100644 test cases/unit/84 change option choices/meson.build create mode 100644 test cases/unit/84 change option choices/meson_options.1.txt create mode 100644 test cases/unit/84 change option choices/meson_options.2.txt delete mode 100644 test cases/unit/84 cross only introspect/meson.build delete mode 100644 test cases/unit/85 change option choices/meson.build delete mode 100644 test cases/unit/85 change option choices/meson_options.1.txt delete mode 100644 test cases/unit/85 change option choices/meson_options.2.txt create mode 100644 test cases/unit/85 nested subproject regenerate depends/main.c create mode 100644 test cases/unit/85 nested subproject regenerate depends/meson.build create mode 100644 test cases/unit/85 nested subproject regenerate depends/subprojects/sub1/meson.build create mode 100644 test cases/unit/85 nested subproject regenerate depends/subprojects/sub2/CMakeLists.txt create mode 100644 test cases/unit/86 cpp modules/main.cpp create mode 100644 test cases/unit/86 cpp modules/meson.build create mode 100644 test cases/unit/86 cpp modules/src0.ixx create mode 100644 test cases/unit/86 cpp modules/src1.ixx create mode 100644 test cases/unit/86 cpp modules/src2.ixx create mode 100644 test cases/unit/86 cpp modules/src3.ixx create mode 100644 test cases/unit/86 cpp modules/src4.ixx create mode 100644 test cases/unit/86 cpp modules/src5.ixx create mode 100644 test cases/unit/86 cpp modules/src6.ixx create mode 100644 test cases/unit/86 cpp modules/src7.ixx create mode 100644 test cases/unit/86 cpp modules/src8.ixx create mode 100644 test cases/unit/86 cpp modules/src9.ixx delete mode 100644 test cases/unit/86 nested subproject regenerate depends/main.c delete mode 100644 test cases/unit/86 nested subproject regenerate depends/meson.build delete mode 100644 test cases/unit/86 nested subproject regenerate depends/subprojects/sub1/meson.build delete mode 100644 test cases/unit/86 nested subproject regenerate depends/subprojects/sub2/CMakeLists.txt delete mode 100644 test cases/unit/87 cpp modules/main.cpp delete mode 100644 test cases/unit/87 cpp modules/meson.build delete mode 100644 test cases/unit/87 cpp modules/src0.ixx delete mode 100644 test cases/unit/87 cpp modules/src1.ixx delete mode 100644 test cases/unit/87 cpp modules/src2.ixx delete mode 100644 test cases/unit/87 cpp modules/src3.ixx delete mode 100644 test cases/unit/87 cpp modules/src4.ixx delete mode 100644 test cases/unit/87 cpp modules/src5.ixx delete mode 100644 test cases/unit/87 cpp modules/src6.ixx delete mode 100644 test cases/unit/87 cpp modules/src7.ixx delete mode 100644 test cases/unit/87 cpp modules/src8.ixx delete mode 100644 test cases/unit/87 cpp modules/src9.ixx create mode 100644 test cases/unit/87 prelinking/file1.c create mode 100644 test cases/unit/87 prelinking/file2.c create mode 100644 test cases/unit/87 prelinking/file3.c create mode 100644 test cases/unit/87 prelinking/file4.c create mode 100644 test cases/unit/87 prelinking/main.c create mode 100644 test cases/unit/87 prelinking/meson.build create mode 100644 test cases/unit/87 prelinking/private_header.h create mode 100644 test cases/unit/87 prelinking/public_header.h delete mode 100644 test cases/unit/88 prelinking/file1.c delete mode 100644 test cases/unit/88 prelinking/file2.c delete mode 100644 test cases/unit/88 prelinking/file3.c delete mode 100644 test cases/unit/88 prelinking/file4.c delete mode 100644 test cases/unit/88 prelinking/main.c delete mode 100644 test cases/unit/88 prelinking/meson.build delete mode 100644 test cases/unit/88 prelinking/private_header.h delete mode 100644 test cases/unit/88 prelinking/public_header.h create mode 100644 test cases/unit/88 run native test/main.c create mode 100644 test cases/unit/88 run native test/meson.build create mode 100644 test cases/unit/89 multiple envvars/meson.build create mode 100644 test cases/unit/89 multiple envvars/prog.c create mode 100644 test cases/unit/89 multiple envvars/prog.cpp delete mode 100644 test cases/unit/89 run native test/main.c delete mode 100644 test cases/unit/89 run native test/meson.build delete mode 100644 test cases/unit/90 multiple envvars/meson.build delete mode 100644 test cases/unit/90 multiple envvars/prog.c delete mode 100644 test cases/unit/90 multiple envvars/prog.cpp delete mode 100644 test cases/unit/91 install skip subprojects/foo.c delete mode 100644 test cases/unit/91 install skip subprojects/foo.dat delete mode 100644 test cases/unit/91 install skip subprojects/foo.h delete mode 100644 test cases/unit/91 install skip subprojects/foo/foofile delete mode 100644 test cases/unit/91 install skip subprojects/meson.build delete mode 100644 test cases/unit/91 install skip subprojects/subprojects/bar/bar.c delete mode 100644 test cases/unit/91 install skip subprojects/subprojects/bar/bar.dat delete mode 100644 test cases/unit/91 install skip subprojects/subprojects/bar/bar.h delete mode 100644 test cases/unit/91 install skip subprojects/subprojects/bar/bar/barfile delete mode 100644 test cases/unit/91 install skip subprojects/subprojects/bar/meson.build create mode 100644 test cases/unit/92 install skip subprojects/foo.c create mode 100644 test cases/unit/92 install skip subprojects/foo.dat create mode 100644 test cases/unit/92 install skip subprojects/foo.h create mode 100644 test cases/unit/92 install skip subprojects/foo/foofile create mode 100644 test cases/unit/92 install skip subprojects/meson.build create mode 100644 test cases/unit/92 install skip subprojects/subprojects/bar/bar.c create mode 100644 test cases/unit/92 install skip subprojects/subprojects/bar/bar.dat create mode 100644 test cases/unit/92 install skip subprojects/subprojects/bar/bar.h create mode 100644 test cases/unit/92 install skip subprojects/subprojects/bar/bar/barfile create mode 100644 test cases/unit/92 install skip subprojects/subprojects/bar/meson.build delete mode 100644 test cases/unit/92 new subproject in configured project/meson.build delete mode 100644 test cases/unit/92 new subproject in configured project/meson_options.txt delete mode 100644 test cases/unit/92 new subproject in configured project/subprojects/sub/foo.c delete mode 100644 test cases/unit/92 new subproject in configured project/subprojects/sub/meson.build delete mode 100644 test cases/unit/93 clangformat/.clang-format delete mode 100644 test cases/unit/93 clangformat/.clang-format-ignore delete mode 100644 test cases/unit/93 clangformat/.clang-format-include delete mode 100644 test cases/unit/93 clangformat/meson.build delete mode 100644 test cases/unit/93 clangformat/not-included/badformat.cpp delete mode 100644 test cases/unit/93 clangformat/src/badformat.c delete mode 100644 test cases/unit/93 clangformat/src/badformat.cpp create mode 100644 test cases/unit/93 new subproject in configured project/meson.build create mode 100644 test cases/unit/93 new subproject in configured project/meson_options.txt create mode 100644 test cases/unit/93 new subproject in configured project/subprojects/sub/foo.c create mode 100644 test cases/unit/93 new subproject in configured project/subprojects/sub/meson.build create mode 100644 test cases/unit/94 clangformat/.clang-format create mode 100644 test cases/unit/94 clangformat/.clang-format-ignore create mode 100644 test cases/unit/94 clangformat/.clang-format-include create mode 100644 test cases/unit/94 clangformat/meson.build create mode 100644 test cases/unit/94 clangformat/not-included/badformat.cpp create mode 100644 test cases/unit/94 clangformat/src/badformat.c create mode 100644 test cases/unit/94 clangformat/src/badformat.cpp delete mode 100644 test cases/unit/94 custominc/easytogrepfor/genh.py delete mode 100644 test cases/unit/94 custominc/easytogrepfor/meson.build delete mode 100644 test cases/unit/94 custominc/helper.c delete mode 100644 test cases/unit/94 custominc/meson.build delete mode 100644 test cases/unit/94 custominc/prog.c delete mode 100644 test cases/unit/94 custominc/prog2.c create mode 100644 test cases/unit/95 custominc/easytogrepfor/genh.py create mode 100644 test cases/unit/95 custominc/easytogrepfor/meson.build create mode 100644 test cases/unit/95 custominc/helper.c create mode 100644 test cases/unit/95 custominc/meson.build create mode 100644 test cases/unit/95 custominc/prog.c create mode 100644 test cases/unit/95 custominc/prog2.c (limited to 'test cases/unit') diff --git a/test cases/unit/63 cmake_prefix_path/meson.build b/test cases/unit/63 cmake_prefix_path/meson.build new file mode 100644 index 000000000..442bbd396 --- /dev/null +++ b/test cases/unit/63 cmake_prefix_path/meson.build @@ -0,0 +1,4 @@ +project('cmake prefix path test') + +d = dependency('mesontest', method : 'cmake') +assert(d.version() == '1.2.3', 'Got the wrong version!') diff --git a/test cases/unit/63 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake b/test cases/unit/63 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake new file mode 100644 index 000000000..289b349b8 --- /dev/null +++ b/test cases/unit/63 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake @@ -0,0 +1,4 @@ +set(MESONTEST_VERSION "1.2.3") +set(MESONTEST_LIBRARIES "foo.so") +set(MESONTEST_INCLUDE_DIR "") +set(MESONTEST_FOUND "TRUE") diff --git a/test cases/unit/64 cmake parser/meson.build b/test cases/unit/64 cmake parser/meson.build new file mode 100644 index 000000000..061bab0b6 --- /dev/null +++ b/test cases/unit/64 cmake parser/meson.build @@ -0,0 +1,19 @@ +project('61 cmake parser') + +dep = dependency('mesontest') + +# Test a bunch of variations of the set() command +assert(dep.get_variable(cmake : 'VAR_WITHOUT_SPACES') == 'NoSpaces', 'set() without spaces incorrect') +assert(dep.get_variable(cmake : 'VAR_WITH_SPACES') == 'With Spaces', 'set() with spaces incorrect') + +assert(dep.get_variable(cmake : 'VAR_WITHOUT_SPACES_PS') == 'NoSpaces', 'set(PARENT_SCOPE) without spaces incorrect') +assert(dep.get_variable(cmake : 'VAR_WITH_SPACES_PS') == 'With Spaces', 'set(PARENT_SCOPE) with spaces incorrect') + +assert(dep.get_variable(cmake : 'VAR_THAT_IS_UNSET', default_value : 'sentinal') == 'sentinal', 'set() to unset is incorrect') +assert(dep.get_variable(cmake : 'CACHED_STRING_NS') == 'foo', 'set(CACHED) without spaces is incorrect') +assert(dep.get_variable(cmake : 'CACHED_STRING_WS') == 'foo bar', 'set(CACHED STRING) with spaces is incorrect') +assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_NS') == ['foo', 'bar'], 'set(CACHED STRING) without spaces is incorrect') +assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_WS') == ['foo', 'foo bar', 'bar'], 'set(CACHED STRING[]) with spaces is incorrect') + +# We don't support this, so it should be unset. +assert(dep.get_variable(cmake : 'ENV{var}', default_value : 'sentinal') == 'sentinal', 'set(ENV) should be ignored') \ No newline at end of file diff --git a/test cases/unit/64 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake b/test cases/unit/64 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake new file mode 100644 index 000000000..7474eb78d --- /dev/null +++ b/test cases/unit/64 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake @@ -0,0 +1,63 @@ +# This should be enough to satisfy the basic parser +set(MESONTEST_VERSION "1.2.3") +set(MESONTEST_LIBRARIES "foo.so") +set(MESONTEST_INCLUDE_DIR "") +set(MESONTEST_FOUND "TRUE") + +## Tests for set() in its various forms + +# Basic usage +set(VAR_WITHOUT_SPACES "NoSpaces") +set(VAR_WITH_SPACES "With Spaces") + +# test of PARENT_SCOPE, requires a function to have a parent scope obviously... +function(foo) + set(VAR_WITHOUT_SPACES_PS "NoSpaces" PARENT_SCOPE) + set(VAR_WITH_SPACES_PS "With Spaces" PARENT_SCOPE) +endfunction(foo) +foo() + +# Using set() to unset values +set(VAR_THAT_IS_UNSET "foo") +set(VAR_THAT_IS_UNSET) + +# The more advanced form that uses CACHE +# XXX: Why don't we read the type and use that instead of always treat things as strings? +set(CACHED_STRING_NS "foo" CACHE STRING "docstring") +set(CACHED_STRING_WS "foo bar" CACHE STRING "docstring") +set(CACHED_STRING_ARRAY_NS "foo;bar" CACHE STRING "doc string") +set(CACHED_STRING_ARRAY_WS "foo;foo bar;bar" CACHE STRING "stuff" FORCE) + +set(CACHED_BOOL ON CACHE BOOL "docstring") + +set(CACHED_PATH_NS "foo/bar" CACHE PATH "docstring") +set(CACHED_PATH_WS "foo bar/fin" CACHE PATH "docstring") + +set(CACHED_FILEPATH_NS "foo/bar.txt" CACHE FILEPATH "docstring") +set(CACHED_FILEPATH_WS "foo bar/fin.txt" CACHE FILEPATH "docstring") + +# Set ENV, we don't support this so it shouldn't be showing up +set(ENV{var}, "foo") + + +## Tests for set_properties() +# We need something to attach properties too +add_custom_target(MESONTEST_FOO ALL) + +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value") +set_property(TARGET MESONTEST_FOO APPEND PROPERTY FOLDER "name") +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value") +set_property(TARGET MESONTEST_FOO APPEND_STRING PROPERTY FOLDER "name") + +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value space") +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value space") +set_property(TARGET MESONTEST_FOO APPEND PROPERTY FOLDER "name space") +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value space") +set_property(TARGET MESONTEST_FOO APPEND_STRING PROPERTY FOLDER "name space") + +## Tests for set_target_properties() +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value") +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value space") +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value" OUTPUT_NAME "another value") +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value space" OUTPUT_NAME "another value") +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value space" OUTPUT_NAME "value") \ No newline at end of file diff --git a/test cases/unit/64 cmake_prefix_path/meson.build b/test cases/unit/64 cmake_prefix_path/meson.build deleted file mode 100644 index 442bbd396..000000000 --- a/test cases/unit/64 cmake_prefix_path/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('cmake prefix path test') - -d = dependency('mesontest', method : 'cmake') -assert(d.version() == '1.2.3', 'Got the wrong version!') diff --git a/test cases/unit/64 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake b/test cases/unit/64 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake deleted file mode 100644 index 289b349b8..000000000 --- a/test cases/unit/64 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set(MESONTEST_VERSION "1.2.3") -set(MESONTEST_LIBRARIES "foo.so") -set(MESONTEST_INCLUDE_DIR "") -set(MESONTEST_FOUND "TRUE") diff --git a/test cases/unit/65 alias target/main.c b/test cases/unit/65 alias target/main.c new file mode 100644 index 000000000..0fb4389f7 --- /dev/null +++ b/test cases/unit/65 alias target/main.c @@ -0,0 +1,3 @@ +int main(int argc, char *argv[]) { + return 0; +} diff --git a/test cases/unit/65 alias target/meson.build b/test cases/unit/65 alias target/meson.build new file mode 100644 index 000000000..6934cc79b --- /dev/null +++ b/test cases/unit/65 alias target/meson.build @@ -0,0 +1,15 @@ +project('alias target', 'c') + +python3 = import('python').find_installation() + +exe_target = executable('prog', 'main.c', + build_by_default : false) + +custom_target = custom_target('custom-target', + output : 'hello.txt', + command : [python3, '-c', 'print("hello")'], + capture : true, + build_by_default : false +) + +alias_target('build-all', [exe_target, custom_target]) diff --git a/test cases/unit/65 cmake parser/meson.build b/test cases/unit/65 cmake parser/meson.build deleted file mode 100644 index 061bab0b6..000000000 --- a/test cases/unit/65 cmake parser/meson.build +++ /dev/null @@ -1,19 +0,0 @@ -project('61 cmake parser') - -dep = dependency('mesontest') - -# Test a bunch of variations of the set() command -assert(dep.get_variable(cmake : 'VAR_WITHOUT_SPACES') == 'NoSpaces', 'set() without spaces incorrect') -assert(dep.get_variable(cmake : 'VAR_WITH_SPACES') == 'With Spaces', 'set() with spaces incorrect') - -assert(dep.get_variable(cmake : 'VAR_WITHOUT_SPACES_PS') == 'NoSpaces', 'set(PARENT_SCOPE) without spaces incorrect') -assert(dep.get_variable(cmake : 'VAR_WITH_SPACES_PS') == 'With Spaces', 'set(PARENT_SCOPE) with spaces incorrect') - -assert(dep.get_variable(cmake : 'VAR_THAT_IS_UNSET', default_value : 'sentinal') == 'sentinal', 'set() to unset is incorrect') -assert(dep.get_variable(cmake : 'CACHED_STRING_NS') == 'foo', 'set(CACHED) without spaces is incorrect') -assert(dep.get_variable(cmake : 'CACHED_STRING_WS') == 'foo bar', 'set(CACHED STRING) with spaces is incorrect') -assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_NS') == ['foo', 'bar'], 'set(CACHED STRING) without spaces is incorrect') -assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_WS') == ['foo', 'foo bar', 'bar'], 'set(CACHED STRING[]) with spaces is incorrect') - -# We don't support this, so it should be unset. -assert(dep.get_variable(cmake : 'ENV{var}', default_value : 'sentinal') == 'sentinal', 'set(ENV) should be ignored') \ No newline at end of file diff --git a/test cases/unit/65 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake b/test cases/unit/65 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake deleted file mode 100644 index 7474eb78d..000000000 --- a/test cases/unit/65 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake +++ /dev/null @@ -1,63 +0,0 @@ -# This should be enough to satisfy the basic parser -set(MESONTEST_VERSION "1.2.3") -set(MESONTEST_LIBRARIES "foo.so") -set(MESONTEST_INCLUDE_DIR "") -set(MESONTEST_FOUND "TRUE") - -## Tests for set() in its various forms - -# Basic usage -set(VAR_WITHOUT_SPACES "NoSpaces") -set(VAR_WITH_SPACES "With Spaces") - -# test of PARENT_SCOPE, requires a function to have a parent scope obviously... -function(foo) - set(VAR_WITHOUT_SPACES_PS "NoSpaces" PARENT_SCOPE) - set(VAR_WITH_SPACES_PS "With Spaces" PARENT_SCOPE) -endfunction(foo) -foo() - -# Using set() to unset values -set(VAR_THAT_IS_UNSET "foo") -set(VAR_THAT_IS_UNSET) - -# The more advanced form that uses CACHE -# XXX: Why don't we read the type and use that instead of always treat things as strings? -set(CACHED_STRING_NS "foo" CACHE STRING "docstring") -set(CACHED_STRING_WS "foo bar" CACHE STRING "docstring") -set(CACHED_STRING_ARRAY_NS "foo;bar" CACHE STRING "doc string") -set(CACHED_STRING_ARRAY_WS "foo;foo bar;bar" CACHE STRING "stuff" FORCE) - -set(CACHED_BOOL ON CACHE BOOL "docstring") - -set(CACHED_PATH_NS "foo/bar" CACHE PATH "docstring") -set(CACHED_PATH_WS "foo bar/fin" CACHE PATH "docstring") - -set(CACHED_FILEPATH_NS "foo/bar.txt" CACHE FILEPATH "docstring") -set(CACHED_FILEPATH_WS "foo bar/fin.txt" CACHE FILEPATH "docstring") - -# Set ENV, we don't support this so it shouldn't be showing up -set(ENV{var}, "foo") - - -## Tests for set_properties() -# We need something to attach properties too -add_custom_target(MESONTEST_FOO ALL) - -set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value") -set_property(TARGET MESONTEST_FOO APPEND PROPERTY FOLDER "name") -set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value") -set_property(TARGET MESONTEST_FOO APPEND_STRING PROPERTY FOLDER "name") - -set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value space") -set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value space") -set_property(TARGET MESONTEST_FOO APPEND PROPERTY FOLDER "name space") -set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value space") -set_property(TARGET MESONTEST_FOO APPEND_STRING PROPERTY FOLDER "name space") - -## Tests for set_target_properties() -set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value") -set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value space") -set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value" OUTPUT_NAME "another value") -set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value space" OUTPUT_NAME "another value") -set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value space" OUTPUT_NAME "value") \ No newline at end of file diff --git a/test cases/unit/66 alias target/main.c b/test cases/unit/66 alias target/main.c deleted file mode 100644 index 0fb4389f7..000000000 --- a/test cases/unit/66 alias target/main.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(int argc, char *argv[]) { - return 0; -} diff --git a/test cases/unit/66 alias target/meson.build b/test cases/unit/66 alias target/meson.build deleted file mode 100644 index 6934cc79b..000000000 --- a/test cases/unit/66 alias target/meson.build +++ /dev/null @@ -1,15 +0,0 @@ -project('alias target', 'c') - -python3 = import('python').find_installation() - -exe_target = executable('prog', 'main.c', - build_by_default : false) - -custom_target = custom_target('custom-target', - output : 'hello.txt', - command : [python3, '-c', 'print("hello")'], - capture : true, - build_by_default : false -) - -alias_target('build-all', [exe_target, custom_target]) diff --git a/test cases/unit/66 static archive stripping/app/appA.c b/test cases/unit/66 static archive stripping/app/appA.c new file mode 100644 index 000000000..e44b54a92 --- /dev/null +++ b/test cases/unit/66 static archive stripping/app/appA.c @@ -0,0 +1,4 @@ +#include +#include + +int main(void) { printf("The answer is: %d\n", libA_func()); } diff --git a/test cases/unit/66 static archive stripping/app/appB.c b/test cases/unit/66 static archive stripping/app/appB.c new file mode 100644 index 000000000..0ec0b629e --- /dev/null +++ b/test cases/unit/66 static archive stripping/app/appB.c @@ -0,0 +1,4 @@ +#include +#include + +int main(void) { printf("The answer is: %d\n", libB_func()); } diff --git a/test cases/unit/66 static archive stripping/app/meson.build b/test cases/unit/66 static archive stripping/app/meson.build new file mode 100644 index 000000000..118719dec --- /dev/null +++ b/test cases/unit/66 static archive stripping/app/meson.build @@ -0,0 +1,7 @@ +project('app', ['c']) + +a = dependency('test-a') +b = dependency('test-b') + +executable('appA', files('appA.c'), dependencies : a) +executable('appB', files('appB.c'), dependencies : b) diff --git a/test cases/unit/66 static archive stripping/lib/libA.c b/test cases/unit/66 static archive stripping/lib/libA.c new file mode 100644 index 000000000..a97185e56 --- /dev/null +++ b/test cases/unit/66 static archive stripping/lib/libA.c @@ -0,0 +1,5 @@ +#include + +static int libA_func_impl(void) { return 0; } + +int libA_func(void) { return libA_func_impl(); } diff --git a/test cases/unit/66 static archive stripping/lib/libA.h b/test cases/unit/66 static archive stripping/lib/libA.h new file mode 100644 index 000000000..e6450cd1e --- /dev/null +++ b/test cases/unit/66 static archive stripping/lib/libA.h @@ -0,0 +1 @@ +int libA_func(void); diff --git a/test cases/unit/66 static archive stripping/lib/libB.c b/test cases/unit/66 static archive stripping/lib/libB.c new file mode 100644 index 000000000..0200b1f05 --- /dev/null +++ b/test cases/unit/66 static archive stripping/lib/libB.c @@ -0,0 +1,5 @@ +#include + +static int libB_func_impl(void) { return 0; } + +int libB_func(void) { return libB_func_impl(); } diff --git a/test cases/unit/66 static archive stripping/lib/libB.h b/test cases/unit/66 static archive stripping/lib/libB.h new file mode 100644 index 000000000..065a4a411 --- /dev/null +++ b/test cases/unit/66 static archive stripping/lib/libB.h @@ -0,0 +1 @@ +int libB_func(void); diff --git a/test cases/unit/66 static archive stripping/lib/meson.build b/test cases/unit/66 static archive stripping/lib/meson.build new file mode 100644 index 000000000..ae50fa7b4 --- /dev/null +++ b/test cases/unit/66 static archive stripping/lib/meson.build @@ -0,0 +1,23 @@ +project('lib', ['c']) + +pkg = import('pkgconfig') + +a = library('test-a', files('libA.c'), install: true) +install_headers(files('libA.h'), subdir: 'libA') +pkg.generate( + a, + version: '0.0', + description: 'test library libA', + filebase: 'test-a', + name: 'test library libA', + subdirs: 'libA') + +b = static_library('test-b', files('libB.c'), install: true) +install_headers(files('libB.h'), subdir: 'libB') +pkg.generate( + b, + version: '0.0', + description: 'test library libB', + filebase: 'test-b', + name: 'test library libB', + subdirs: 'libB') diff --git a/test cases/unit/67 static archive stripping/app/appA.c b/test cases/unit/67 static archive stripping/app/appA.c deleted file mode 100644 index e44b54a92..000000000 --- a/test cases/unit/67 static archive stripping/app/appA.c +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include - -int main(void) { printf("The answer is: %d\n", libA_func()); } diff --git a/test cases/unit/67 static archive stripping/app/appB.c b/test cases/unit/67 static archive stripping/app/appB.c deleted file mode 100644 index 0ec0b629e..000000000 --- a/test cases/unit/67 static archive stripping/app/appB.c +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include - -int main(void) { printf("The answer is: %d\n", libB_func()); } diff --git a/test cases/unit/67 static archive stripping/app/meson.build b/test cases/unit/67 static archive stripping/app/meson.build deleted file mode 100644 index 118719dec..000000000 --- a/test cases/unit/67 static archive stripping/app/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('app', ['c']) - -a = dependency('test-a') -b = dependency('test-b') - -executable('appA', files('appA.c'), dependencies : a) -executable('appB', files('appB.c'), dependencies : b) diff --git a/test cases/unit/67 static archive stripping/lib/libA.c b/test cases/unit/67 static archive stripping/lib/libA.c deleted file mode 100644 index a97185e56..000000000 --- a/test cases/unit/67 static archive stripping/lib/libA.c +++ /dev/null @@ -1,5 +0,0 @@ -#include - -static int libA_func_impl(void) { return 0; } - -int libA_func(void) { return libA_func_impl(); } diff --git a/test cases/unit/67 static archive stripping/lib/libA.h b/test cases/unit/67 static archive stripping/lib/libA.h deleted file mode 100644 index e6450cd1e..000000000 --- a/test cases/unit/67 static archive stripping/lib/libA.h +++ /dev/null @@ -1 +0,0 @@ -int libA_func(void); diff --git a/test cases/unit/67 static archive stripping/lib/libB.c b/test cases/unit/67 static archive stripping/lib/libB.c deleted file mode 100644 index 0200b1f05..000000000 --- a/test cases/unit/67 static archive stripping/lib/libB.c +++ /dev/null @@ -1,5 +0,0 @@ -#include - -static int libB_func_impl(void) { return 0; } - -int libB_func(void) { return libB_func_impl(); } diff --git a/test cases/unit/67 static archive stripping/lib/libB.h b/test cases/unit/67 static archive stripping/lib/libB.h deleted file mode 100644 index 065a4a411..000000000 --- a/test cases/unit/67 static archive stripping/lib/libB.h +++ /dev/null @@ -1 +0,0 @@ -int libB_func(void); diff --git a/test cases/unit/67 static archive stripping/lib/meson.build b/test cases/unit/67 static archive stripping/lib/meson.build deleted file mode 100644 index ae50fa7b4..000000000 --- a/test cases/unit/67 static archive stripping/lib/meson.build +++ /dev/null @@ -1,23 +0,0 @@ -project('lib', ['c']) - -pkg = import('pkgconfig') - -a = library('test-a', files('libA.c'), install: true) -install_headers(files('libA.h'), subdir: 'libA') -pkg.generate( - a, - version: '0.0', - description: 'test library libA', - filebase: 'test-a', - name: 'test library libA', - subdirs: 'libA') - -b = static_library('test-b', files('libB.c'), install: true) -install_headers(files('libB.h'), subdir: 'libB') -pkg.generate( - b, - version: '0.0', - description: 'test library libB', - filebase: 'test-b', - name: 'test library libB', - subdirs: 'libB') diff --git a/test cases/unit/67 static link/lib/func1.c b/test cases/unit/67 static link/lib/func1.c new file mode 100644 index 000000000..cc934ad04 --- /dev/null +++ b/test cases/unit/67 static link/lib/func1.c @@ -0,0 +1,9 @@ +int func1() +{ + return 1; +} + +int func1b() +{ + return 1; +} diff --git a/test cases/unit/67 static link/lib/func10.c b/test cases/unit/67 static link/lib/func10.c new file mode 100644 index 000000000..75a911fb7 --- /dev/null +++ b/test cases/unit/67 static link/lib/func10.c @@ -0,0 +1,4 @@ +int func10() +{ + return 1; +} diff --git a/test cases/unit/67 static link/lib/func11.c b/test cases/unit/67 static link/lib/func11.c new file mode 100644 index 000000000..1d5119b47 --- /dev/null +++ b/test cases/unit/67 static link/lib/func11.c @@ -0,0 +1,6 @@ +int func10(); + +int func11() +{ + return func10() + 1; +} diff --git a/test cases/unit/67 static link/lib/func12.c b/test cases/unit/67 static link/lib/func12.c new file mode 100644 index 000000000..73db5c073 --- /dev/null +++ b/test cases/unit/67 static link/lib/func12.c @@ -0,0 +1,7 @@ +int func10(); +int func11(); + +int func12() +{ + return func10() + func11(); +} diff --git a/test cases/unit/67 static link/lib/func14.c b/test cases/unit/67 static link/lib/func14.c new file mode 100644 index 000000000..0277319fc --- /dev/null +++ b/test cases/unit/67 static link/lib/func14.c @@ -0,0 +1,4 @@ +int func14() +{ + return 1; +} diff --git a/test cases/unit/67 static link/lib/func15.c b/test cases/unit/67 static link/lib/func15.c new file mode 100644 index 000000000..78303cc2f --- /dev/null +++ b/test cases/unit/67 static link/lib/func15.c @@ -0,0 +1,6 @@ +int func14(); + +int func15() +{ + return func14() + 1; +} diff --git a/test cases/unit/67 static link/lib/func16.c b/test cases/unit/67 static link/lib/func16.c new file mode 100644 index 000000000..379b6829f --- /dev/null +++ b/test cases/unit/67 static link/lib/func16.c @@ -0,0 +1,6 @@ +int func15(); + +int func16() +{ + return func15() + 1; +} diff --git a/test cases/unit/67 static link/lib/func17.c b/test cases/unit/67 static link/lib/func17.c new file mode 100644 index 000000000..d1d8ec498 --- /dev/null +++ b/test cases/unit/67 static link/lib/func17.c @@ -0,0 +1,4 @@ +int func17() +{ + return 1; +} diff --git a/test cases/unit/67 static link/lib/func18.c b/test cases/unit/67 static link/lib/func18.c new file mode 100644 index 000000000..c149085ba --- /dev/null +++ b/test cases/unit/67 static link/lib/func18.c @@ -0,0 +1,6 @@ +int func17(); + +int func18() +{ + return func17() + 1; +} diff --git a/test cases/unit/67 static link/lib/func19.c b/test cases/unit/67 static link/lib/func19.c new file mode 100644 index 000000000..69120e4bf --- /dev/null +++ b/test cases/unit/67 static link/lib/func19.c @@ -0,0 +1,7 @@ +int func17(); +int func18(); + +int func19() +{ + return func17() + func18(); +} diff --git a/test cases/unit/67 static link/lib/func2.c b/test cases/unit/67 static link/lib/func2.c new file mode 100644 index 000000000..6b8f53935 --- /dev/null +++ b/test cases/unit/67 static link/lib/func2.c @@ -0,0 +1,6 @@ +int func1(); + +int func2() +{ + return func1() + 1; +} diff --git a/test cases/unit/67 static link/lib/func3.c b/test cases/unit/67 static link/lib/func3.c new file mode 100644 index 000000000..04f9f8939 --- /dev/null +++ b/test cases/unit/67 static link/lib/func3.c @@ -0,0 +1,4 @@ +int func3() +{ + return 1; +} diff --git a/test cases/unit/67 static link/lib/func4.c b/test cases/unit/67 static link/lib/func4.c new file mode 100644 index 000000000..c44c99099 --- /dev/null +++ b/test cases/unit/67 static link/lib/func4.c @@ -0,0 +1,6 @@ +int func3(); + +int func4() +{ + return func3() + 1; +} diff --git a/test cases/unit/67 static link/lib/func5.c b/test cases/unit/67 static link/lib/func5.c new file mode 100644 index 000000000..8e078641c --- /dev/null +++ b/test cases/unit/67 static link/lib/func5.c @@ -0,0 +1,4 @@ +int func5() +{ + return 1; +} diff --git a/test cases/unit/67 static link/lib/func6.c b/test cases/unit/67 static link/lib/func6.c new file mode 100644 index 000000000..276fe7d48 --- /dev/null +++ b/test cases/unit/67 static link/lib/func6.c @@ -0,0 +1,6 @@ +int func5(); + +int func6() +{ + return func5() + 1; +} diff --git a/test cases/unit/67 static link/lib/func7.c b/test cases/unit/67 static link/lib/func7.c new file mode 100644 index 000000000..8c1a5368d --- /dev/null +++ b/test cases/unit/67 static link/lib/func7.c @@ -0,0 +1,4 @@ +int func7() +{ + return 1; +} diff --git a/test cases/unit/67 static link/lib/func8.c b/test cases/unit/67 static link/lib/func8.c new file mode 100644 index 000000000..b7b6cd545 --- /dev/null +++ b/test cases/unit/67 static link/lib/func8.c @@ -0,0 +1,6 @@ +int func7(); + +int func8() +{ + return func7() + 1; +} diff --git a/test cases/unit/67 static link/lib/func9.c b/test cases/unit/67 static link/lib/func9.c new file mode 100644 index 000000000..852252d1a --- /dev/null +++ b/test cases/unit/67 static link/lib/func9.c @@ -0,0 +1,6 @@ +int func8(); + +int func9() +{ + return func8() + 1; +} diff --git a/test cases/unit/67 static link/lib/meson.build b/test cases/unit/67 static link/lib/meson.build new file mode 100644 index 000000000..8f95fc454 --- /dev/null +++ b/test cases/unit/67 static link/lib/meson.build @@ -0,0 +1,80 @@ +project('test static link libs', 'c') + +pkg = import('pkgconfig') + +# libfunc2 should contain both func1() and func2() symbols +libfunc1 = static_library('func1', 'func1.c', + install : false) +libfunc2 = static_library('func2', 'func2.c', + link_whole : libfunc1, + install : true) + +# Same as above, but with link_with instead of link_whole, +# libfunc4 should contain both func3() and func4() symbols +libfunc3 = static_library('func3', 'func3.c', + install : false) +libfunc4 = static_library('func4', 'func4.c', + link_with : libfunc3, + install : true) + +# Same as above, but also generate an pkg-config file. Use both_libraries() to +# make sure a complete .pc file gets generated. libfunc5 should not be mentioned +# into the .pc file because it's not installed. +libfunc5 = static_library('func5', 'func5.c', + install : false) +libfunc6 = both_libraries('func6', 'func6.c', + link_with : libfunc5, + install : true) +pkg.generate(libfunc6) + +# libfunc9 should contain both func8() and func9() but not func7() because that +# one gets installed. Also test that link_with and link_whole works the same way +# because libfunc8 is uninstalled. +libfunc7 = static_library('func7', 'func7.c', + install : true) +libfunc8 = static_library('func8', 'func8.c', + link_with : libfunc7, + install : false) +libfunc9_linkwith = static_library('func9_linkwith', 'func9.c', + link_with : libfunc8, + install : true) +libfunc9_linkwhole = static_library('func9_linkwhole', 'func9.c', + link_whole : libfunc8, + install : true) + +# Pattern found in mesa: +# - libfunc11 uses func10() +# - libfunc12 uses both func10() and func11() +# When a shared library link_whole on libfunc12, we ensure we don't include +# func10.c.o twice which would fail to link. +libfunc10 = static_library('func10', 'func10.c', + install : false) +libfunc11 = static_library('func11', 'func11.c', + link_with : libfunc10, + install : false) +libfunc12 = static_library('func12', 'func12.c', + link_with : [libfunc10, libfunc11], + install : false) +libfunc13 = shared_library('func13', link_whole : libfunc12) + +# libfunc16 should contain func14(), func15() and func16() +libfunc14 = static_library('func14', 'func14.c', + install : false) +libfunc15 = static_library('func15', 'func15.c', + link_with : libfunc14, + install : false) +libfunc16 = static_library('func16', 'func16.c', + link_with : libfunc15, + install : true) + +# Verify func17.c.o gets included only once into libfunc19, otherwise +# func19-shared would failed with duplicated symbol. +libfunc17 = static_library('func17', 'func17.c', + install : false) +libfunc18 = static_library('func18', 'func18.c', + link_with : libfunc17, + install : false) +libfunc19 = static_library('func19', 'func19.c', + link_whole : [libfunc17, libfunc18], + install : false) +shared_library('func19-shared', link_whole : [libfunc19]) diff --git a/test cases/unit/67 static link/meson.build b/test cases/unit/67 static link/meson.build new file mode 100644 index 000000000..dac17f810 --- /dev/null +++ b/test cases/unit/67 static link/meson.build @@ -0,0 +1,32 @@ +project('test static link', 'c') + +cc = meson.get_compiler('c') + +# Verify that installed libfunc2.a is usable +func2_dep = cc.find_library('func2') +test('test1', executable('test1', 'test1.c', dependencies : func2_dep)) + +# Verify that installed libfunc4.a is usable +func4_dep = cc.find_library('func4') +test('test2', executable('test2', 'test2.c', dependencies : func4_dep)) + +# Verify that installed pkg-config file is usable for both shared and static link +func6_static_dep = dependency('func6', static : true) +test('test3-static', executable('test3-static', 'test3.c', + dependencies : func6_static_dep)) +func6_shared_dep = dependency('func6', static : false) +test('test3-shared', executable('test3-shared', 'test3.c', + dependencies : func6_shared_dep)) + +# Verify that installed libfunc9.a contains func8() and func8() but not func7() +func7_dep = cc.find_library('func7') +func9_linkwhole_dep = cc.find_library('func9_linkwhole') +test('test4-linkwhole', executable('test4-linkwhole', 'test4.c', + dependencies : [func7_dep, func9_linkwhole_dep])) +func9_linkwith_dep = cc.find_library('func9_linkwith') +test('test4-linkwith', executable('test4-linkwith', 'test4.c', + dependencies : [func7_dep, func9_linkwith_dep])) + +# Verify that installed libfunc16.a is usable +libfunc16_dep = cc.find_library('func16') +test('test5', executable('test5', 'test5.c', dependencies: libfunc16_dep)) diff --git a/test cases/unit/67 static link/test1.c b/test cases/unit/67 static link/test1.c new file mode 100644 index 000000000..ffc9b9eb9 --- /dev/null +++ b/test cases/unit/67 static link/test1.c @@ -0,0 +1,7 @@ +int func1b(); +int func2(); + +int main(int argc, char *argv[]) +{ + return func2() + func1b() == 3 ? 0 : 1; +} diff --git a/test cases/unit/67 static link/test2.c b/test cases/unit/67 static link/test2.c new file mode 100644 index 000000000..561422af0 --- /dev/null +++ b/test cases/unit/67 static link/test2.c @@ -0,0 +1,6 @@ +int func4(); + +int main(int argc, char *argv[]) +{ + return func4() == 2 ? 0 : 1; +} diff --git a/test cases/unit/67 static link/test3.c b/test cases/unit/67 static link/test3.c new file mode 100644 index 000000000..1216064dc --- /dev/null +++ b/test cases/unit/67 static link/test3.c @@ -0,0 +1,6 @@ +int func6(); + +int main(int argc, char *argv[]) +{ + return func6() == 2 ? 0 : 1; +} diff --git a/test cases/unit/67 static link/test4.c b/test cases/unit/67 static link/test4.c new file mode 100644 index 000000000..7c281e026 --- /dev/null +++ b/test cases/unit/67 static link/test4.c @@ -0,0 +1,6 @@ +int func9(); + +int main(int argc, char *argv[]) +{ + return func9() == 3 ? 0 : 1; +} diff --git a/test cases/unit/67 static link/test5.c b/test cases/unit/67 static link/test5.c new file mode 100644 index 000000000..6020f0e7c --- /dev/null +++ b/test cases/unit/67 static link/test5.c @@ -0,0 +1,6 @@ +int func16(); + +int main(int argc, char *argv[]) +{ + return func16() == 3 ? 0 : 1; +} diff --git a/test cases/unit/68 static link/lib/func1.c b/test cases/unit/68 static link/lib/func1.c deleted file mode 100644 index cc934ad04..000000000 --- a/test cases/unit/68 static link/lib/func1.c +++ /dev/null @@ -1,9 +0,0 @@ -int func1() -{ - return 1; -} - -int func1b() -{ - return 1; -} diff --git a/test cases/unit/68 static link/lib/func10.c b/test cases/unit/68 static link/lib/func10.c deleted file mode 100644 index 75a911fb7..000000000 --- a/test cases/unit/68 static link/lib/func10.c +++ /dev/null @@ -1,4 +0,0 @@ -int func10() -{ - return 1; -} diff --git a/test cases/unit/68 static link/lib/func11.c b/test cases/unit/68 static link/lib/func11.c deleted file mode 100644 index 1d5119b47..000000000 --- a/test cases/unit/68 static link/lib/func11.c +++ /dev/null @@ -1,6 +0,0 @@ -int func10(); - -int func11() -{ - return func10() + 1; -} diff --git a/test cases/unit/68 static link/lib/func12.c b/test cases/unit/68 static link/lib/func12.c deleted file mode 100644 index 73db5c073..000000000 --- a/test cases/unit/68 static link/lib/func12.c +++ /dev/null @@ -1,7 +0,0 @@ -int func10(); -int func11(); - -int func12() -{ - return func10() + func11(); -} diff --git a/test cases/unit/68 static link/lib/func14.c b/test cases/unit/68 static link/lib/func14.c deleted file mode 100644 index 0277319fc..000000000 --- a/test cases/unit/68 static link/lib/func14.c +++ /dev/null @@ -1,4 +0,0 @@ -int func14() -{ - return 1; -} diff --git a/test cases/unit/68 static link/lib/func15.c b/test cases/unit/68 static link/lib/func15.c deleted file mode 100644 index 78303cc2f..000000000 --- a/test cases/unit/68 static link/lib/func15.c +++ /dev/null @@ -1,6 +0,0 @@ -int func14(); - -int func15() -{ - return func14() + 1; -} diff --git a/test cases/unit/68 static link/lib/func16.c b/test cases/unit/68 static link/lib/func16.c deleted file mode 100644 index 379b6829f..000000000 --- a/test cases/unit/68 static link/lib/func16.c +++ /dev/null @@ -1,6 +0,0 @@ -int func15(); - -int func16() -{ - return func15() + 1; -} diff --git a/test cases/unit/68 static link/lib/func17.c b/test cases/unit/68 static link/lib/func17.c deleted file mode 100644 index d1d8ec498..000000000 --- a/test cases/unit/68 static link/lib/func17.c +++ /dev/null @@ -1,4 +0,0 @@ -int func17() -{ - return 1; -} diff --git a/test cases/unit/68 static link/lib/func18.c b/test cases/unit/68 static link/lib/func18.c deleted file mode 100644 index c149085ba..000000000 --- a/test cases/unit/68 static link/lib/func18.c +++ /dev/null @@ -1,6 +0,0 @@ -int func17(); - -int func18() -{ - return func17() + 1; -} diff --git a/test cases/unit/68 static link/lib/func19.c b/test cases/unit/68 static link/lib/func19.c deleted file mode 100644 index 69120e4bf..000000000 --- a/test cases/unit/68 static link/lib/func19.c +++ /dev/null @@ -1,7 +0,0 @@ -int func17(); -int func18(); - -int func19() -{ - return func17() + func18(); -} diff --git a/test cases/unit/68 static link/lib/func2.c b/test cases/unit/68 static link/lib/func2.c deleted file mode 100644 index 6b8f53935..000000000 --- a/test cases/unit/68 static link/lib/func2.c +++ /dev/null @@ -1,6 +0,0 @@ -int func1(); - -int func2() -{ - return func1() + 1; -} diff --git a/test cases/unit/68 static link/lib/func3.c b/test cases/unit/68 static link/lib/func3.c deleted file mode 100644 index 04f9f8939..000000000 --- a/test cases/unit/68 static link/lib/func3.c +++ /dev/null @@ -1,4 +0,0 @@ -int func3() -{ - return 1; -} diff --git a/test cases/unit/68 static link/lib/func4.c b/test cases/unit/68 static link/lib/func4.c deleted file mode 100644 index c44c99099..000000000 --- a/test cases/unit/68 static link/lib/func4.c +++ /dev/null @@ -1,6 +0,0 @@ -int func3(); - -int func4() -{ - return func3() + 1; -} diff --git a/test cases/unit/68 static link/lib/func5.c b/test cases/unit/68 static link/lib/func5.c deleted file mode 100644 index 8e078641c..000000000 --- a/test cases/unit/68 static link/lib/func5.c +++ /dev/null @@ -1,4 +0,0 @@ -int func5() -{ - return 1; -} diff --git a/test cases/unit/68 static link/lib/func6.c b/test cases/unit/68 static link/lib/func6.c deleted file mode 100644 index 276fe7d48..000000000 --- a/test cases/unit/68 static link/lib/func6.c +++ /dev/null @@ -1,6 +0,0 @@ -int func5(); - -int func6() -{ - return func5() + 1; -} diff --git a/test cases/unit/68 static link/lib/func7.c b/test cases/unit/68 static link/lib/func7.c deleted file mode 100644 index 8c1a5368d..000000000 --- a/test cases/unit/68 static link/lib/func7.c +++ /dev/null @@ -1,4 +0,0 @@ -int func7() -{ - return 1; -} diff --git a/test cases/unit/68 static link/lib/func8.c b/test cases/unit/68 static link/lib/func8.c deleted file mode 100644 index b7b6cd545..000000000 --- a/test cases/unit/68 static link/lib/func8.c +++ /dev/null @@ -1,6 +0,0 @@ -int func7(); - -int func8() -{ - return func7() + 1; -} diff --git a/test cases/unit/68 static link/lib/func9.c b/test cases/unit/68 static link/lib/func9.c deleted file mode 100644 index 852252d1a..000000000 --- a/test cases/unit/68 static link/lib/func9.c +++ /dev/null @@ -1,6 +0,0 @@ -int func8(); - -int func9() -{ - return func8() + 1; -} diff --git a/test cases/unit/68 static link/lib/meson.build b/test cases/unit/68 static link/lib/meson.build deleted file mode 100644 index 8f95fc454..000000000 --- a/test cases/unit/68 static link/lib/meson.build +++ /dev/null @@ -1,80 +0,0 @@ -project('test static link libs', 'c') - -pkg = import('pkgconfig') - -# libfunc2 should contain both func1() and func2() symbols -libfunc1 = static_library('func1', 'func1.c', - install : false) -libfunc2 = static_library('func2', 'func2.c', - link_whole : libfunc1, - install : true) - -# Same as above, but with link_with instead of link_whole, -# libfunc4 should contain both func3() and func4() symbols -libfunc3 = static_library('func3', 'func3.c', - install : false) -libfunc4 = static_library('func4', 'func4.c', - link_with : libfunc3, - install : true) - -# Same as above, but also generate an pkg-config file. Use both_libraries() to -# make sure a complete .pc file gets generated. libfunc5 should not be mentioned -# into the .pc file because it's not installed. -libfunc5 = static_library('func5', 'func5.c', - install : false) -libfunc6 = both_libraries('func6', 'func6.c', - link_with : libfunc5, - install : true) -pkg.generate(libfunc6) - -# libfunc9 should contain both func8() and func9() but not func7() because that -# one gets installed. Also test that link_with and link_whole works the same way -# because libfunc8 is uninstalled. -libfunc7 = static_library('func7', 'func7.c', - install : true) -libfunc8 = static_library('func8', 'func8.c', - link_with : libfunc7, - install : false) -libfunc9_linkwith = static_library('func9_linkwith', 'func9.c', - link_with : libfunc8, - install : true) -libfunc9_linkwhole = static_library('func9_linkwhole', 'func9.c', - link_whole : libfunc8, - install : true) - -# Pattern found in mesa: -# - libfunc11 uses func10() -# - libfunc12 uses both func10() and func11() -# When a shared library link_whole on libfunc12, we ensure we don't include -# func10.c.o twice which would fail to link. -libfunc10 = static_library('func10', 'func10.c', - install : false) -libfunc11 = static_library('func11', 'func11.c', - link_with : libfunc10, - install : false) -libfunc12 = static_library('func12', 'func12.c', - link_with : [libfunc10, libfunc11], - install : false) -libfunc13 = shared_library('func13', link_whole : libfunc12) - -# libfunc16 should contain func14(), func15() and func16() -libfunc14 = static_library('func14', 'func14.c', - install : false) -libfunc15 = static_library('func15', 'func15.c', - link_with : libfunc14, - install : false) -libfunc16 = static_library('func16', 'func16.c', - link_with : libfunc15, - install : true) - -# Verify func17.c.o gets included only once into libfunc19, otherwise -# func19-shared would failed with duplicated symbol. -libfunc17 = static_library('func17', 'func17.c', - install : false) -libfunc18 = static_library('func18', 'func18.c', - link_with : libfunc17, - install : false) -libfunc19 = static_library('func19', 'func19.c', - link_whole : [libfunc17, libfunc18], - install : false) -shared_library('func19-shared', link_whole : [libfunc19]) diff --git a/test cases/unit/68 static link/meson.build b/test cases/unit/68 static link/meson.build deleted file mode 100644 index dac17f810..000000000 --- a/test cases/unit/68 static link/meson.build +++ /dev/null @@ -1,32 +0,0 @@ -project('test static link', 'c') - -cc = meson.get_compiler('c') - -# Verify that installed libfunc2.a is usable -func2_dep = cc.find_library('func2') -test('test1', executable('test1', 'test1.c', dependencies : func2_dep)) - -# Verify that installed libfunc4.a is usable -func4_dep = cc.find_library('func4') -test('test2', executable('test2', 'test2.c', dependencies : func4_dep)) - -# Verify that installed pkg-config file is usable for both shared and static link -func6_static_dep = dependency('func6', static : true) -test('test3-static', executable('test3-static', 'test3.c', - dependencies : func6_static_dep)) -func6_shared_dep = dependency('func6', static : false) -test('test3-shared', executable('test3-shared', 'test3.c', - dependencies : func6_shared_dep)) - -# Verify that installed libfunc9.a contains func8() and func8() but not func7() -func7_dep = cc.find_library('func7') -func9_linkwhole_dep = cc.find_library('func9_linkwhole') -test('test4-linkwhole', executable('test4-linkwhole', 'test4.c', - dependencies : [func7_dep, func9_linkwhole_dep])) -func9_linkwith_dep = cc.find_library('func9_linkwith') -test('test4-linkwith', executable('test4-linkwith', 'test4.c', - dependencies : [func7_dep, func9_linkwith_dep])) - -# Verify that installed libfunc16.a is usable -libfunc16_dep = cc.find_library('func16') -test('test5', executable('test5', 'test5.c', dependencies: libfunc16_dep)) diff --git a/test cases/unit/68 static link/test1.c b/test cases/unit/68 static link/test1.c deleted file mode 100644 index ffc9b9eb9..000000000 --- a/test cases/unit/68 static link/test1.c +++ /dev/null @@ -1,7 +0,0 @@ -int func1b(); -int func2(); - -int main(int argc, char *argv[]) -{ - return func2() + func1b() == 3 ? 0 : 1; -} diff --git a/test cases/unit/68 static link/test2.c b/test cases/unit/68 static link/test2.c deleted file mode 100644 index 561422af0..000000000 --- a/test cases/unit/68 static link/test2.c +++ /dev/null @@ -1,6 +0,0 @@ -int func4(); - -int main(int argc, char *argv[]) -{ - return func4() == 2 ? 0 : 1; -} diff --git a/test cases/unit/68 static link/test3.c b/test cases/unit/68 static link/test3.c deleted file mode 100644 index 1216064dc..000000000 --- a/test cases/unit/68 static link/test3.c +++ /dev/null @@ -1,6 +0,0 @@ -int func6(); - -int main(int argc, char *argv[]) -{ - return func6() == 2 ? 0 : 1; -} diff --git a/test cases/unit/68 static link/test4.c b/test cases/unit/68 static link/test4.c deleted file mode 100644 index 7c281e026..000000000 --- a/test cases/unit/68 static link/test4.c +++ /dev/null @@ -1,6 +0,0 @@ -int func9(); - -int main(int argc, char *argv[]) -{ - return func9() == 3 ? 0 : 1; -} diff --git a/test cases/unit/68 static link/test5.c b/test cases/unit/68 static link/test5.c deleted file mode 100644 index 6020f0e7c..000000000 --- a/test cases/unit/68 static link/test5.c +++ /dev/null @@ -1,6 +0,0 @@ -int func16(); - -int main(int argc, char *argv[]) -{ - return func16() == 3 ? 0 : 1; -} diff --git a/test cases/unit/68 test env value/meson.build b/test cases/unit/68 test env value/meson.build new file mode 100644 index 000000000..aa3dbc35d --- /dev/null +++ b/test cases/unit/68 test env value/meson.build @@ -0,0 +1,10 @@ +project('test env value') + +testpy = find_program('test.py') + +val = ['1', '2', '3'] +foreach v: val + test('check env', testpy, args: [v], env: {'TEST_VAR': v}) +endforeach +test('check env', testpy, args: ['4'], env: environment({'TEST_VAR': '4'})) +test('check env', testpy, args: ['5'], env: environment(['TEST_VAR=5'])) diff --git a/test cases/unit/68 test env value/test.py b/test cases/unit/68 test env value/test.py new file mode 100755 index 000000000..0cc7645e7 --- /dev/null +++ b/test cases/unit/68 test env value/test.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import os +import sys + +assert(os.environ['TEST_VAR'] == sys.argv[1]) diff --git a/test cases/unit/69 clang-tidy/.clang-tidy b/test cases/unit/69 clang-tidy/.clang-tidy new file mode 100644 index 000000000..393529479 --- /dev/null +++ b/test cases/unit/69 clang-tidy/.clang-tidy @@ -0,0 +1 @@ +Checks: '-*,modernize-use-bool-literals' diff --git a/test cases/unit/69 clang-tidy/cttest.cpp b/test cases/unit/69 clang-tidy/cttest.cpp new file mode 100644 index 000000000..07b35a666 --- /dev/null +++ b/test cases/unit/69 clang-tidy/cttest.cpp @@ -0,0 +1,7 @@ +#include + +int main(int, char**) { + bool intbool = 1; + printf("Intbool is %d\n", (int)intbool); + return 0; +} diff --git a/test cases/unit/69 clang-tidy/dummydir.h/dummy.dat b/test cases/unit/69 clang-tidy/dummydir.h/dummy.dat new file mode 100644 index 000000000..80c6165f3 --- /dev/null +++ b/test cases/unit/69 clang-tidy/dummydir.h/dummy.dat @@ -0,0 +1 @@ +Placeholder to track enclosing directory in git. Not to be analyzed. diff --git a/test cases/unit/69 clang-tidy/meson.build b/test cases/unit/69 clang-tidy/meson.build new file mode 100644 index 000000000..737474b02 --- /dev/null +++ b/test cases/unit/69 clang-tidy/meson.build @@ -0,0 +1,3 @@ +project('clangtidytest', 'cpp', default_options: 'cpp_std=c++14') + +executable('cttest', 'cttest.cpp') diff --git a/test cases/unit/69 test env value/meson.build b/test cases/unit/69 test env value/meson.build deleted file mode 100644 index aa3dbc35d..000000000 --- a/test cases/unit/69 test env value/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -project('test env value') - -testpy = find_program('test.py') - -val = ['1', '2', '3'] -foreach v: val - test('check env', testpy, args: [v], env: {'TEST_VAR': v}) -endforeach -test('check env', testpy, args: ['4'], env: environment({'TEST_VAR': '4'})) -test('check env', testpy, args: ['5'], env: environment(['TEST_VAR=5'])) diff --git a/test cases/unit/69 test env value/test.py b/test cases/unit/69 test env value/test.py deleted file mode 100755 index 0cc7645e7..000000000 --- a/test cases/unit/69 test env value/test.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -assert(os.environ['TEST_VAR'] == sys.argv[1]) diff --git a/test cases/unit/70 clang-tidy/.clang-tidy b/test cases/unit/70 clang-tidy/.clang-tidy deleted file mode 100644 index 393529479..000000000 --- a/test cases/unit/70 clang-tidy/.clang-tidy +++ /dev/null @@ -1 +0,0 @@ -Checks: '-*,modernize-use-bool-literals' diff --git a/test cases/unit/70 clang-tidy/cttest.cpp b/test cases/unit/70 clang-tidy/cttest.cpp deleted file mode 100644 index 07b35a666..000000000 --- a/test cases/unit/70 clang-tidy/cttest.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main(int, char**) { - bool intbool = 1; - printf("Intbool is %d\n", (int)intbool); - return 0; -} diff --git a/test cases/unit/70 clang-tidy/dummydir.h/dummy.dat b/test cases/unit/70 clang-tidy/dummydir.h/dummy.dat deleted file mode 100644 index 80c6165f3..000000000 --- a/test cases/unit/70 clang-tidy/dummydir.h/dummy.dat +++ /dev/null @@ -1 +0,0 @@ -Placeholder to track enclosing directory in git. Not to be analyzed. diff --git a/test cases/unit/70 clang-tidy/meson.build b/test cases/unit/70 clang-tidy/meson.build deleted file mode 100644 index 737474b02..000000000 --- a/test cases/unit/70 clang-tidy/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('clangtidytest', 'cpp', default_options: 'cpp_std=c++14') - -executable('cttest', 'cttest.cpp') diff --git a/test cases/unit/70 cross/crossfile.in b/test cases/unit/70 cross/crossfile.in new file mode 100644 index 000000000..678e8d3a3 --- /dev/null +++ b/test cases/unit/70 cross/crossfile.in @@ -0,0 +1,5 @@ +[host_machine] +system = '@system@' +cpu_family = '@cpu_family@' +cpu = '@cpu@' +endian = '@endian@' diff --git a/test cases/unit/70 cross/meson.build b/test cases/unit/70 cross/meson.build new file mode 100644 index 000000000..6c85cf73b --- /dev/null +++ b/test cases/unit/70 cross/meson.build @@ -0,0 +1,16 @@ +project('crosstest') + +if get_option('generate') + conf_data = configuration_data() + conf_data.set('system', build_machine.system()) + conf_data.set('cpu', build_machine.cpu()) + conf_data.set('cpu_family', build_machine.cpu_family()) + conf_data.set('endian', build_machine.endian()) + + configure_file(input: 'crossfile.in', + output: 'crossfile', + configuration: conf_data) + message('Written cross file') +else + assert(meson.is_cross_build(), 'not setup as cross build') +endif diff --git a/test cases/unit/70 cross/meson_options.txt b/test cases/unit/70 cross/meson_options.txt new file mode 100644 index 000000000..5896d63c8 --- /dev/null +++ b/test cases/unit/70 cross/meson_options.txt @@ -0,0 +1 @@ +option('generate', type : 'boolean', value : false) diff --git a/test cases/unit/71 cross test passed/exewrapper.py b/test cases/unit/71 cross test passed/exewrapper.py new file mode 100755 index 000000000..2c15ed6f3 --- /dev/null +++ b/test cases/unit/71 cross test passed/exewrapper.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +# Test that the MESON_EXE_WRAPPER environment variable is set + +import argparse +import os +import sys + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('binary') # unused, but needed for test behavior + parser.add_argument('--expected', action='store_true') + args = parser.parse_args() + + defined = 'MESON_EXE_WRAPPER' in os.environ + + if args.expected != defined: + print(os.environ, file=sys.stderr) + return 1 + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/test cases/unit/71 cross test passed/meson.build b/test cases/unit/71 cross test passed/meson.build new file mode 100644 index 000000000..4deb74baf --- /dev/null +++ b/test cases/unit/71 cross test passed/meson.build @@ -0,0 +1,19 @@ +project( + 'cross test passed', + 'c', + version : '>= 0.51' +) + +e = executable('exec', 'src/main.c') + +py = import('python').find_installation() + +test('root', e) +test('main', py, args : [meson.current_source_dir() / 'script.py', e]) + +wrapper_args = [] +if get_option('expect') + wrapper_args += '--expected' +endif + +test('exe_wrapper in env', py, args : [meson.current_source_dir() / 'exewrapper.py', e, wrapper_args]) diff --git a/test cases/unit/71 cross test passed/meson_options.txt b/test cases/unit/71 cross test passed/meson_options.txt new file mode 100644 index 000000000..084c77625 --- /dev/null +++ b/test cases/unit/71 cross test passed/meson_options.txt @@ -0,0 +1,5 @@ +option( + 'expect', + type : 'boolean', + value : false, +) diff --git a/test cases/unit/71 cross test passed/script.py b/test cases/unit/71 cross test passed/script.py new file mode 100644 index 000000000..257cd30d8 --- /dev/null +++ b/test cases/unit/71 cross test passed/script.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 + +import subprocess +import sys + +if __name__ == "__main__": + sys.exit(subprocess.run(sys.argv[1:]).returncode) diff --git a/test cases/unit/71 cross test passed/src/main.c b/test cases/unit/71 cross test passed/src/main.c new file mode 100644 index 000000000..490b4a619 --- /dev/null +++ b/test cases/unit/71 cross test passed/src/main.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char const *argv[]) +{ + return 0; +} diff --git a/test cases/unit/71 cross/crossfile.in b/test cases/unit/71 cross/crossfile.in deleted file mode 100644 index 678e8d3a3..000000000 --- a/test cases/unit/71 cross/crossfile.in +++ /dev/null @@ -1,5 +0,0 @@ -[host_machine] -system = '@system@' -cpu_family = '@cpu_family@' -cpu = '@cpu@' -endian = '@endian@' diff --git a/test cases/unit/71 cross/meson.build b/test cases/unit/71 cross/meson.build deleted file mode 100644 index 6c85cf73b..000000000 --- a/test cases/unit/71 cross/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('crosstest') - -if get_option('generate') - conf_data = configuration_data() - conf_data.set('system', build_machine.system()) - conf_data.set('cpu', build_machine.cpu()) - conf_data.set('cpu_family', build_machine.cpu_family()) - conf_data.set('endian', build_machine.endian()) - - configure_file(input: 'crossfile.in', - output: 'crossfile', - configuration: conf_data) - message('Written cross file') -else - assert(meson.is_cross_build(), 'not setup as cross build') -endif diff --git a/test cases/unit/71 cross/meson_options.txt b/test cases/unit/71 cross/meson_options.txt deleted file mode 100644 index 5896d63c8..000000000 --- a/test cases/unit/71 cross/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('generate', type : 'boolean', value : false) diff --git a/test cases/unit/72 cross test passed/exewrapper.py b/test cases/unit/72 cross test passed/exewrapper.py deleted file mode 100755 index 2c15ed6f3..000000000 --- a/test cases/unit/72 cross test passed/exewrapper.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 -# Test that the MESON_EXE_WRAPPER environment variable is set - -import argparse -import os -import sys - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('binary') # unused, but needed for test behavior - parser.add_argument('--expected', action='store_true') - args = parser.parse_args() - - defined = 'MESON_EXE_WRAPPER' in os.environ - - if args.expected != defined: - print(os.environ, file=sys.stderr) - return 1 - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/test cases/unit/72 cross test passed/meson.build b/test cases/unit/72 cross test passed/meson.build deleted file mode 100644 index 4deb74baf..000000000 --- a/test cases/unit/72 cross test passed/meson.build +++ /dev/null @@ -1,19 +0,0 @@ -project( - 'cross test passed', - 'c', - version : '>= 0.51' -) - -e = executable('exec', 'src/main.c') - -py = import('python').find_installation() - -test('root', e) -test('main', py, args : [meson.current_source_dir() / 'script.py', e]) - -wrapper_args = [] -if get_option('expect') - wrapper_args += '--expected' -endif - -test('exe_wrapper in env', py, args : [meson.current_source_dir() / 'exewrapper.py', e, wrapper_args]) diff --git a/test cases/unit/72 cross test passed/meson_options.txt b/test cases/unit/72 cross test passed/meson_options.txt deleted file mode 100644 index 084c77625..000000000 --- a/test cases/unit/72 cross test passed/meson_options.txt +++ /dev/null @@ -1,5 +0,0 @@ -option( - 'expect', - type : 'boolean', - value : false, -) diff --git a/test cases/unit/72 cross test passed/script.py b/test cases/unit/72 cross test passed/script.py deleted file mode 100644 index 257cd30d8..000000000 --- a/test cases/unit/72 cross test passed/script.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 - -import subprocess -import sys - -if __name__ == "__main__": - sys.exit(subprocess.run(sys.argv[1:]).returncode) diff --git a/test cases/unit/72 cross test passed/src/main.c b/test cases/unit/72 cross test passed/src/main.c deleted file mode 100644 index 490b4a619..000000000 --- a/test cases/unit/72 cross test passed/src/main.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char const *argv[]) -{ - return 0; -} diff --git a/test cases/unit/72 summary/meson.build b/test cases/unit/72 summary/meson.build new file mode 100644 index 000000000..4205d6fff --- /dev/null +++ b/test cases/unit/72 summary/meson.build @@ -0,0 +1,22 @@ +project('My Project', version : '1.0') + +subproject('sub') +subproject('sub2', required : false) + +summary({'Some boolean': false, + 'Another boolean': true, + 'Some string': 'Hello World', + 'A list': ['string', 1, true], + 'empty list': [], + 'enabled_opt': get_option('enabled_opt'), + }, section: 'Configuration') +summary({'missing prog': find_program('xyzzy', required: false), + 'existing prog': import('python').find_installation(), + 'missing dep': dependency('', required: false), + 'internal dep': declare_dependency(), + }, section: 'Stuff') +summary('A number', 1, section: 'Configuration') +summary('yes', true, bool_yn : true, section: 'Configuration') +summary('no', false, bool_yn : true, section: 'Configuration') +summary('coma list', ['a', 'b', 'c'], list_sep: ', ', section: 'Configuration') +summary('long coma list', ['alpha', 'alphacolor', 'apetag', 'audiofx', 'audioparsers', 'auparse', 'autodetect', 'avi'], list_sep: ', ', section: 'Plugins') diff --git a/test cases/unit/72 summary/meson_options.txt b/test cases/unit/72 summary/meson_options.txt new file mode 100644 index 000000000..f2c41f8fb --- /dev/null +++ b/test cases/unit/72 summary/meson_options.txt @@ -0,0 +1 @@ +option('enabled_opt', type: 'feature', value: 'enabled') diff --git a/test cases/unit/72 summary/subprojects/sub/meson.build b/test cases/unit/72 summary/subprojects/sub/meson.build new file mode 100644 index 000000000..e7d783384 --- /dev/null +++ b/test cases/unit/72 summary/subprojects/sub/meson.build @@ -0,0 +1,4 @@ +project('Some Subproject', version : '2.0') + +summary('string', 'bar') +summary({'integer': 1, 'boolean': true}) diff --git a/test cases/unit/72 summary/subprojects/sub2/meson.build b/test cases/unit/72 summary/subprojects/sub2/meson.build new file mode 100644 index 000000000..86b9cfd85 --- /dev/null +++ b/test cases/unit/72 summary/subprojects/sub2/meson.build @@ -0,0 +1,5 @@ +project('sub2') + +error('This subproject failed') + +summary('Section', 'Should not be seen') diff --git a/test cases/unit/73 summary/meson.build b/test cases/unit/73 summary/meson.build deleted file mode 100644 index 4205d6fff..000000000 --- a/test cases/unit/73 summary/meson.build +++ /dev/null @@ -1,22 +0,0 @@ -project('My Project', version : '1.0') - -subproject('sub') -subproject('sub2', required : false) - -summary({'Some boolean': false, - 'Another boolean': true, - 'Some string': 'Hello World', - 'A list': ['string', 1, true], - 'empty list': [], - 'enabled_opt': get_option('enabled_opt'), - }, section: 'Configuration') -summary({'missing prog': find_program('xyzzy', required: false), - 'existing prog': import('python').find_installation(), - 'missing dep': dependency('', required: false), - 'internal dep': declare_dependency(), - }, section: 'Stuff') -summary('A number', 1, section: 'Configuration') -summary('yes', true, bool_yn : true, section: 'Configuration') -summary('no', false, bool_yn : true, section: 'Configuration') -summary('coma list', ['a', 'b', 'c'], list_sep: ', ', section: 'Configuration') -summary('long coma list', ['alpha', 'alphacolor', 'apetag', 'audiofx', 'audioparsers', 'auparse', 'autodetect', 'avi'], list_sep: ', ', section: 'Plugins') diff --git a/test cases/unit/73 summary/meson_options.txt b/test cases/unit/73 summary/meson_options.txt deleted file mode 100644 index f2c41f8fb..000000000 --- a/test cases/unit/73 summary/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('enabled_opt', type: 'feature', value: 'enabled') diff --git a/test cases/unit/73 summary/subprojects/sub/meson.build b/test cases/unit/73 summary/subprojects/sub/meson.build deleted file mode 100644 index e7d783384..000000000 --- a/test cases/unit/73 summary/subprojects/sub/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('Some Subproject', version : '2.0') - -summary('string', 'bar') -summary({'integer': 1, 'boolean': true}) diff --git a/test cases/unit/73 summary/subprojects/sub2/meson.build b/test cases/unit/73 summary/subprojects/sub2/meson.build deleted file mode 100644 index 86b9cfd85..000000000 --- a/test cases/unit/73 summary/subprojects/sub2/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('sub2') - -error('This subproject failed') - -summary('Section', 'Should not be seen') diff --git a/test cases/unit/73 wrap file url/meson.build b/test cases/unit/73 wrap file url/meson.build new file mode 100644 index 000000000..3bd3b250f --- /dev/null +++ b/test cases/unit/73 wrap file url/meson.build @@ -0,0 +1,4 @@ +project('test wrap with file url') + +exe = subproject('foo').get_variable('foo_exe') +test('test1', exe) diff --git a/test cases/unit/73 wrap file url/subprojects/foo-patch.tar.xz b/test cases/unit/73 wrap file url/subprojects/foo-patch.tar.xz new file mode 100644 index 000000000..fdb026ca7 Binary files /dev/null and b/test cases/unit/73 wrap file url/subprojects/foo-patch.tar.xz differ diff --git a/test cases/unit/73 wrap file url/subprojects/foo.tar.xz b/test cases/unit/73 wrap file url/subprojects/foo.tar.xz new file mode 100644 index 000000000..2ed6ab475 Binary files /dev/null and b/test cases/unit/73 wrap file url/subprojects/foo.tar.xz differ diff --git a/test cases/unit/74 dep files/foo.c b/test cases/unit/74 dep files/foo.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/74 dep files/meson.build b/test cases/unit/74 dep files/meson.build new file mode 100644 index 000000000..4829f563f --- /dev/null +++ b/test cases/unit/74 dep files/meson.build @@ -0,0 +1,16 @@ +project('test', 'c') + +python = import('python').find_installation() + +lib = library('foo', 'foo.c') + +# The library does not yet exist but we can already use its path during +# configuration. This should not trigger a reconfigure when the library is +# rebuilt. +configure_file( + output: 'out.txt', + capture: true, + command: [python, '-c', 'import sys; print(sys.argv[1])', lib.full_path()], +) + +message('Project configured') diff --git a/test cases/unit/74 wrap file url/meson.build b/test cases/unit/74 wrap file url/meson.build deleted file mode 100644 index 3bd3b250f..000000000 --- a/test cases/unit/74 wrap file url/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('test wrap with file url') - -exe = subproject('foo').get_variable('foo_exe') -test('test1', exe) diff --git a/test cases/unit/74 wrap file url/subprojects/foo-patch.tar.xz b/test cases/unit/74 wrap file url/subprojects/foo-patch.tar.xz deleted file mode 100644 index fdb026ca7..000000000 Binary files a/test cases/unit/74 wrap file url/subprojects/foo-patch.tar.xz and /dev/null differ diff --git a/test cases/unit/74 wrap file url/subprojects/foo.tar.xz b/test cases/unit/74 wrap file url/subprojects/foo.tar.xz deleted file mode 100644 index 2ed6ab475..000000000 Binary files a/test cases/unit/74 wrap file url/subprojects/foo.tar.xz and /dev/null differ diff --git a/test cases/unit/75 dep files/foo.c b/test cases/unit/75 dep files/foo.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/75 dep files/meson.build b/test cases/unit/75 dep files/meson.build deleted file mode 100644 index 4829f563f..000000000 --- a/test cases/unit/75 dep files/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('test', 'c') - -python = import('python').find_installation() - -lib = library('foo', 'foo.c') - -# The library does not yet exist but we can already use its path during -# configuration. This should not trigger a reconfigure when the library is -# rebuilt. -configure_file( - output: 'out.txt', - capture: true, - command: [python, '-c', 'import sys; print(sys.argv[1])', lib.full_path()], -) - -message('Project configured') diff --git a/test cases/unit/75 pkgconfig prefixes/client/client.c b/test cases/unit/75 pkgconfig prefixes/client/client.c new file mode 100644 index 000000000..be9beadb0 --- /dev/null +++ b/test cases/unit/75 pkgconfig prefixes/client/client.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) +{ + printf("%d\n", val2()); + return 0; +} diff --git a/test cases/unit/75 pkgconfig prefixes/client/meson.build b/test cases/unit/75 pkgconfig prefixes/client/meson.build new file mode 100644 index 000000000..491937b7b --- /dev/null +++ b/test cases/unit/75 pkgconfig prefixes/client/meson.build @@ -0,0 +1,3 @@ +project('client', 'c') +val2_dep = dependency('val2') +executable('client', 'client.c', dependencies : [val2_dep], install: true) diff --git a/test cases/unit/75 pkgconfig prefixes/val1/meson.build b/test cases/unit/75 pkgconfig prefixes/val1/meson.build new file mode 100644 index 000000000..cc63e3143 --- /dev/null +++ b/test cases/unit/75 pkgconfig prefixes/val1/meson.build @@ -0,0 +1,5 @@ +project('val1', 'c') +val1 = shared_library('val1', 'val1.c', install: true) +install_headers('val1.h') +pkgconfig = import('pkgconfig') +pkgconfig.generate(val1, libraries : ['-Wl,-rpath,${libdir}']) diff --git a/test cases/unit/75 pkgconfig prefixes/val1/val1.c b/test cases/unit/75 pkgconfig prefixes/val1/val1.c new file mode 100644 index 000000000..591e52162 --- /dev/null +++ b/test cases/unit/75 pkgconfig prefixes/val1/val1.c @@ -0,0 +1,3 @@ +#include "val1.h" + +int val1(void) { return 1; } diff --git a/test cases/unit/75 pkgconfig prefixes/val1/val1.h b/test cases/unit/75 pkgconfig prefixes/val1/val1.h new file mode 100644 index 000000000..6bd435eb9 --- /dev/null +++ b/test cases/unit/75 pkgconfig prefixes/val1/val1.h @@ -0,0 +1 @@ +int val1(void); diff --git a/test cases/unit/75 pkgconfig prefixes/val2/meson.build b/test cases/unit/75 pkgconfig prefixes/val2/meson.build new file mode 100644 index 000000000..ce69481ec --- /dev/null +++ b/test cases/unit/75 pkgconfig prefixes/val2/meson.build @@ -0,0 +1,8 @@ +project('val2', 'c') +val1_dep = dependency('val1') +val2 = shared_library('val2', 'val2.c', + dependencies : [val1_dep], + install: true) +install_headers('val2.h') +pkgconfig = import('pkgconfig') +pkgconfig.generate(val2, libraries : ['-Wl,-rpath,${libdir}']) diff --git a/test cases/unit/75 pkgconfig prefixes/val2/val2.c b/test cases/unit/75 pkgconfig prefixes/val2/val2.c new file mode 100644 index 000000000..d7d485730 --- /dev/null +++ b/test cases/unit/75 pkgconfig prefixes/val2/val2.c @@ -0,0 +1,4 @@ +#include "val1.h" +#include "val2.h" + +int val2(void) { return val1() + 2; } diff --git a/test cases/unit/75 pkgconfig prefixes/val2/val2.h b/test cases/unit/75 pkgconfig prefixes/val2/val2.h new file mode 100644 index 000000000..995023da2 --- /dev/null +++ b/test cases/unit/75 pkgconfig prefixes/val2/val2.h @@ -0,0 +1 @@ +int val2(void); diff --git a/test cases/unit/76 pkgconfig prefixes/client/client.c b/test cases/unit/76 pkgconfig prefixes/client/client.c deleted file mode 100644 index be9beadb0..000000000 --- a/test cases/unit/76 pkgconfig prefixes/client/client.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main(int argc, char **argv) -{ - printf("%d\n", val2()); - return 0; -} diff --git a/test cases/unit/76 pkgconfig prefixes/client/meson.build b/test cases/unit/76 pkgconfig prefixes/client/meson.build deleted file mode 100644 index 491937b7b..000000000 --- a/test cases/unit/76 pkgconfig prefixes/client/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('client', 'c') -val2_dep = dependency('val2') -executable('client', 'client.c', dependencies : [val2_dep], install: true) diff --git a/test cases/unit/76 pkgconfig prefixes/val1/meson.build b/test cases/unit/76 pkgconfig prefixes/val1/meson.build deleted file mode 100644 index cc63e3143..000000000 --- a/test cases/unit/76 pkgconfig prefixes/val1/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('val1', 'c') -val1 = shared_library('val1', 'val1.c', install: true) -install_headers('val1.h') -pkgconfig = import('pkgconfig') -pkgconfig.generate(val1, libraries : ['-Wl,-rpath,${libdir}']) diff --git a/test cases/unit/76 pkgconfig prefixes/val1/val1.c b/test cases/unit/76 pkgconfig prefixes/val1/val1.c deleted file mode 100644 index 591e52162..000000000 --- a/test cases/unit/76 pkgconfig prefixes/val1/val1.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "val1.h" - -int val1(void) { return 1; } diff --git a/test cases/unit/76 pkgconfig prefixes/val1/val1.h b/test cases/unit/76 pkgconfig prefixes/val1/val1.h deleted file mode 100644 index 6bd435eb9..000000000 --- a/test cases/unit/76 pkgconfig prefixes/val1/val1.h +++ /dev/null @@ -1 +0,0 @@ -int val1(void); diff --git a/test cases/unit/76 pkgconfig prefixes/val2/meson.build b/test cases/unit/76 pkgconfig prefixes/val2/meson.build deleted file mode 100644 index ce69481ec..000000000 --- a/test cases/unit/76 pkgconfig prefixes/val2/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -project('val2', 'c') -val1_dep = dependency('val1') -val2 = shared_library('val2', 'val2.c', - dependencies : [val1_dep], - install: true) -install_headers('val2.h') -pkgconfig = import('pkgconfig') -pkgconfig.generate(val2, libraries : ['-Wl,-rpath,${libdir}']) diff --git a/test cases/unit/76 pkgconfig prefixes/val2/val2.c b/test cases/unit/76 pkgconfig prefixes/val2/val2.c deleted file mode 100644 index d7d485730..000000000 --- a/test cases/unit/76 pkgconfig prefixes/val2/val2.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "val1.h" -#include "val2.h" - -int val2(void) { return val1() + 2; } diff --git a/test cases/unit/76 pkgconfig prefixes/val2/val2.h b/test cases/unit/76 pkgconfig prefixes/val2/val2.h deleted file mode 100644 index 995023da2..000000000 --- a/test cases/unit/76 pkgconfig prefixes/val2/val2.h +++ /dev/null @@ -1 +0,0 @@ -int val2(void); diff --git a/test cases/unit/76 subdir libdir/meson.build b/test cases/unit/76 subdir libdir/meson.build new file mode 100644 index 000000000..5099c91c7 --- /dev/null +++ b/test cases/unit/76 subdir libdir/meson.build @@ -0,0 +1,2 @@ +project('toplevel', 'c') +subproject('flub') diff --git a/test cases/unit/76 subdir libdir/subprojects/flub/meson.build b/test cases/unit/76 subdir libdir/subprojects/flub/meson.build new file mode 100644 index 000000000..7bfd2c553 --- /dev/null +++ b/test cases/unit/76 subdir libdir/subprojects/flub/meson.build @@ -0,0 +1 @@ +project('subflub', 'c') diff --git a/test cases/unit/77 as link whole/bar.c b/test cases/unit/77 as link whole/bar.c new file mode 100644 index 000000000..79dea9d0f --- /dev/null +++ b/test cases/unit/77 as link whole/bar.c @@ -0,0 +1,6 @@ +int bar(void); + +int bar(void) +{ + return 0; +} diff --git a/test cases/unit/77 as link whole/foo.c b/test cases/unit/77 as link whole/foo.c new file mode 100644 index 000000000..ffeee82fe --- /dev/null +++ b/test cases/unit/77 as link whole/foo.c @@ -0,0 +1,6 @@ +int foo(void); + +int foo(void) +{ + return 0; +} diff --git a/test cases/unit/77 as link whole/meson.build b/test cases/unit/77 as link whole/meson.build new file mode 100644 index 000000000..6bc208f1b --- /dev/null +++ b/test cases/unit/77 as link whole/meson.build @@ -0,0 +1,11 @@ +project('as-link-whole', 'c') + +foo = static_library('foo', 'foo.c', install: true) +dep = declare_dependency(link_with: foo) +bar1 = library('bar1', 'bar.c', dependencies: dep) +bar2 = library('bar2', 'bar.c', dependencies: dep.as_link_whole()) + +# bar1.pc should have -lfoo but not bar2.pc +pkg = import('pkgconfig') +pkg.generate(bar1) +pkg.generate(bar2) diff --git a/test cases/unit/77 subdir libdir/meson.build b/test cases/unit/77 subdir libdir/meson.build deleted file mode 100644 index 5099c91c7..000000000 --- a/test cases/unit/77 subdir libdir/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('toplevel', 'c') -subproject('flub') diff --git a/test cases/unit/77 subdir libdir/subprojects/flub/meson.build b/test cases/unit/77 subdir libdir/subprojects/flub/meson.build deleted file mode 100644 index 7bfd2c553..000000000 --- a/test cases/unit/77 subdir libdir/subprojects/flub/meson.build +++ /dev/null @@ -1 +0,0 @@ -project('subflub', 'c') diff --git a/test cases/unit/78 as link whole/bar.c b/test cases/unit/78 as link whole/bar.c deleted file mode 100644 index 79dea9d0f..000000000 --- a/test cases/unit/78 as link whole/bar.c +++ /dev/null @@ -1,6 +0,0 @@ -int bar(void); - -int bar(void) -{ - return 0; -} diff --git a/test cases/unit/78 as link whole/foo.c b/test cases/unit/78 as link whole/foo.c deleted file mode 100644 index ffeee82fe..000000000 --- a/test cases/unit/78 as link whole/foo.c +++ /dev/null @@ -1,6 +0,0 @@ -int foo(void); - -int foo(void) -{ - return 0; -} diff --git a/test cases/unit/78 as link whole/meson.build b/test cases/unit/78 as link whole/meson.build deleted file mode 100644 index 6bc208f1b..000000000 --- a/test cases/unit/78 as link whole/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -project('as-link-whole', 'c') - -foo = static_library('foo', 'foo.c', install: true) -dep = declare_dependency(link_with: foo) -bar1 = library('bar1', 'bar.c', dependencies: dep) -bar2 = library('bar2', 'bar.c', dependencies: dep.as_link_whole()) - -# bar1.pc should have -lfoo but not bar2.pc -pkg = import('pkgconfig') -pkg.generate(bar1) -pkg.generate(bar2) diff --git a/test cases/unit/78 nostdlib/meson.build b/test cases/unit/78 nostdlib/meson.build new file mode 100644 index 000000000..9c5f949b2 --- /dev/null +++ b/test cases/unit/78 nostdlib/meson.build @@ -0,0 +1,14 @@ +project('own libc', 'c') + +# Not related to this test, but could not find a better place for this test. +assert(meson.get_cross_property('nonexisting', 'defaultvalue') == 'defaultvalue', + 'Cross prop getting is broken.') + +# A simple project that uses its own libc. + +# Note that we don't need to specify anything, the flags to use +# stdlib come from the cross file. + +exe = executable('selfcontained', 'prog.c') + +test('standalone test', exe) diff --git a/test cases/unit/78 nostdlib/prog.c b/test cases/unit/78 nostdlib/prog.c new file mode 100644 index 000000000..b9216ee81 --- /dev/null +++ b/test cases/unit/78 nostdlib/prog.c @@ -0,0 +1,7 @@ + +#include + +int main(void) { + const char *message = "Hello without stdlib.\n"; + return simple_print(message, simple_strlen(message)); +} diff --git a/test cases/unit/78 nostdlib/subprojects/mylibc/libc.c b/test cases/unit/78 nostdlib/subprojects/mylibc/libc.c new file mode 100644 index 000000000..67261cb1d --- /dev/null +++ b/test cases/unit/78 nostdlib/subprojects/mylibc/libc.c @@ -0,0 +1,35 @@ +/* Do not use this as the basis of your own libc. + * The code is probably unoptimal or wonky, as I + * had no prior experience with this, but instead + * just fiddled with the code until it worked. + */ + +#include + +#define STDOUT 1 +#define SYS_WRITE 4 + +int simple_print(const char *msg, const long bufsize) { + int count; + long total_written = 0; + while(total_written < bufsize) { + asm( + "int $0x80\n\t" + : "=a"(count) + : "0"(SYS_WRITE), "b"(STDOUT), "c"(msg+total_written), "d"(bufsize-total_written) + :); + if(count == 0) { + return 1; + } + total_written += count; + } + return 0; +} + +int simple_strlen(const char *str) { + int len = 0; + while(str[len] != '\0') { + len++; + } + return len; +} diff --git a/test cases/unit/78 nostdlib/subprojects/mylibc/meson.build b/test cases/unit/78 nostdlib/subprojects/mylibc/meson.build new file mode 100644 index 000000000..ff4bdb20f --- /dev/null +++ b/test cases/unit/78 nostdlib/subprojects/mylibc/meson.build @@ -0,0 +1,13 @@ +project('own libc', 'c') + +# A very simple libc implementation + +# Do not specify -nostdlib & co. They come from cross specifications. + +libc = static_library('c', 'libc.c', 'stubstart.s') + +mylibc_dep = declare_dependency(link_with : libc, + include_directories : include_directories('.') +) + +meson.override_dependency('c_stdlib', mylibc_dep) diff --git a/test cases/unit/78 nostdlib/subprojects/mylibc/stdio.h b/test cases/unit/78 nostdlib/subprojects/mylibc/stdio.h new file mode 100644 index 000000000..c3f8f56ca --- /dev/null +++ b/test cases/unit/78 nostdlib/subprojects/mylibc/stdio.h @@ -0,0 +1,5 @@ +#pragma once + +int simple_print(const char *msg, const long bufsize); + +int simple_strlen(const char *str); diff --git a/test cases/unit/78 nostdlib/subprojects/mylibc/stubstart.s b/test cases/unit/78 nostdlib/subprojects/mylibc/stubstart.s new file mode 100644 index 000000000..0a6d9729a --- /dev/null +++ b/test cases/unit/78 nostdlib/subprojects/mylibc/stubstart.s @@ -0,0 +1,8 @@ +.globl _start + +_start: + + call main + movl %eax, %ebx + movl $1, %eax + int $0x80 diff --git a/test cases/unit/79 nostdlib/meson.build b/test cases/unit/79 nostdlib/meson.build deleted file mode 100644 index 9c5f949b2..000000000 --- a/test cases/unit/79 nostdlib/meson.build +++ /dev/null @@ -1,14 +0,0 @@ -project('own libc', 'c') - -# Not related to this test, but could not find a better place for this test. -assert(meson.get_cross_property('nonexisting', 'defaultvalue') == 'defaultvalue', - 'Cross prop getting is broken.') - -# A simple project that uses its own libc. - -# Note that we don't need to specify anything, the flags to use -# stdlib come from the cross file. - -exe = executable('selfcontained', 'prog.c') - -test('standalone test', exe) diff --git a/test cases/unit/79 nostdlib/prog.c b/test cases/unit/79 nostdlib/prog.c deleted file mode 100644 index b9216ee81..000000000 --- a/test cases/unit/79 nostdlib/prog.c +++ /dev/null @@ -1,7 +0,0 @@ - -#include - -int main(void) { - const char *message = "Hello without stdlib.\n"; - return simple_print(message, simple_strlen(message)); -} diff --git a/test cases/unit/79 nostdlib/subprojects/mylibc/libc.c b/test cases/unit/79 nostdlib/subprojects/mylibc/libc.c deleted file mode 100644 index 67261cb1d..000000000 --- a/test cases/unit/79 nostdlib/subprojects/mylibc/libc.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Do not use this as the basis of your own libc. - * The code is probably unoptimal or wonky, as I - * had no prior experience with this, but instead - * just fiddled with the code until it worked. - */ - -#include - -#define STDOUT 1 -#define SYS_WRITE 4 - -int simple_print(const char *msg, const long bufsize) { - int count; - long total_written = 0; - while(total_written < bufsize) { - asm( - "int $0x80\n\t" - : "=a"(count) - : "0"(SYS_WRITE), "b"(STDOUT), "c"(msg+total_written), "d"(bufsize-total_written) - :); - if(count == 0) { - return 1; - } - total_written += count; - } - return 0; -} - -int simple_strlen(const char *str) { - int len = 0; - while(str[len] != '\0') { - len++; - } - return len; -} diff --git a/test cases/unit/79 nostdlib/subprojects/mylibc/meson.build b/test cases/unit/79 nostdlib/subprojects/mylibc/meson.build deleted file mode 100644 index ff4bdb20f..000000000 --- a/test cases/unit/79 nostdlib/subprojects/mylibc/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -project('own libc', 'c') - -# A very simple libc implementation - -# Do not specify -nostdlib & co. They come from cross specifications. - -libc = static_library('c', 'libc.c', 'stubstart.s') - -mylibc_dep = declare_dependency(link_with : libc, - include_directories : include_directories('.') -) - -meson.override_dependency('c_stdlib', mylibc_dep) diff --git a/test cases/unit/79 nostdlib/subprojects/mylibc/stdio.h b/test cases/unit/79 nostdlib/subprojects/mylibc/stdio.h deleted file mode 100644 index c3f8f56ca..000000000 --- a/test cases/unit/79 nostdlib/subprojects/mylibc/stdio.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -int simple_print(const char *msg, const long bufsize); - -int simple_strlen(const char *str); diff --git a/test cases/unit/79 nostdlib/subprojects/mylibc/stubstart.s b/test cases/unit/79 nostdlib/subprojects/mylibc/stubstart.s deleted file mode 100644 index 0a6d9729a..000000000 --- a/test cases/unit/79 nostdlib/subprojects/mylibc/stubstart.s +++ /dev/null @@ -1,8 +0,0 @@ -.globl _start - -_start: - - call main - movl %eax, %ebx - movl $1, %eax - int $0x80 diff --git a/test cases/unit/79 user options for subproject/.gitignore b/test cases/unit/79 user options for subproject/.gitignore new file mode 100644 index 000000000..0bec5eac1 --- /dev/null +++ b/test cases/unit/79 user options for subproject/.gitignore @@ -0,0 +1 @@ +/subprojects diff --git a/test cases/unit/79 user options for subproject/75 user options for subproject/.gitignore b/test cases/unit/79 user options for subproject/75 user options for subproject/.gitignore new file mode 100644 index 000000000..4976afc58 --- /dev/null +++ b/test cases/unit/79 user options for subproject/75 user options for subproject/.gitignore @@ -0,0 +1 @@ +subprojects/* diff --git a/test cases/unit/79 user options for subproject/75 user options for subproject/meson.build b/test cases/unit/79 user options for subproject/75 user options for subproject/meson.build new file mode 100644 index 000000000..0bc395b4b --- /dev/null +++ b/test cases/unit/79 user options for subproject/75 user options for subproject/meson.build @@ -0,0 +1,3 @@ +project('user option for subproject') + +p = subproject('sub') diff --git a/test cases/unit/80 global-rpath/meson.build b/test cases/unit/80 global-rpath/meson.build new file mode 100644 index 000000000..c67d9e08b --- /dev/null +++ b/test cases/unit/80 global-rpath/meson.build @@ -0,0 +1,3 @@ +project('global-rpath', 'cpp') +yonder_dep = dependency('yonder') +executable('rpathified', 'rpathified.cpp', dependencies: [yonder_dep], install: true) diff --git a/test cases/unit/80 global-rpath/rpathified.cpp b/test cases/unit/80 global-rpath/rpathified.cpp new file mode 100644 index 000000000..3788906dc --- /dev/null +++ b/test cases/unit/80 global-rpath/rpathified.cpp @@ -0,0 +1,6 @@ +#include +#include +int main(int argc, char **argv) +{ + return strcmp(yonder(), "AB54 6BR"); +} diff --git a/test cases/unit/80 global-rpath/yonder/meson.build b/test cases/unit/80 global-rpath/yonder/meson.build new file mode 100644 index 000000000..e32f38330 --- /dev/null +++ b/test cases/unit/80 global-rpath/yonder/meson.build @@ -0,0 +1,5 @@ +project('yonder', 'cpp') +yonder = shared_library('yonder', 'yonder.cpp', install: true) +install_headers('yonder.h') +pkgconfig = import('pkgconfig') +pkgconfig.generate(yonder) diff --git a/test cases/unit/80 global-rpath/yonder/yonder.cpp b/test cases/unit/80 global-rpath/yonder/yonder.cpp new file mode 100644 index 000000000..b182d34e3 --- /dev/null +++ b/test cases/unit/80 global-rpath/yonder/yonder.cpp @@ -0,0 +1,3 @@ +#include "yonder.h" + +char *yonder(void) { return "AB54 6BR"; } diff --git a/test cases/unit/80 global-rpath/yonder/yonder.h b/test cases/unit/80 global-rpath/yonder/yonder.h new file mode 100644 index 000000000..9d9ad1617 --- /dev/null +++ b/test cases/unit/80 global-rpath/yonder/yonder.h @@ -0,0 +1 @@ +char *yonder(void); diff --git a/test cases/unit/80 user options for subproject/.gitignore b/test cases/unit/80 user options for subproject/.gitignore deleted file mode 100644 index 0bec5eac1..000000000 --- a/test cases/unit/80 user options for subproject/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/subprojects diff --git a/test cases/unit/80 user options for subproject/75 user options for subproject/.gitignore b/test cases/unit/80 user options for subproject/75 user options for subproject/.gitignore deleted file mode 100644 index 4976afc58..000000000 --- a/test cases/unit/80 user options for subproject/75 user options for subproject/.gitignore +++ /dev/null @@ -1 +0,0 @@ -subprojects/* diff --git a/test cases/unit/80 user options for subproject/75 user options for subproject/meson.build b/test cases/unit/80 user options for subproject/75 user options for subproject/meson.build deleted file mode 100644 index 0bc395b4b..000000000 --- a/test cases/unit/80 user options for subproject/75 user options for subproject/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('user option for subproject') - -p = subproject('sub') diff --git a/test cases/unit/81 global-rpath/meson.build b/test cases/unit/81 global-rpath/meson.build deleted file mode 100644 index c67d9e08b..000000000 --- a/test cases/unit/81 global-rpath/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('global-rpath', 'cpp') -yonder_dep = dependency('yonder') -executable('rpathified', 'rpathified.cpp', dependencies: [yonder_dep], install: true) diff --git a/test cases/unit/81 global-rpath/rpathified.cpp b/test cases/unit/81 global-rpath/rpathified.cpp deleted file mode 100644 index 3788906dc..000000000 --- a/test cases/unit/81 global-rpath/rpathified.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include -int main(int argc, char **argv) -{ - return strcmp(yonder(), "AB54 6BR"); -} diff --git a/test cases/unit/81 global-rpath/yonder/meson.build b/test cases/unit/81 global-rpath/yonder/meson.build deleted file mode 100644 index e32f38330..000000000 --- a/test cases/unit/81 global-rpath/yonder/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -project('yonder', 'cpp') -yonder = shared_library('yonder', 'yonder.cpp', install: true) -install_headers('yonder.h') -pkgconfig = import('pkgconfig') -pkgconfig.generate(yonder) diff --git a/test cases/unit/81 global-rpath/yonder/yonder.cpp b/test cases/unit/81 global-rpath/yonder/yonder.cpp deleted file mode 100644 index b182d34e3..000000000 --- a/test cases/unit/81 global-rpath/yonder/yonder.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "yonder.h" - -char *yonder(void) { return "AB54 6BR"; } diff --git a/test cases/unit/81 global-rpath/yonder/yonder.h b/test cases/unit/81 global-rpath/yonder/yonder.h deleted file mode 100644 index 9d9ad1617..000000000 --- a/test cases/unit/81 global-rpath/yonder/yonder.h +++ /dev/null @@ -1 +0,0 @@ -char *yonder(void); diff --git a/test cases/unit/81 wrap-git/meson.build b/test cases/unit/81 wrap-git/meson.build new file mode 100644 index 000000000..b0af30a3f --- /dev/null +++ b/test cases/unit/81 wrap-git/meson.build @@ -0,0 +1,4 @@ +project('test-wrap-git') + +exe = subproject('wrap_git').get_variable('exe') +test('test1', exe) diff --git a/test cases/unit/81 wrap-git/subprojects/packagefiles/wrap_git_builddef/meson.build b/test cases/unit/81 wrap-git/subprojects/packagefiles/wrap_git_builddef/meson.build new file mode 100644 index 000000000..2570f7777 --- /dev/null +++ b/test cases/unit/81 wrap-git/subprojects/packagefiles/wrap_git_builddef/meson.build @@ -0,0 +1,3 @@ +project('foo', 'c') + +exe = executable('app', 'main.c') diff --git a/test cases/unit/81 wrap-git/subprojects/wrap_git_upstream/main.c b/test cases/unit/81 wrap-git/subprojects/wrap_git_upstream/main.c new file mode 100644 index 000000000..8488f4e58 --- /dev/null +++ b/test cases/unit/81 wrap-git/subprojects/wrap_git_upstream/main.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} diff --git a/test cases/unit/82 meson version compare/meson.build b/test cases/unit/82 meson version compare/meson.build new file mode 100644 index 000000000..ed69a8b48 --- /dev/null +++ b/test cases/unit/82 meson version compare/meson.build @@ -0,0 +1,17 @@ +project('version compare', meson_version: '>= 0.1') + +if meson.version().version_compare('>= 9999') + error('This should not be executed') +elif meson.version().version_compare('>= 0.55') and false + error('This should not be executed') +elif not meson.version().version_compare('>= 0.55') + error('This should not be executed') +elif meson.version().version_compare('>= 0.55') + # This Should not produce warning even when using function not available in + # meson 0.1. + foo_dep = declare_dependency() + meson.override_dependency('foo', foo_dep) +endif + +# This will error out if elif cause did not enter +assert(foo_dep.found(), 'meson.version_compare did not work') diff --git a/test cases/unit/82 wrap-git/meson.build b/test cases/unit/82 wrap-git/meson.build deleted file mode 100644 index b0af30a3f..000000000 --- a/test cases/unit/82 wrap-git/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('test-wrap-git') - -exe = subproject('wrap_git').get_variable('exe') -test('test1', exe) diff --git a/test cases/unit/82 wrap-git/subprojects/packagefiles/wrap_git_builddef/meson.build b/test cases/unit/82 wrap-git/subprojects/packagefiles/wrap_git_builddef/meson.build deleted file mode 100644 index 2570f7777..000000000 --- a/test cases/unit/82 wrap-git/subprojects/packagefiles/wrap_git_builddef/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -project('foo', 'c') - -exe = executable('app', 'main.c') diff --git a/test cases/unit/82 wrap-git/subprojects/wrap_git_upstream/main.c b/test cases/unit/82 wrap-git/subprojects/wrap_git_upstream/main.c deleted file mode 100644 index 8488f4e58..000000000 --- a/test cases/unit/82 wrap-git/subprojects/wrap_git_upstream/main.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(void) -{ - return 0; -} diff --git a/test cases/unit/83 cross only introspect/meson.build b/test cases/unit/83 cross only introspect/meson.build new file mode 100644 index 000000000..ed25441bf --- /dev/null +++ b/test cases/unit/83 cross only introspect/meson.build @@ -0,0 +1,2 @@ +project('cross only introspect') +add_languages('c', native: false) diff --git a/test cases/unit/83 meson version compare/meson.build b/test cases/unit/83 meson version compare/meson.build deleted file mode 100644 index ed69a8b48..000000000 --- a/test cases/unit/83 meson version compare/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -project('version compare', meson_version: '>= 0.1') - -if meson.version().version_compare('>= 9999') - error('This should not be executed') -elif meson.version().version_compare('>= 0.55') and false - error('This should not be executed') -elif not meson.version().version_compare('>= 0.55') - error('This should not be executed') -elif meson.version().version_compare('>= 0.55') - # This Should not produce warning even when using function not available in - # meson 0.1. - foo_dep = declare_dependency() - meson.override_dependency('foo', foo_dep) -endif - -# This will error out if elif cause did not enter -assert(foo_dep.found(), 'meson.version_compare did not work') diff --git a/test cases/unit/84 change option choices/meson.build b/test cases/unit/84 change option choices/meson.build new file mode 100644 index 000000000..d056d6594 --- /dev/null +++ b/test cases/unit/84 change option choices/meson.build @@ -0,0 +1 @@ +project('change option choices') diff --git a/test cases/unit/84 change option choices/meson_options.1.txt b/test cases/unit/84 change option choices/meson_options.1.txt new file mode 100644 index 000000000..d0326a55b --- /dev/null +++ b/test cases/unit/84 change option choices/meson_options.1.txt @@ -0,0 +1,13 @@ +option( + 'combo', + type : 'combo', + choices : ['a', 'b', 'c'], + value : 'a', +) + +option( + 'array', + type : 'array', + choices : ['a', 'b', 'c'], + value : ['a'], +) diff --git a/test cases/unit/84 change option choices/meson_options.2.txt b/test cases/unit/84 change option choices/meson_options.2.txt new file mode 100644 index 000000000..4684673e1 --- /dev/null +++ b/test cases/unit/84 change option choices/meson_options.2.txt @@ -0,0 +1,13 @@ +option( + 'combo', + type : 'combo', + choices : ['b', 'c', 'd'], + value : 'b', +) + +option( + 'array', + type : 'array', + choices : ['b', 'c', 'd'], + value : ['b'], +) diff --git a/test cases/unit/84 cross only introspect/meson.build b/test cases/unit/84 cross only introspect/meson.build deleted file mode 100644 index ed25441bf..000000000 --- a/test cases/unit/84 cross only introspect/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('cross only introspect') -add_languages('c', native: false) diff --git a/test cases/unit/85 change option choices/meson.build b/test cases/unit/85 change option choices/meson.build deleted file mode 100644 index d056d6594..000000000 --- a/test cases/unit/85 change option choices/meson.build +++ /dev/null @@ -1 +0,0 @@ -project('change option choices') diff --git a/test cases/unit/85 change option choices/meson_options.1.txt b/test cases/unit/85 change option choices/meson_options.1.txt deleted file mode 100644 index d0326a55b..000000000 --- a/test cases/unit/85 change option choices/meson_options.1.txt +++ /dev/null @@ -1,13 +0,0 @@ -option( - 'combo', - type : 'combo', - choices : ['a', 'b', 'c'], - value : 'a', -) - -option( - 'array', - type : 'array', - choices : ['a', 'b', 'c'], - value : ['a'], -) diff --git a/test cases/unit/85 change option choices/meson_options.2.txt b/test cases/unit/85 change option choices/meson_options.2.txt deleted file mode 100644 index 4684673e1..000000000 --- a/test cases/unit/85 change option choices/meson_options.2.txt +++ /dev/null @@ -1,13 +0,0 @@ -option( - 'combo', - type : 'combo', - choices : ['b', 'c', 'd'], - value : 'b', -) - -option( - 'array', - type : 'array', - choices : ['b', 'c', 'd'], - value : ['b'], -) diff --git a/test cases/unit/85 nested subproject regenerate depends/main.c b/test cases/unit/85 nested subproject regenerate depends/main.c new file mode 100644 index 000000000..9b6bdc2ec --- /dev/null +++ b/test cases/unit/85 nested subproject regenerate depends/main.c @@ -0,0 +1,3 @@ +int main(void) { + return 0; +} diff --git a/test cases/unit/85 nested subproject regenerate depends/meson.build b/test cases/unit/85 nested subproject regenerate depends/meson.build new file mode 100644 index 000000000..569888164 --- /dev/null +++ b/test cases/unit/85 nested subproject regenerate depends/meson.build @@ -0,0 +1,6 @@ +project('nested subproject regenerate depends', 'c') + +s = subproject('sub1') + +# This is needed to make msbuild noop check work correctly +executable('exe', 'main.c') diff --git a/test cases/unit/85 nested subproject regenerate depends/subprojects/sub1/meson.build b/test cases/unit/85 nested subproject regenerate depends/subprojects/sub1/meson.build new file mode 100644 index 000000000..a31db4ade --- /dev/null +++ b/test cases/unit/85 nested subproject regenerate depends/subprojects/sub1/meson.build @@ -0,0 +1,4 @@ +project('sub1') + +cmake = import('cmake') +cmake.subproject('sub2') diff --git a/test cases/unit/85 nested subproject regenerate depends/subprojects/sub2/CMakeLists.txt b/test cases/unit/85 nested subproject regenerate depends/subprojects/sub2/CMakeLists.txt new file mode 100644 index 000000000..f91473a6a --- /dev/null +++ b/test cases/unit/85 nested subproject regenerate depends/subprojects/sub2/CMakeLists.txt @@ -0,0 +1 @@ +project(sub2) diff --git a/test cases/unit/86 cpp modules/main.cpp b/test cases/unit/86 cpp modules/main.cpp new file mode 100644 index 000000000..d825c7d49 --- /dev/null +++ b/test cases/unit/86 cpp modules/main.cpp @@ -0,0 +1,7 @@ +import M0; +#include + +int main() { + printf("The value is %d", func0()); + return 0; +} diff --git a/test cases/unit/86 cpp modules/meson.build b/test cases/unit/86 cpp modules/meson.build new file mode 100644 index 000000000..cdc296f43 --- /dev/null +++ b/test cases/unit/86 cpp modules/meson.build @@ -0,0 +1,17 @@ +project('cppmodules', 'cpp', default_options: ['cpp_std=c++latest']) + +e = executable('modtest', + 'main.cpp', + 'src0.ixx', + 'src1.ixx', + 'src2.ixx', + 'src3.ixx', + 'src4.ixx', + 'src5.ixx', + 'src6.ixx', + 'src7.ixx', + 'src8.ixx', + 'src9.ixx', + ) + +test('modtest', e) diff --git a/test cases/unit/86 cpp modules/src0.ixx b/test cases/unit/86 cpp modules/src0.ixx new file mode 100644 index 000000000..3ca4d1448 --- /dev/null +++ b/test cases/unit/86 cpp modules/src0.ixx @@ -0,0 +1,7 @@ +export module M0; + +import M1; + +export int func0() { + return func1(); +} diff --git a/test cases/unit/86 cpp modules/src1.ixx b/test cases/unit/86 cpp modules/src1.ixx new file mode 100644 index 000000000..cea6696de --- /dev/null +++ b/test cases/unit/86 cpp modules/src1.ixx @@ -0,0 +1,7 @@ +export module M1; + +import M2; + +export int func1() { + return func2(); +} diff --git a/test cases/unit/86 cpp modules/src2.ixx b/test cases/unit/86 cpp modules/src2.ixx new file mode 100644 index 000000000..415714cc0 --- /dev/null +++ b/test cases/unit/86 cpp modules/src2.ixx @@ -0,0 +1,7 @@ +export module M2; + +import M3; + +export int func2() { + return func3(); +} diff --git a/test cases/unit/86 cpp modules/src3.ixx b/test cases/unit/86 cpp modules/src3.ixx new file mode 100644 index 000000000..96f135c00 --- /dev/null +++ b/test cases/unit/86 cpp modules/src3.ixx @@ -0,0 +1,7 @@ +export module M3; + +import M4; + +export int func3() { + return func4(); +} diff --git a/test cases/unit/86 cpp modules/src4.ixx b/test cases/unit/86 cpp modules/src4.ixx new file mode 100644 index 000000000..1ac1a6a64 --- /dev/null +++ b/test cases/unit/86 cpp modules/src4.ixx @@ -0,0 +1,7 @@ +export module M4; + +import M5; + +export int func4() { + return func5(); +} diff --git a/test cases/unit/86 cpp modules/src5.ixx b/test cases/unit/86 cpp modules/src5.ixx new file mode 100644 index 000000000..96cf70761 --- /dev/null +++ b/test cases/unit/86 cpp modules/src5.ixx @@ -0,0 +1,7 @@ +export module M5; + +import M6; + +export int func5() { + return func6(); +} diff --git a/test cases/unit/86 cpp modules/src6.ixx b/test cases/unit/86 cpp modules/src6.ixx new file mode 100644 index 000000000..760b71cbb --- /dev/null +++ b/test cases/unit/86 cpp modules/src6.ixx @@ -0,0 +1,7 @@ +export module M6; + +import M7; + +export int func6() { + return func7(); +} diff --git a/test cases/unit/86 cpp modules/src7.ixx b/test cases/unit/86 cpp modules/src7.ixx new file mode 100644 index 000000000..8ce660801 --- /dev/null +++ b/test cases/unit/86 cpp modules/src7.ixx @@ -0,0 +1,7 @@ +export module M7; + +import M8; + +export int func7() { + return func8(); +} diff --git a/test cases/unit/86 cpp modules/src8.ixx b/test cases/unit/86 cpp modules/src8.ixx new file mode 100644 index 000000000..6a3ef96f5 --- /dev/null +++ b/test cases/unit/86 cpp modules/src8.ixx @@ -0,0 +1,7 @@ +export module M8; + +import M9; + +export int func8() { + return func9(); +} diff --git a/test cases/unit/86 cpp modules/src9.ixx b/test cases/unit/86 cpp modules/src9.ixx new file mode 100644 index 000000000..3ecb3be68 --- /dev/null +++ b/test cases/unit/86 cpp modules/src9.ixx @@ -0,0 +1,5 @@ +export module M9; + +export int func9() { + return 42; +} diff --git a/test cases/unit/86 nested subproject regenerate depends/main.c b/test cases/unit/86 nested subproject regenerate depends/main.c deleted file mode 100644 index 9b6bdc2ec..000000000 --- a/test cases/unit/86 nested subproject regenerate depends/main.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(void) { - return 0; -} diff --git a/test cases/unit/86 nested subproject regenerate depends/meson.build b/test cases/unit/86 nested subproject regenerate depends/meson.build deleted file mode 100644 index 569888164..000000000 --- a/test cases/unit/86 nested subproject regenerate depends/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('nested subproject regenerate depends', 'c') - -s = subproject('sub1') - -# This is needed to make msbuild noop check work correctly -executable('exe', 'main.c') diff --git a/test cases/unit/86 nested subproject regenerate depends/subprojects/sub1/meson.build b/test cases/unit/86 nested subproject regenerate depends/subprojects/sub1/meson.build deleted file mode 100644 index a31db4ade..000000000 --- a/test cases/unit/86 nested subproject regenerate depends/subprojects/sub1/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('sub1') - -cmake = import('cmake') -cmake.subproject('sub2') diff --git a/test cases/unit/86 nested subproject regenerate depends/subprojects/sub2/CMakeLists.txt b/test cases/unit/86 nested subproject regenerate depends/subprojects/sub2/CMakeLists.txt deleted file mode 100644 index f91473a6a..000000000 --- a/test cases/unit/86 nested subproject regenerate depends/subprojects/sub2/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -project(sub2) diff --git a/test cases/unit/87 cpp modules/main.cpp b/test cases/unit/87 cpp modules/main.cpp deleted file mode 100644 index d825c7d49..000000000 --- a/test cases/unit/87 cpp modules/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -import M0; -#include - -int main() { - printf("The value is %d", func0()); - return 0; -} diff --git a/test cases/unit/87 cpp modules/meson.build b/test cases/unit/87 cpp modules/meson.build deleted file mode 100644 index cdc296f43..000000000 --- a/test cases/unit/87 cpp modules/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -project('cppmodules', 'cpp', default_options: ['cpp_std=c++latest']) - -e = executable('modtest', - 'main.cpp', - 'src0.ixx', - 'src1.ixx', - 'src2.ixx', - 'src3.ixx', - 'src4.ixx', - 'src5.ixx', - 'src6.ixx', - 'src7.ixx', - 'src8.ixx', - 'src9.ixx', - ) - -test('modtest', e) diff --git a/test cases/unit/87 cpp modules/src0.ixx b/test cases/unit/87 cpp modules/src0.ixx deleted file mode 100644 index 3ca4d1448..000000000 --- a/test cases/unit/87 cpp modules/src0.ixx +++ /dev/null @@ -1,7 +0,0 @@ -export module M0; - -import M1; - -export int func0() { - return func1(); -} diff --git a/test cases/unit/87 cpp modules/src1.ixx b/test cases/unit/87 cpp modules/src1.ixx deleted file mode 100644 index cea6696de..000000000 --- a/test cases/unit/87 cpp modules/src1.ixx +++ /dev/null @@ -1,7 +0,0 @@ -export module M1; - -import M2; - -export int func1() { - return func2(); -} diff --git a/test cases/unit/87 cpp modules/src2.ixx b/test cases/unit/87 cpp modules/src2.ixx deleted file mode 100644 index 415714cc0..000000000 --- a/test cases/unit/87 cpp modules/src2.ixx +++ /dev/null @@ -1,7 +0,0 @@ -export module M2; - -import M3; - -export int func2() { - return func3(); -} diff --git a/test cases/unit/87 cpp modules/src3.ixx b/test cases/unit/87 cpp modules/src3.ixx deleted file mode 100644 index 96f135c00..000000000 --- a/test cases/unit/87 cpp modules/src3.ixx +++ /dev/null @@ -1,7 +0,0 @@ -export module M3; - -import M4; - -export int func3() { - return func4(); -} diff --git a/test cases/unit/87 cpp modules/src4.ixx b/test cases/unit/87 cpp modules/src4.ixx deleted file mode 100644 index 1ac1a6a64..000000000 --- a/test cases/unit/87 cpp modules/src4.ixx +++ /dev/null @@ -1,7 +0,0 @@ -export module M4; - -import M5; - -export int func4() { - return func5(); -} diff --git a/test cases/unit/87 cpp modules/src5.ixx b/test cases/unit/87 cpp modules/src5.ixx deleted file mode 100644 index 96cf70761..000000000 --- a/test cases/unit/87 cpp modules/src5.ixx +++ /dev/null @@ -1,7 +0,0 @@ -export module M5; - -import M6; - -export int func5() { - return func6(); -} diff --git a/test cases/unit/87 cpp modules/src6.ixx b/test cases/unit/87 cpp modules/src6.ixx deleted file mode 100644 index 760b71cbb..000000000 --- a/test cases/unit/87 cpp modules/src6.ixx +++ /dev/null @@ -1,7 +0,0 @@ -export module M6; - -import M7; - -export int func6() { - return func7(); -} diff --git a/test cases/unit/87 cpp modules/src7.ixx b/test cases/unit/87 cpp modules/src7.ixx deleted file mode 100644 index 8ce660801..000000000 --- a/test cases/unit/87 cpp modules/src7.ixx +++ /dev/null @@ -1,7 +0,0 @@ -export module M7; - -import M8; - -export int func7() { - return func8(); -} diff --git a/test cases/unit/87 cpp modules/src8.ixx b/test cases/unit/87 cpp modules/src8.ixx deleted file mode 100644 index 6a3ef96f5..000000000 --- a/test cases/unit/87 cpp modules/src8.ixx +++ /dev/null @@ -1,7 +0,0 @@ -export module M8; - -import M9; - -export int func8() { - return func9(); -} diff --git a/test cases/unit/87 cpp modules/src9.ixx b/test cases/unit/87 cpp modules/src9.ixx deleted file mode 100644 index 3ecb3be68..000000000 --- a/test cases/unit/87 cpp modules/src9.ixx +++ /dev/null @@ -1,5 +0,0 @@ -export module M9; - -export int func9() { - return 42; -} diff --git a/test cases/unit/87 prelinking/file1.c b/test cases/unit/87 prelinking/file1.c new file mode 100644 index 000000000..9f0e26523 --- /dev/null +++ b/test cases/unit/87 prelinking/file1.c @@ -0,0 +1,14 @@ +#include +#include + +int public_func() { + return round1_a(); +} + +int round1_a() { + return round1_b(); +} + +int round2_a() { + return round2_b(); +} diff --git a/test cases/unit/87 prelinking/file2.c b/test cases/unit/87 prelinking/file2.c new file mode 100644 index 000000000..ce3b11550 --- /dev/null +++ b/test cases/unit/87 prelinking/file2.c @@ -0,0 +1,9 @@ +#include + +int round1_b() { + return round1_c(); +} + +int round2_b() { + return round2_c(); +} diff --git a/test cases/unit/87 prelinking/file3.c b/test cases/unit/87 prelinking/file3.c new file mode 100644 index 000000000..85052beb4 --- /dev/null +++ b/test cases/unit/87 prelinking/file3.c @@ -0,0 +1,9 @@ +#include + +int round1_c() { + return round1_d(); +} + +int round2_c() { + return round2_d(); +} diff --git a/test cases/unit/87 prelinking/file4.c b/test cases/unit/87 prelinking/file4.c new file mode 100644 index 000000000..622364e78 --- /dev/null +++ b/test cases/unit/87 prelinking/file4.c @@ -0,0 +1,9 @@ +#include + +int round1_d() { + return round2_a(); +} + +int round2_d() { + return 42; +} diff --git a/test cases/unit/87 prelinking/main.c b/test cases/unit/87 prelinking/main.c new file mode 100644 index 000000000..09a2e5c3d --- /dev/null +++ b/test cases/unit/87 prelinking/main.c @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, char **argv) { + if(public_func() != 42) { + printf("Something failed.\n"); + return 1; + } + return 0; +} diff --git a/test cases/unit/87 prelinking/meson.build b/test cases/unit/87 prelinking/meson.build new file mode 100644 index 000000000..3dbf88e5f --- /dev/null +++ b/test cases/unit/87 prelinking/meson.build @@ -0,0 +1,8 @@ +project('prelinking', 'c') + +liba = static_library('prelinked', 'file1.c', 'file2.c', 'file3.c', 'file4.c', + prelink: true) +exe = executable('testprog', 'main.c', + link_with: liba) +test('prelinked', exe) + \ No newline at end of file diff --git a/test cases/unit/87 prelinking/private_header.h b/test cases/unit/87 prelinking/private_header.h new file mode 100644 index 000000000..f24b621a0 --- /dev/null +++ b/test cases/unit/87 prelinking/private_header.h @@ -0,0 +1,11 @@ +#pragma once + +int round1_a(); +int round1_b(); +int round1_c(); +int round1_d(); + +int round2_a(); +int round2_b(); +int round2_c(); +int round2_d(); diff --git a/test cases/unit/87 prelinking/public_header.h b/test cases/unit/87 prelinking/public_header.h new file mode 100644 index 000000000..0cd67862a --- /dev/null +++ b/test cases/unit/87 prelinking/public_header.h @@ -0,0 +1,3 @@ +#pragma once + +int public_func(); diff --git a/test cases/unit/88 prelinking/file1.c b/test cases/unit/88 prelinking/file1.c deleted file mode 100644 index 9f0e26523..000000000 --- a/test cases/unit/88 prelinking/file1.c +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -int public_func() { - return round1_a(); -} - -int round1_a() { - return round1_b(); -} - -int round2_a() { - return round2_b(); -} diff --git a/test cases/unit/88 prelinking/file2.c b/test cases/unit/88 prelinking/file2.c deleted file mode 100644 index ce3b11550..000000000 --- a/test cases/unit/88 prelinking/file2.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int round1_b() { - return round1_c(); -} - -int round2_b() { - return round2_c(); -} diff --git a/test cases/unit/88 prelinking/file3.c b/test cases/unit/88 prelinking/file3.c deleted file mode 100644 index 85052beb4..000000000 --- a/test cases/unit/88 prelinking/file3.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int round1_c() { - return round1_d(); -} - -int round2_c() { - return round2_d(); -} diff --git a/test cases/unit/88 prelinking/file4.c b/test cases/unit/88 prelinking/file4.c deleted file mode 100644 index 622364e78..000000000 --- a/test cases/unit/88 prelinking/file4.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int round1_d() { - return round2_a(); -} - -int round2_d() { - return 42; -} diff --git a/test cases/unit/88 prelinking/main.c b/test cases/unit/88 prelinking/main.c deleted file mode 100644 index 09a2e5c3d..000000000 --- a/test cases/unit/88 prelinking/main.c +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - if(public_func() != 42) { - printf("Something failed.\n"); - return 1; - } - return 0; -} diff --git a/test cases/unit/88 prelinking/meson.build b/test cases/unit/88 prelinking/meson.build deleted file mode 100644 index 3dbf88e5f..000000000 --- a/test cases/unit/88 prelinking/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -project('prelinking', 'c') - -liba = static_library('prelinked', 'file1.c', 'file2.c', 'file3.c', 'file4.c', - prelink: true) -exe = executable('testprog', 'main.c', - link_with: liba) -test('prelinked', exe) - \ No newline at end of file diff --git a/test cases/unit/88 prelinking/private_header.h b/test cases/unit/88 prelinking/private_header.h deleted file mode 100644 index f24b621a0..000000000 --- a/test cases/unit/88 prelinking/private_header.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -int round1_a(); -int round1_b(); -int round1_c(); -int round1_d(); - -int round2_a(); -int round2_b(); -int round2_c(); -int round2_d(); diff --git a/test cases/unit/88 prelinking/public_header.h b/test cases/unit/88 prelinking/public_header.h deleted file mode 100644 index 0cd67862a..000000000 --- a/test cases/unit/88 prelinking/public_header.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -int public_func(); diff --git a/test cases/unit/88 run native test/main.c b/test cases/unit/88 run native test/main.c new file mode 100644 index 000000000..3213780df --- /dev/null +++ b/test cases/unit/88 run native test/main.c @@ -0,0 +1,17 @@ +#include + +int main (int argc, char * argv[]) +{ + const char *out = "SUCCESS!"; + + if (argc != 2) { + printf ("%s\n", out); + } else { + int ret; + FILE *f = fopen (argv[1], "w"); + ret = fwrite (out, sizeof (out), 1, f); + if (ret != 1) + return -1; + } + return 0; +} diff --git a/test cases/unit/88 run native test/meson.build b/test cases/unit/88 run native test/meson.build new file mode 100644 index 000000000..3bf419c14 --- /dev/null +++ b/test cases/unit/88 run native test/meson.build @@ -0,0 +1,6 @@ +project('run native test', ['c']) + +executable('terget_exe', 'main.c') + +native_exe = executable('native_exe', 'main.c', native: true) +test('native_exe', native_exe, args: ['native_test_has_run.stamp']) diff --git a/test cases/unit/89 multiple envvars/meson.build b/test cases/unit/89 multiple envvars/meson.build new file mode 100644 index 000000000..ac57611c8 --- /dev/null +++ b/test cases/unit/89 multiple envvars/meson.build @@ -0,0 +1,4 @@ +project('multienv', 'c', 'cpp') + +executable('cexe', 'prog.c') +executable('cppexe', 'prog.cpp') diff --git a/test cases/unit/89 multiple envvars/prog.c b/test cases/unit/89 multiple envvars/prog.c new file mode 100644 index 000000000..38d3c123b --- /dev/null +++ b/test cases/unit/89 multiple envvars/prog.c @@ -0,0 +1,18 @@ +#include + +#ifndef CPPFLAG +#error CPPFLAG not set +#endif + +#ifndef CFLAG +#error CFLAGS not set +#endif + +#ifdef CXXFLAG +#error CXXFLAG is set +#endif + +int main(int argc, char **argv) { + printf("%d %s\n", argc, argv[0]); + return 0; +} diff --git a/test cases/unit/89 multiple envvars/prog.cpp b/test cases/unit/89 multiple envvars/prog.cpp new file mode 100644 index 000000000..61ccf3a45 --- /dev/null +++ b/test cases/unit/89 multiple envvars/prog.cpp @@ -0,0 +1,18 @@ +#include + +#ifndef CPPFLAG +#error CPPFLAG not set +#endif + +#ifdef CFLAG +#error CFLAG is set +#endif + +#ifndef CXXFLAG +#error CXXFLAG not set +#endif + +int main(int argc, char **argv) { + printf("%d %s\n", argc, argv[0]); + return 0; +} diff --git a/test cases/unit/89 run native test/main.c b/test cases/unit/89 run native test/main.c deleted file mode 100644 index 3213780df..000000000 --- a/test cases/unit/89 run native test/main.c +++ /dev/null @@ -1,17 +0,0 @@ -#include - -int main (int argc, char * argv[]) -{ - const char *out = "SUCCESS!"; - - if (argc != 2) { - printf ("%s\n", out); - } else { - int ret; - FILE *f = fopen (argv[1], "w"); - ret = fwrite (out, sizeof (out), 1, f); - if (ret != 1) - return -1; - } - return 0; -} diff --git a/test cases/unit/89 run native test/meson.build b/test cases/unit/89 run native test/meson.build deleted file mode 100644 index 3bf419c14..000000000 --- a/test cases/unit/89 run native test/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('run native test', ['c']) - -executable('terget_exe', 'main.c') - -native_exe = executable('native_exe', 'main.c', native: true) -test('native_exe', native_exe, args: ['native_test_has_run.stamp']) diff --git a/test cases/unit/90 multiple envvars/meson.build b/test cases/unit/90 multiple envvars/meson.build deleted file mode 100644 index ac57611c8..000000000 --- a/test cases/unit/90 multiple envvars/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -project('multienv', 'c', 'cpp') - -executable('cexe', 'prog.c') -executable('cppexe', 'prog.cpp') diff --git a/test cases/unit/90 multiple envvars/prog.c b/test cases/unit/90 multiple envvars/prog.c deleted file mode 100644 index 38d3c123b..000000000 --- a/test cases/unit/90 multiple envvars/prog.c +++ /dev/null @@ -1,18 +0,0 @@ -#include - -#ifndef CPPFLAG -#error CPPFLAG not set -#endif - -#ifndef CFLAG -#error CFLAGS not set -#endif - -#ifdef CXXFLAG -#error CXXFLAG is set -#endif - -int main(int argc, char **argv) { - printf("%d %s\n", argc, argv[0]); - return 0; -} diff --git a/test cases/unit/90 multiple envvars/prog.cpp b/test cases/unit/90 multiple envvars/prog.cpp deleted file mode 100644 index 61ccf3a45..000000000 --- a/test cases/unit/90 multiple envvars/prog.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include - -#ifndef CPPFLAG -#error CPPFLAG not set -#endif - -#ifdef CFLAG -#error CFLAG is set -#endif - -#ifndef CXXFLAG -#error CXXFLAG not set -#endif - -int main(int argc, char **argv) { - printf("%d %s\n", argc, argv[0]); - return 0; -} diff --git a/test cases/unit/91 install skip subprojects/foo.c b/test cases/unit/91 install skip subprojects/foo.c deleted file mode 100644 index 25927f5a1..000000000 --- a/test cases/unit/91 install skip subprojects/foo.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(int argc, char *argv[]) -{ - return 0; -} diff --git a/test cases/unit/91 install skip subprojects/foo.dat b/test cases/unit/91 install skip subprojects/foo.dat deleted file mode 100644 index 421376db9..000000000 --- a/test cases/unit/91 install skip subprojects/foo.dat +++ /dev/null @@ -1 +0,0 @@ -dummy diff --git a/test cases/unit/91 install skip subprojects/foo.h b/test cases/unit/91 install skip subprojects/foo.h deleted file mode 100644 index a7e26ac6c..000000000 --- a/test cases/unit/91 install skip subprojects/foo.h +++ /dev/null @@ -1 +0,0 @@ -#define FOO diff --git a/test cases/unit/91 install skip subprojects/foo/foofile b/test cases/unit/91 install skip subprojects/foo/foofile deleted file mode 100644 index e69de29bb..000000000 diff --git a/test cases/unit/91 install skip subprojects/meson.build b/test cases/unit/91 install skip subprojects/meson.build deleted file mode 100644 index cfbae9483..000000000 --- a/test cases/unit/91 install skip subprojects/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -project('foo', 'c') - -install_data('foo.dat') -install_headers('foo.h') -install_subdir('foo', install_dir: '') -executable('foo', 'foo.c', install: true) - -subproject('bar') diff --git a/test cases/unit/91 install skip subprojects/subprojects/bar/bar.c b/test cases/unit/91 install skip subprojects/subprojects/bar/bar.c deleted file mode 100644 index 25927f5a1..000000000 --- a/test cases/unit/91 install skip subprojects/subprojects/bar/bar.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(int argc, char *argv[]) -{ - return 0; -} diff --git a/test cases/unit/91 install skip subprojects/subprojects/bar/bar.dat b/test cases/unit/91 install skip subprojects/subprojects/bar/bar.dat deleted file mode 100644 index 421376db9..000000000 --- a/test cases/unit/91 install skip subprojects/subprojects/bar/bar.dat +++ /dev/null @@ -1 +0,0 @@ -dummy diff --git a/test cases/unit/91 install skip subprojects/subprojects/bar/bar.h b/test cases/unit/91 install skip subprojects/subprojects/bar/bar.h deleted file mode 100644 index a7e26ac6c..000000000 --- a/test cases/unit/91 install skip subprojects/subprojects/bar/bar.h +++ /dev/null @@ -1 +0,0 @@ -#define FOO diff --git a/test cases/unit/91 install skip subprojects/subprojects/bar/bar/barfile b/test cases/unit/91 install skip subprojects/subprojects/bar/bar/barfile deleted file mode 100644 index 421376db9..000000000 --- a/test cases/unit/91 install skip subprojects/subprojects/bar/bar/barfile +++ /dev/null @@ -1 +0,0 @@ -dummy diff --git a/test cases/unit/91 install skip subprojects/subprojects/bar/meson.build b/test cases/unit/91 install skip subprojects/subprojects/bar/meson.build deleted file mode 100644 index b5b073408..000000000 --- a/test cases/unit/91 install skip subprojects/subprojects/bar/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('bar', 'c') - -install_data('bar.dat') -install_headers('bar.h') -install_subdir('bar', install_dir: '') -executable('bar', 'bar.c', install: true) diff --git a/test cases/unit/92 install skip subprojects/foo.c b/test cases/unit/92 install skip subprojects/foo.c new file mode 100644 index 000000000..25927f5a1 --- /dev/null +++ b/test cases/unit/92 install skip subprojects/foo.c @@ -0,0 +1,4 @@ +int main(int argc, char *argv[]) +{ + return 0; +} diff --git a/test cases/unit/92 install skip subprojects/foo.dat b/test cases/unit/92 install skip subprojects/foo.dat new file mode 100644 index 000000000..421376db9 --- /dev/null +++ b/test cases/unit/92 install skip subprojects/foo.dat @@ -0,0 +1 @@ +dummy diff --git a/test cases/unit/92 install skip subprojects/foo.h b/test cases/unit/92 install skip subprojects/foo.h new file mode 100644 index 000000000..a7e26ac6c --- /dev/null +++ b/test cases/unit/92 install skip subprojects/foo.h @@ -0,0 +1 @@ +#define FOO diff --git a/test cases/unit/92 install skip subprojects/foo/foofile b/test cases/unit/92 install skip subprojects/foo/foofile new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/92 install skip subprojects/meson.build b/test cases/unit/92 install skip subprojects/meson.build new file mode 100644 index 000000000..cfbae9483 --- /dev/null +++ b/test cases/unit/92 install skip subprojects/meson.build @@ -0,0 +1,8 @@ +project('foo', 'c') + +install_data('foo.dat') +install_headers('foo.h') +install_subdir('foo', install_dir: '') +executable('foo', 'foo.c', install: true) + +subproject('bar') diff --git a/test cases/unit/92 install skip subprojects/subprojects/bar/bar.c b/test cases/unit/92 install skip subprojects/subprojects/bar/bar.c new file mode 100644 index 000000000..25927f5a1 --- /dev/null +++ b/test cases/unit/92 install skip subprojects/subprojects/bar/bar.c @@ -0,0 +1,4 @@ +int main(int argc, char *argv[]) +{ + return 0; +} diff --git a/test cases/unit/92 install skip subprojects/subprojects/bar/bar.dat b/test cases/unit/92 install skip subprojects/subprojects/bar/bar.dat new file mode 100644 index 000000000..421376db9 --- /dev/null +++ b/test cases/unit/92 install skip subprojects/subprojects/bar/bar.dat @@ -0,0 +1 @@ +dummy diff --git a/test cases/unit/92 install skip subprojects/subprojects/bar/bar.h b/test cases/unit/92 install skip subprojects/subprojects/bar/bar.h new file mode 100644 index 000000000..a7e26ac6c --- /dev/null +++ b/test cases/unit/92 install skip subprojects/subprojects/bar/bar.h @@ -0,0 +1 @@ +#define FOO diff --git a/test cases/unit/92 install skip subprojects/subprojects/bar/bar/barfile b/test cases/unit/92 install skip subprojects/subprojects/bar/bar/barfile new file mode 100644 index 000000000..421376db9 --- /dev/null +++ b/test cases/unit/92 install skip subprojects/subprojects/bar/bar/barfile @@ -0,0 +1 @@ +dummy diff --git a/test cases/unit/92 install skip subprojects/subprojects/bar/meson.build b/test cases/unit/92 install skip subprojects/subprojects/bar/meson.build new file mode 100644 index 000000000..b5b073408 --- /dev/null +++ b/test cases/unit/92 install skip subprojects/subprojects/bar/meson.build @@ -0,0 +1,6 @@ +project('bar', 'c') + +install_data('bar.dat') +install_headers('bar.h') +install_subdir('bar', install_dir: '') +executable('bar', 'bar.c', install: true) diff --git a/test cases/unit/92 new subproject in configured project/meson.build b/test cases/unit/92 new subproject in configured project/meson.build deleted file mode 100644 index b82aa4173..000000000 --- a/test cases/unit/92 new subproject in configured project/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-license-identifier: Apache-2.0 -# Copyright © 2021 Intel Corporation -project('existing project with new subproject', 'c') - -if get_option('use-sub') - dep = subproject('sub') -endif diff --git a/test cases/unit/92 new subproject in configured project/meson_options.txt b/test cases/unit/92 new subproject in configured project/meson_options.txt deleted file mode 100644 index 12d8395d4..000000000 --- a/test cases/unit/92 new subproject in configured project/meson_options.txt +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-license-identifier: Apache-2.0 -# Copyright © 2021 Intel Corporation -option('use-sub', type : 'boolean', value : false) diff --git a/test cases/unit/92 new subproject in configured project/subprojects/sub/foo.c b/test cases/unit/92 new subproject in configured project/subprojects/sub/foo.c deleted file mode 100644 index 9713d9f7f..000000000 --- a/test cases/unit/92 new subproject in configured project/subprojects/sub/foo.c +++ /dev/null @@ -1,6 +0,0 @@ -/* SPDX-license-identifier: Apache-2.0 */ -/* Copyright © 2021 Intel Corporation */ - -int func(void) { - return 1; -} diff --git a/test cases/unit/92 new subproject in configured project/subprojects/sub/meson.build b/test cases/unit/92 new subproject in configured project/subprojects/sub/meson.build deleted file mode 100644 index a833b0c35..000000000 --- a/test cases/unit/92 new subproject in configured project/subprojects/sub/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-license-identifier: Apache-2.0 -# Copyright © 2021 Intel Corporation -project('new subproject', 'c') - -l = library('foo', 'foo.c') - -dep = declare_dependency(link_with : l) diff --git a/test cases/unit/93 clangformat/.clang-format b/test cases/unit/93 clangformat/.clang-format deleted file mode 100644 index 689bc6047..000000000 --- a/test cases/unit/93 clangformat/.clang-format +++ /dev/null @@ -1,4 +0,0 @@ ---- -BasedOnStyle: Google - -... diff --git a/test cases/unit/93 clangformat/.clang-format-ignore b/test cases/unit/93 clangformat/.clang-format-ignore deleted file mode 100644 index 7fc4d5a95..000000000 --- a/test cases/unit/93 clangformat/.clang-format-ignore +++ /dev/null @@ -1,3 +0,0 @@ - -# Ignore C files -*.c diff --git a/test cases/unit/93 clangformat/.clang-format-include b/test cases/unit/93 clangformat/.clang-format-include deleted file mode 100644 index f057c0033..000000000 --- a/test cases/unit/93 clangformat/.clang-format-include +++ /dev/null @@ -1,3 +0,0 @@ - -# Only reformat in src/ -src/**/* diff --git a/test cases/unit/93 clangformat/meson.build b/test cases/unit/93 clangformat/meson.build deleted file mode 100644 index 8f4af981b..000000000 --- a/test cases/unit/93 clangformat/meson.build +++ /dev/null @@ -1 +0,0 @@ -project('dummy', 'c', 'cpp') diff --git a/test cases/unit/93 clangformat/not-included/badformat.cpp b/test cases/unit/93 clangformat/not-included/badformat.cpp deleted file mode 100644 index 99a0ea60c..000000000 --- a/test cases/unit/93 clangformat/not-included/badformat.cpp +++ /dev/null @@ -1,2 +0,0 @@ -class { -}; diff --git a/test cases/unit/93 clangformat/src/badformat.c b/test cases/unit/93 clangformat/src/badformat.c deleted file mode 100644 index f1d18b7ed..000000000 --- a/test cases/unit/93 clangformat/src/badformat.c +++ /dev/null @@ -1,2 +0,0 @@ -struct { -}; diff --git a/test cases/unit/93 clangformat/src/badformat.cpp b/test cases/unit/93 clangformat/src/badformat.cpp deleted file mode 100644 index 99a0ea60c..000000000 --- a/test cases/unit/93 clangformat/src/badformat.cpp +++ /dev/null @@ -1,2 +0,0 @@ -class { -}; diff --git a/test cases/unit/93 new subproject in configured project/meson.build b/test cases/unit/93 new subproject in configured project/meson.build new file mode 100644 index 000000000..b82aa4173 --- /dev/null +++ b/test cases/unit/93 new subproject in configured project/meson.build @@ -0,0 +1,7 @@ +# SPDX-license-identifier: Apache-2.0 +# Copyright © 2021 Intel Corporation +project('existing project with new subproject', 'c') + +if get_option('use-sub') + dep = subproject('sub') +endif diff --git a/test cases/unit/93 new subproject in configured project/meson_options.txt b/test cases/unit/93 new subproject in configured project/meson_options.txt new file mode 100644 index 000000000..12d8395d4 --- /dev/null +++ b/test cases/unit/93 new subproject in configured project/meson_options.txt @@ -0,0 +1,3 @@ +# SPDX-license-identifier: Apache-2.0 +# Copyright © 2021 Intel Corporation +option('use-sub', type : 'boolean', value : false) diff --git a/test cases/unit/93 new subproject in configured project/subprojects/sub/foo.c b/test cases/unit/93 new subproject in configured project/subprojects/sub/foo.c new file mode 100644 index 000000000..9713d9f7f --- /dev/null +++ b/test cases/unit/93 new subproject in configured project/subprojects/sub/foo.c @@ -0,0 +1,6 @@ +/* SPDX-license-identifier: Apache-2.0 */ +/* Copyright © 2021 Intel Corporation */ + +int func(void) { + return 1; +} diff --git a/test cases/unit/93 new subproject in configured project/subprojects/sub/meson.build b/test cases/unit/93 new subproject in configured project/subprojects/sub/meson.build new file mode 100644 index 000000000..a833b0c35 --- /dev/null +++ b/test cases/unit/93 new subproject in configured project/subprojects/sub/meson.build @@ -0,0 +1,7 @@ +# SPDX-license-identifier: Apache-2.0 +# Copyright © 2021 Intel Corporation +project('new subproject', 'c') + +l = library('foo', 'foo.c') + +dep = declare_dependency(link_with : l) diff --git a/test cases/unit/94 clangformat/.clang-format b/test cases/unit/94 clangformat/.clang-format new file mode 100644 index 000000000..689bc6047 --- /dev/null +++ b/test cases/unit/94 clangformat/.clang-format @@ -0,0 +1,4 @@ +--- +BasedOnStyle: Google + +... diff --git a/test cases/unit/94 clangformat/.clang-format-ignore b/test cases/unit/94 clangformat/.clang-format-ignore new file mode 100644 index 000000000..7fc4d5a95 --- /dev/null +++ b/test cases/unit/94 clangformat/.clang-format-ignore @@ -0,0 +1,3 @@ + +# Ignore C files +*.c diff --git a/test cases/unit/94 clangformat/.clang-format-include b/test cases/unit/94 clangformat/.clang-format-include new file mode 100644 index 000000000..f057c0033 --- /dev/null +++ b/test cases/unit/94 clangformat/.clang-format-include @@ -0,0 +1,3 @@ + +# Only reformat in src/ +src/**/* diff --git a/test cases/unit/94 clangformat/meson.build b/test cases/unit/94 clangformat/meson.build new file mode 100644 index 000000000..8f4af981b --- /dev/null +++ b/test cases/unit/94 clangformat/meson.build @@ -0,0 +1 @@ +project('dummy', 'c', 'cpp') diff --git a/test cases/unit/94 clangformat/not-included/badformat.cpp b/test cases/unit/94 clangformat/not-included/badformat.cpp new file mode 100644 index 000000000..99a0ea60c --- /dev/null +++ b/test cases/unit/94 clangformat/not-included/badformat.cpp @@ -0,0 +1,2 @@ +class { +}; diff --git a/test cases/unit/94 clangformat/src/badformat.c b/test cases/unit/94 clangformat/src/badformat.c new file mode 100644 index 000000000..f1d18b7ed --- /dev/null +++ b/test cases/unit/94 clangformat/src/badformat.c @@ -0,0 +1,2 @@ +struct { +}; diff --git a/test cases/unit/94 clangformat/src/badformat.cpp b/test cases/unit/94 clangformat/src/badformat.cpp new file mode 100644 index 000000000..99a0ea60c --- /dev/null +++ b/test cases/unit/94 clangformat/src/badformat.cpp @@ -0,0 +1,2 @@ +class { +}; diff --git a/test cases/unit/94 custominc/easytogrepfor/genh.py b/test cases/unit/94 custominc/easytogrepfor/genh.py deleted file mode 100644 index 48e033a72..000000000 --- a/test cases/unit/94 custominc/easytogrepfor/genh.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -f = open(sys.argv[1], 'w') -f.write('#define RETURN_VALUE 0') -f.close() diff --git a/test cases/unit/94 custominc/easytogrepfor/meson.build b/test cases/unit/94 custominc/easytogrepfor/meson.build deleted file mode 100644 index e749753bc..000000000 --- a/test cases/unit/94 custominc/easytogrepfor/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -genh = custom_target('header', - output: 'generated.h', - command: [find_program('genh.py'), '@OUTPUT@']) diff --git a/test cases/unit/94 custominc/helper.c b/test cases/unit/94 custominc/helper.c deleted file mode 100644 index 3237441bc..000000000 --- a/test cases/unit/94 custominc/helper.c +++ /dev/null @@ -1,5 +0,0 @@ -#include - -int func(void) { - return RETURN_VALUE; -} diff --git a/test cases/unit/94 custominc/meson.build b/test cases/unit/94 custominc/meson.build deleted file mode 100644 index bab113908..000000000 --- a/test cases/unit/94 custominc/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -project('implicit custom dirs', 'c') - -subdir('easytogrepfor') - -l = static_library('helper', 'helper.c', genh) -d = declare_dependency(link_with: l, sources: genh) -executable('prog', 'prog.c', dependencies: d, implicit_include_directories: false) - -executable('prog2', 'prog2.c', dependencies: d) diff --git a/test cases/unit/94 custominc/prog.c b/test cases/unit/94 custominc/prog.c deleted file mode 100644 index db9df9d5e..000000000 --- a/test cases/unit/94 custominc/prog.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int func(void); - -int main(int argc, char **argv) { - (void)argc; - (void)(argv); - return func(); -} diff --git a/test cases/unit/94 custominc/prog2.c b/test cases/unit/94 custominc/prog2.c deleted file mode 100644 index e64b22919..000000000 --- a/test cases/unit/94 custominc/prog2.c +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -int func(void); - -int main(int argc, char **argv) { - (void)argc; - (void)(argv); - return func() + RETURN_VALUE; -} diff --git a/test cases/unit/95 custominc/easytogrepfor/genh.py b/test cases/unit/95 custominc/easytogrepfor/genh.py new file mode 100644 index 000000000..48e033a72 --- /dev/null +++ b/test cases/unit/95 custominc/easytogrepfor/genh.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 + +import sys + +f = open(sys.argv[1], 'w') +f.write('#define RETURN_VALUE 0') +f.close() diff --git a/test cases/unit/95 custominc/easytogrepfor/meson.build b/test cases/unit/95 custominc/easytogrepfor/meson.build new file mode 100644 index 000000000..e749753bc --- /dev/null +++ b/test cases/unit/95 custominc/easytogrepfor/meson.build @@ -0,0 +1,3 @@ +genh = custom_target('header', + output: 'generated.h', + command: [find_program('genh.py'), '@OUTPUT@']) diff --git a/test cases/unit/95 custominc/helper.c b/test cases/unit/95 custominc/helper.c new file mode 100644 index 000000000..3237441bc --- /dev/null +++ b/test cases/unit/95 custominc/helper.c @@ -0,0 +1,5 @@ +#include + +int func(void) { + return RETURN_VALUE; +} diff --git a/test cases/unit/95 custominc/meson.build b/test cases/unit/95 custominc/meson.build new file mode 100644 index 000000000..bab113908 --- /dev/null +++ b/test cases/unit/95 custominc/meson.build @@ -0,0 +1,9 @@ +project('implicit custom dirs', 'c') + +subdir('easytogrepfor') + +l = static_library('helper', 'helper.c', genh) +d = declare_dependency(link_with: l, sources: genh) +executable('prog', 'prog.c', dependencies: d, implicit_include_directories: false) + +executable('prog2', 'prog2.c', dependencies: d) diff --git a/test cases/unit/95 custominc/prog.c b/test cases/unit/95 custominc/prog.c new file mode 100644 index 000000000..db9df9d5e --- /dev/null +++ b/test cases/unit/95 custominc/prog.c @@ -0,0 +1,9 @@ +#include + +int func(void); + +int main(int argc, char **argv) { + (void)argc; + (void)(argv); + return func(); +} diff --git a/test cases/unit/95 custominc/prog2.c b/test cases/unit/95 custominc/prog2.c new file mode 100644 index 000000000..e64b22919 --- /dev/null +++ b/test cases/unit/95 custominc/prog2.c @@ -0,0 +1,10 @@ +#include +#include + +int func(void); + +int main(int argc, char **argv) { + (void)argc; + (void)(argv); + return func() + RETURN_VALUE; +} -- cgit v1.2.3