summaryrefslogtreecommitdiffstats
path: root/manual tests
diff options
context:
space:
mode:
Diffstat (limited to 'manual tests')
-rw-r--r--manual tests/1 wrap/main.c12
-rw-r--r--manual tests/1 wrap/meson.build13
-rw-r--r--manual tests/1 wrap/subprojects/sqlite.wrap10
-rw-r--r--manual tests/10 svn wrap/meson.build10
-rw-r--r--manual tests/10 svn wrap/prog.c6
-rw-r--r--manual tests/10 svn wrap/subprojects/samplesubproject.wrap4
-rw-r--r--manual tests/11 wrap imposter/meson.build8
-rw-r--r--manual tests/11 wrap imposter/subprojects/zlib.wrap10
-rw-r--r--manual tests/12 wrap mirror/meson.build4
-rw-r--r--manual tests/12 wrap mirror/subprojects/zlib.wrap10
-rw-r--r--manual tests/13 builddir upgrade/data/foo.dat0
-rw-r--r--manual tests/13 builddir upgrade/foo.10
-rw-r--r--manual tests/13 builddir upgrade/foo.c6
-rw-r--r--manual tests/13 builddir upgrade/lib.c9
-rw-r--r--manual tests/13 builddir upgrade/meson.build21
-rw-r--r--manual tests/13 builddir upgrade/mod.py1
-rw-r--r--manual tests/2 multiwrap/meson.build12
-rw-r--r--manual tests/2 multiwrap/prog.c66
-rw-r--r--manual tests/2 multiwrap/subprojects/libpng.wrap10
-rw-r--r--manual tests/2 multiwrap/subprojects/lua.wrap11
-rw-r--r--manual tests/2 multiwrap/subprojects/zlib.wrap10
-rw-r--r--manual tests/3 git wrap/meson.build10
-rw-r--r--manual tests/3 git wrap/prog.c6
-rw-r--r--manual tests/3 git wrap/subprojects/samplesubproject.wrap4
-rw-r--r--manual tests/4 standalone binaries/Info.plist26
-rwxr-xr-xmanual tests/4 standalone binaries/build_linux_package.sh12
-rwxr-xr-xmanual tests/4 standalone binaries/build_osx_package.sh20
-rwxr-xr-xmanual tests/4 standalone binaries/build_windows_package.py32
-rwxr-xr-xmanual tests/4 standalone binaries/linux_bundler.sh7
-rw-r--r--manual tests/4 standalone binaries/meson.build38
-rw-r--r--manual tests/4 standalone binaries/myapp.cpp39
-rw-r--r--manual tests/4 standalone binaries/myapp.icnsbin0 -> 1831 bytes
-rw-r--r--manual tests/4 standalone binaries/myapp.iss18
-rwxr-xr-xmanual tests/4 standalone binaries/myapp.sh10
-rwxr-xr-xmanual tests/4 standalone binaries/osx_bundler.sh6
-rw-r--r--manual tests/4 standalone binaries/readme.txt11
-rw-r--r--manual tests/4 standalone binaries/template.dmg.gzbin0 -> 37311 bytes
-rw-r--r--manual tests/5 rpm/lib.c6
-rw-r--r--manual tests/5 rpm/lib.h1
-rw-r--r--manual tests/5 rpm/main.c8
-rw-r--r--manual tests/5 rpm/meson.build14
-rw-r--r--manual tests/6 hg wrap/meson.build10
-rw-r--r--manual tests/6 hg wrap/prog.c6
-rw-r--r--manual tests/6 hg wrap/subprojects/samplesubproject.wrap4
-rw-r--r--manual tests/7 vala composite widgets/meson.build21
-rw-r--r--manual tests/7 vala composite widgets/my-resources.xml6
-rw-r--r--manual tests/7 vala composite widgets/mywidget.ui70
-rw-r--r--manual tests/7 vala composite widgets/mywidget.vala41
-rw-r--r--manual tests/8 timeout/meson.build8
-rw-r--r--manual tests/8 timeout/sleepprog.c6
50 files changed, 673 insertions, 0 deletions
diff --git a/manual tests/1 wrap/main.c b/manual tests/1 wrap/main.c
new file mode 100644
index 0000000..df6abe4
--- /dev/null
+++ b/manual tests/1 wrap/main.c
@@ -0,0 +1,12 @@
+#include<sqlite3.h>
+#include<stdio.h>
+
+int main(void) {
+ sqlite3 *db;
+ if(sqlite3_open(":memory:", &db) != SQLITE_OK) {
+ printf("Sqlite failed.\n");
+ return 1;
+ }
+ sqlite3_close(db);
+ return 0;
+}
diff --git a/manual tests/1 wrap/meson.build b/manual tests/1 wrap/meson.build
new file mode 100644
index 0000000..aee358d
--- /dev/null
+++ b/manual tests/1 wrap/meson.build
@@ -0,0 +1,13 @@
+project('downloader', 'c')
+
+cc = meson.get_compiler('c')
+
+s = subproject('sqlite').get_variable('sqlite_dep')
+th = dependency('threads')
+
+libdl = cc.find_library('dl', required : false)
+
+e = executable('dtest', 'main.c',
+ dependencies : [th, libdl, s])
+
+test('dltest', e)
diff --git a/manual tests/1 wrap/subprojects/sqlite.wrap b/manual tests/1 wrap/subprojects/sqlite.wrap
new file mode 100644
index 0000000..6d14949
--- /dev/null
+++ b/manual tests/1 wrap/subprojects/sqlite.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = sqlite-amalgamation-3080802
+
+source_url = http://sqlite.com/2015/sqlite-amalgamation-3080802.zip
+source_filename = sqlite-amalgamation-3080802.zip
+source_hash = 5ebeea0dfb75d090ea0e7ff84799b2a7a1550db3fe61eb5f6f61c2e971e57663
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/sqlite/3080802/5/get_zip
+patch_filename = sqlite-3080802-5-wrap.zip
+patch_hash = d66469a73fa1344562d56a1d7627d5d0ee4044a77b32d16cf4bbb85741d4c9fd
diff --git a/manual tests/10 svn wrap/meson.build b/manual tests/10 svn wrap/meson.build
new file mode 100644
index 0000000..23ef1f1
--- /dev/null
+++ b/manual tests/10 svn wrap/meson.build
@@ -0,0 +1,10 @@
+project('Subversion outchecker', 'c')
+
+sp = subproject('samplesubproject')
+
+exe = executable('gitprog', 'prog.c',
+include_directories : sp.get_variable('subproj_inc'),
+link_with : sp.get_variable('subproj_lib'),
+)
+
+test('maintest', exe)
diff --git a/manual tests/10 svn wrap/prog.c b/manual tests/10 svn wrap/prog.c
new file mode 100644
index 0000000..6e2c4d8
--- /dev/null
+++ b/manual tests/10 svn wrap/prog.c
@@ -0,0 +1,6 @@
+#include"subproj.h"
+
+int main(void) {
+ subproj_function();
+ return 0;
+}
diff --git a/manual tests/10 svn wrap/subprojects/samplesubproject.wrap b/manual tests/10 svn wrap/subprojects/samplesubproject.wrap
new file mode 100644
index 0000000..c8a687e
--- /dev/null
+++ b/manual tests/10 svn wrap/subprojects/samplesubproject.wrap
@@ -0,0 +1,4 @@
+[wrap-svn]
+directory=samplesubproject
+url=https://svn.code.sf.net/p/mesonsubproject/code/trunk
+revision=head
diff --git a/manual tests/11 wrap imposter/meson.build b/manual tests/11 wrap imposter/meson.build
new file mode 100644
index 0000000..d0575ac
--- /dev/null
+++ b/manual tests/11 wrap imposter/meson.build
@@ -0,0 +1,8 @@
+project('evil URL')
+# showing that new Meson wrap.py code tries to stop imposter WrapDB URLs
+# a WrapException is raised.
+#
+# ERROR: https://wrapdb.mesonbuild.com.invalid/v1/projects/zlib/1.2.11/4/get_zip may be a WrapDB-impersonating URL
+#
+
+subproject('zlib') \ No newline at end of file
diff --git a/manual tests/11 wrap imposter/subprojects/zlib.wrap b/manual tests/11 wrap imposter/subprojects/zlib.wrap
new file mode 100644
index 0000000..b88f8f2
--- /dev/null
+++ b/manual tests/11 wrap imposter/subprojects/zlib.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = zlib-1.2.8
+
+source_url = https://zlib.net/zlib-1.2.11.tar.gz
+source_filename = zlib-1.2.11.tar.gz
+source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+
+patch_url = https://wrapdb.mesonbuild.com.invalid/v1/projects/zlib/1.2.11/4/get_zip
+patch_filename = zlib-1.2.11-4-wrap.zip
+patch_hash = 886b67480dbe73b406ad83a1dd6d9596f93089d90c220ccfc91944c95f1c68c4 \ No newline at end of file
diff --git a/manual tests/12 wrap mirror/meson.build b/manual tests/12 wrap mirror/meson.build
new file mode 100644
index 0000000..6645bdf
--- /dev/null
+++ b/manual tests/12 wrap mirror/meson.build
@@ -0,0 +1,4 @@
+project('downloader')
+# this test will timeout, showing that a subdomain isn't caught as masquarading url
+
+subproject('zlib')
diff --git a/manual tests/12 wrap mirror/subprojects/zlib.wrap b/manual tests/12 wrap mirror/subprojects/zlib.wrap
new file mode 100644
index 0000000..de0b9ad
--- /dev/null
+++ b/manual tests/12 wrap mirror/subprojects/zlib.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = zlib-1.2.8
+
+source_url = https://zlib.net/zlib-1.2.11.tar.gz
+source_filename = zlib-1.2.11.tar.gz
+source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+
+patch_url = https://mirror1.wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/4/get_zip
+patch_filename = zlib-1.2.11-4-wrap.zip
+patch_hash = 886b67480dbe73b406ad83a1dd6d9596f93089d90c220ccfc91944c95f1c68c4 \ No newline at end of file
diff --git a/manual tests/13 builddir upgrade/data/foo.dat b/manual tests/13 builddir upgrade/data/foo.dat
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/manual tests/13 builddir upgrade/data/foo.dat
diff --git a/manual tests/13 builddir upgrade/foo.1 b/manual tests/13 builddir upgrade/foo.1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/manual tests/13 builddir upgrade/foo.1
diff --git a/manual tests/13 builddir upgrade/foo.c b/manual tests/13 builddir upgrade/foo.c
new file mode 100644
index 0000000..f8edd23
--- /dev/null
+++ b/manual tests/13 builddir upgrade/foo.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main() {
+ printf("Hello world!\n");
+ return 0;
+}
diff --git a/manual tests/13 builddir upgrade/lib.c b/manual tests/13 builddir upgrade/lib.c
new file mode 100644
index 0000000..2ea9c7d
--- /dev/null
+++ b/manual tests/13 builddir upgrade/lib.c
@@ -0,0 +1,9 @@
+#if defined _WIN32 || defined __CYGWIN__
+#define DLL_PUBLIC __declspec(dllexport)
+#else
+#define DLL_PUBLIC
+#endif
+
+int DLL_PUBLIC foo(void) {
+ return 0;
+}
diff --git a/manual tests/13 builddir upgrade/meson.build b/manual tests/13 builddir upgrade/meson.build
new file mode 100644
index 0000000..34ae39c
--- /dev/null
+++ b/manual tests/13 builddir upgrade/meson.build
@@ -0,0 +1,21 @@
+project('check old builddirs in a stable release', 'c')
+
+lib = both_libraries('lib', 'lib.c')
+exe = executable('foo', 'foo.c', link_with: lib, install: true)
+test('exe', exe)
+
+install_data('data/foo.dat', install_dir: get_option('datadir') / 'foo')
+install_man('foo.1')
+
+py = import('python').find_installation()
+py.install_sources('mod.py', subdir: 'foo')
+install_subdir('data', install_dir: py.get_install_dir())
+
+custom_target(
+ input: 'mod.py',
+ output: 'hello.dat',
+ command: [py, '@INPUT@'],
+ capture: true,
+ install: true,
+ install_dir: get_option('localstatedir') / 'foo',
+)
diff --git a/manual tests/13 builddir upgrade/mod.py b/manual tests/13 builddir upgrade/mod.py
new file mode 100644
index 0000000..60f08aa
--- /dev/null
+++ b/manual tests/13 builddir upgrade/mod.py
@@ -0,0 +1 @@
+print('Hello world!')
diff --git a/manual tests/2 multiwrap/meson.build b/manual tests/2 multiwrap/meson.build
new file mode 100644
index 0000000..a4c42f4
--- /dev/null
+++ b/manual tests/2 multiwrap/meson.build
@@ -0,0 +1,12 @@
+project('multiwrap', 'c',
+ default_options : 'c_std=c99')
+
+# Using multiple downloaded projects for great justice.
+
+cc = meson.get_compiler('c')
+
+luadep = dependency('lua', fallback : ['lua', 'lua_dep'])
+pngdep = dependency('libpng', fallback : ['libpng', 'png_dep'])
+
+executable('prog', 'prog.c',
+ dependencies : [pngdep, luadep])
diff --git a/manual tests/2 multiwrap/prog.c b/manual tests/2 multiwrap/prog.c
new file mode 100644
index 0000000..dd0349e
--- /dev/null
+++ b/manual tests/2 multiwrap/prog.c
@@ -0,0 +1,66 @@
+#include<lua.h>
+#include<stdio.h>
+#include<stdlib.h>
+#include<png.h>
+#include<string.h>
+#if !defined(_MSC_VER)
+#include<unistd.h>
+#endif
+
+static void *l_alloc (void *ud, void *ptr, size_t osize,
+ size_t nsize) {
+ (void)ud;
+ (void)osize;
+ if (nsize == 0) {
+ free(ptr);
+ return NULL;
+ } else {
+ return realloc(ptr, nsize);
+ }
+}
+
+void open_image(const char *fname) {
+ png_image image;
+
+ memset(&image, 0, (sizeof image));
+ image.version = PNG_IMAGE_VERSION;
+
+ if(png_image_begin_read_from_file(&image, fname) != 0) {
+ png_bytep buffer;
+
+ image.format = PNG_FORMAT_RGBA;
+ buffer = malloc(PNG_IMAGE_SIZE(image));
+
+ if(png_image_finish_read(&image, NULL, buffer, 0, NULL) != 0) {
+ printf("Image %s read failed: %s\n", fname, image.message);
+ }
+// png_free_image(&image);
+ free(buffer);
+ } else {
+ printf("Image %s open failed: %s", fname, image.message);
+ }
+}
+
+int printer(lua_State *l) {
+ if(!lua_isstring(l, 1)) {
+ fprintf(stderr, "Incorrect call.\n");
+ return 0;
+ }
+ open_image(lua_tostring(l, 1));
+ return 0;
+}
+
+
+int main(int argc, char **argv) {
+ lua_State *l = lua_newstate(l_alloc, NULL);
+ if(!l) {
+ printf("Lua state allocation failed.\n");
+ return 1;
+ }
+ lua_register(l, "printer", printer);
+ lua_getglobal(l, "printer");
+ lua_pushliteral(l, "foobar.png");
+ lua_call(l, 1, 0);
+ lua_close(l);
+ return 0;
+}
diff --git a/manual tests/2 multiwrap/subprojects/libpng.wrap b/manual tests/2 multiwrap/subprojects/libpng.wrap
new file mode 100644
index 0000000..283775c
--- /dev/null
+++ b/manual tests/2 multiwrap/subprojects/libpng.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = libpng-1.6.34
+
+source_url = ftp://ftp-osl.osuosl.org/pub/libpng/src/libpng16/libpng-1.6.34.tar.xz
+source_filename = libpng-1.6.34.tar.xz
+source_hash = 2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.34/1/get_zip
+patch_filename = libpng-1.6.34-1-wrap.zip
+patch_hash = 2123806eba8180c164e33a210f2892bbeb2473b69e56aecc786574e9221e6f20
diff --git a/manual tests/2 multiwrap/subprojects/lua.wrap b/manual tests/2 multiwrap/subprojects/lua.wrap
new file mode 100644
index 0000000..c1a179a
--- /dev/null
+++ b/manual tests/2 multiwrap/subprojects/lua.wrap
@@ -0,0 +1,11 @@
+[wrap-file]
+directory = lua-5.3.0
+
+source_url = http://www.lua.org/ftp/lua-5.3.0.tar.gz
+source_filename = lua-5.3.0.tar.gz
+source_hash = ae4a5eb2d660515eb191bfe3e061f2b8ffe94dce73d32cfd0de090ddcc0ddb01
+
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/lua/5.3.0/5/get_zip
+patch_filename = lua-5.3.0-5-wrap.zip
+patch_hash = 439038309a0700adfb67d764b3fe935ed8601b31f819fc369e1438c6e79334dd
diff --git a/manual tests/2 multiwrap/subprojects/zlib.wrap b/manual tests/2 multiwrap/subprojects/zlib.wrap
new file mode 100644
index 0000000..6d5896f
--- /dev/null
+++ b/manual tests/2 multiwrap/subprojects/zlib.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = zlib-1.2.8
+
+source_url = http://zlib.net/fossils/zlib-1.2.8.tar.gz
+source_filename = zlib-1.2.8.tar.gz
+source_hash = 36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.8/8/get_zip
+patch_filename = zlib-1.2.8-8-wrap.zip
+patch_hash = 17c52a0e0c59ce926d3959005d5cd8178c6c7e2c9a4a1304279a8320c955ac60
diff --git a/manual tests/3 git wrap/meson.build b/manual tests/3 git wrap/meson.build
new file mode 100644
index 0000000..7fd5083
--- /dev/null
+++ b/manual tests/3 git wrap/meson.build
@@ -0,0 +1,10 @@
+project('git outcheckker', 'c')
+
+sp = subproject('samplesubproject')
+
+exe = executable('gitprog', 'prog.c',
+include_directories : sp.get_variable('subproj_inc'),
+link_with : sp.get_variable('subproj_lib'),
+)
+
+test('maintest', exe)
diff --git a/manual tests/3 git wrap/prog.c b/manual tests/3 git wrap/prog.c
new file mode 100644
index 0000000..6e2c4d8
--- /dev/null
+++ b/manual tests/3 git wrap/prog.c
@@ -0,0 +1,6 @@
+#include"subproj.h"
+
+int main(void) {
+ subproj_function();
+ return 0;
+}
diff --git a/manual tests/3 git wrap/subprojects/samplesubproject.wrap b/manual tests/3 git wrap/subprojects/samplesubproject.wrap
new file mode 100644
index 0000000..f52190b
--- /dev/null
+++ b/manual tests/3 git wrap/subprojects/samplesubproject.wrap
@@ -0,0 +1,4 @@
+[wrap-git]
+directory=samplesubproject
+url=https://github.com/jpakkane/samplesubproject.git
+revision=head
diff --git a/manual tests/4 standalone binaries/Info.plist b/manual tests/4 standalone binaries/Info.plist
new file mode 100644
index 0000000..0f0c90e
--- /dev/null
+++ b/manual tests/4 standalone binaries/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleGetInfoString</key>
+ <string>MyApp</string>
+ <key>CFBundleExecutable</key>
+ <string>myapp.sh</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.example.me</string>
+ <key>CFBundleName</key>
+ <string>myapp</string>
+ <key>CFBundleIconFile</key>
+ <string>myapp.icns</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>IFMajorVersion</key>
+ <integer>0</integer>
+ <key>IFMinorVersion</key>
+ <integer>1</integer>
+</dict>
+</plist>
diff --git a/manual tests/4 standalone binaries/build_linux_package.sh b/manual tests/4 standalone binaries/build_linux_package.sh
new file mode 100755
index 0000000..783981e
--- /dev/null
+++ b/manual tests/4 standalone binaries/build_linux_package.sh
@@ -0,0 +1,12 @@
+#!/bin/sh -eu
+
+curdir=`pwd`
+rm -rf buildtmp
+mkdir buildtmp
+LDFLAGS=-static-libstdc++ ~/meson/meson.py buildtmp --buildtype=release --prefix=/tmp/myapp --libdir=lib --strip
+ninja -C buildtmp install
+rm -rf buildtmp
+cd /tmp/
+tar czf myapp.tar.gz myapp
+mv myapp.tar.gz "$curdir"
+rm -rf myapp
diff --git a/manual tests/4 standalone binaries/build_osx_package.sh b/manual tests/4 standalone binaries/build_osx_package.sh
new file mode 100755
index 0000000..8a94ca5
--- /dev/null
+++ b/manual tests/4 standalone binaries/build_osx_package.sh
@@ -0,0 +1,20 @@
+#!/bin/sh -eu
+
+rm -rf buildtmp
+mkdir buildtmp
+~/meson/meson.py buildtmp --buildtype=release --prefix=/tmp/myapp.app --bindir=Contents/MacOS
+ninja -C buildtmp install
+rm -rf buildtmp
+mkdir -p mnttmp
+rm -f working.dmg
+gunzip < template.dmg.gz > working.dmg
+hdiutil attach working.dmg -noautoopen -quiet -mountpoint mnttmp
+rm -rf mnttmp/myapp.app
+mv /tmp/myapp.app mnttmp
+# NOTE: output of hdiutil changes every now and then.
+# Verify that this is still working.
+hdiutil detach $(hdiutil info|grep "mnttmp"|awk '{print $1}')
+rm -rf mnttmp
+rm -f myapp.dmg
+hdiutil convert working.dmg -quiet -format UDZO -imagekey zlib-level=9 -o myapp.dmg
+rm -f working.dmg
diff --git a/manual tests/4 standalone binaries/build_windows_package.py b/manual tests/4 standalone binaries/build_windows_package.py
new file mode 100755
index 0000000..0932eac
--- /dev/null
+++ b/manual tests/4 standalone binaries/build_windows_package.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+import os, urllib.request, shutil, subprocess
+from glob import glob
+
+sdl_url = 'http://libsdl.org/release/SDL2-devel-2.0.3-VC.zip'
+sdl_filename = 'SDL2-devel-2.0.3-VC.zip'
+sdl_dir = 'SDL2-2.0.3'
+
+shutil.rmtree('build', ignore_errors=True)
+os.mkdir('build')
+
+if not os.path.exists(sdl_filename):
+ response = urllib.request.urlopen(sdl_url, timeout=600.0)
+ data = response.read()
+ open(sdl_filename, 'wb').write(data)
+
+shutil.unpack_archive(sdl_filename, 'build')
+
+libs = glob(os.path.join('build', sdl_dir, 'lib/x86/*'))
+[shutil.copy(x, 'build') for x in libs]
+
+# Sorry for this hack but this needs to work during development
+# when Meson is not in path.
+subprocess.check_call(['python3', r'..\..\meson.py', 'build',
+ '--backend=ninja', '--buildtype=release'])
+subprocess.check_call(['ninja'], cwd='build')
+shutil.copy('myapp.iss', 'build')
+subprocess.check_call([r'\Program Files\Inno Setup 5\ISCC.exe', 'myapp.iss'],
+ cwd='build')
+shutil.copy('build/setup.exe', 'myapp 1.0.exe')
+shutil.rmtree('build')
diff --git a/manual tests/4 standalone binaries/linux_bundler.sh b/manual tests/4 standalone binaries/linux_bundler.sh
new file mode 100755
index 0000000..2a8e907
--- /dev/null
+++ b/manual tests/4 standalone binaries/linux_bundler.sh
@@ -0,0 +1,7 @@
+#!/bin/sh -eu
+
+libdir="${MESON_INSTALL_PREFIX}/lib"
+mkdir -p $libdir
+sdlfile=`ldd ${MESON_INSTALL_PREFIX}/bin/myapp | grep libSDL | cut -d ' ' -f 3`
+cp $sdlfile "${libdir}"
+strip "${libdir}/libSDL"*
diff --git a/manual tests/4 standalone binaries/meson.build b/manual tests/4 standalone binaries/meson.build
new file mode 100644
index 0000000..ad6645f
--- /dev/null
+++ b/manual tests/4 standalone binaries/meson.build
@@ -0,0 +1,38 @@
+project('myapp', 'cpp')
+
+sdl = dependency('sdl2', required : host_machine.system() != 'windows')
+
+if meson.get_compiler('cpp').get_id() != 'msvc'
+ add_global_arguments('-std=c++11', language : 'cpp')
+endif
+
+if host_machine.system() == 'darwin'
+ install_data('myapp.sh',
+ install_dir : 'Contents/MacOS')
+
+ install_data('myapp.icns',
+ install_dir : 'Contents/Resources')
+
+ install_data('Info.plist',
+ install_dir : 'Contents')
+
+ meson.add_install_script('osx_bundler.sh')
+endif
+
+if host_machine.system() == 'linux'
+ install_data('myapp.sh', install_dir : '.')
+ meson.add_install_script('linux_bundler.sh')
+endif
+
+extra_link_args = []
+
+if host_machine.system() == 'windows'
+ str = '-I@0@/@1@'.format(meson.current_build_dir(), 'SDL2-2.0.3/include')
+ add_global_arguments(str, language : 'cpp')
+ extra_link_args = ['/SUBSYSTEM:CONSOLE', 'SDL2main.lib', 'SDL2.lib']
+endif
+
+prog = executable('myapp', 'myapp.cpp',
+dependencies : sdl,
+link_args : extra_link_args,
+install : true)
diff --git a/manual tests/4 standalone binaries/myapp.cpp b/manual tests/4 standalone binaries/myapp.cpp
new file mode 100644
index 0000000..8ddff27
--- /dev/null
+++ b/manual tests/4 standalone binaries/myapp.cpp
@@ -0,0 +1,39 @@
+#include<SDL.h>
+#include<memory>
+#include<iostream>
+#include<string>
+
+int main(void) {
+ SDL_Surface *screenSurface;
+ SDL_Event e;
+ int keepGoing = 1;
+ std::string message;
+
+ if(SDL_Init( SDL_INIT_VIDEO ) < 0) {
+ printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
+ }
+ atexit(SDL_Quit);
+
+ std::unique_ptr<SDL_Window, void(*)(SDL_Window*)> window(SDL_CreateWindow( "My application", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN), SDL_DestroyWindow);
+ screenSurface = SDL_GetWindowSurface(window.get());
+
+ // Use iostream to make sure we have not screwed
+ // up libstdc++ linking.
+ message = "Window created.";
+ message += " Starting main loop.";
+ std::cout << message << std::endl;
+
+ while(keepGoing) {
+ while(SDL_PollEvent(&e) != 0) {
+ if(e.type == SDL_QUIT) {
+ keepGoing = 0;
+ break;
+ }
+ }
+ SDL_FillRect(screenSurface, NULL, SDL_MapRGB(screenSurface->format, 0xFF, 0x00, 0x00));
+ SDL_UpdateWindowSurface(window.get());
+ SDL_Delay(100);
+ }
+
+ return 0;
+}
diff --git a/manual tests/4 standalone binaries/myapp.icns b/manual tests/4 standalone binaries/myapp.icns
new file mode 100644
index 0000000..6331954
--- /dev/null
+++ b/manual tests/4 standalone binaries/myapp.icns
Binary files differ
diff --git a/manual tests/4 standalone binaries/myapp.iss b/manual tests/4 standalone binaries/myapp.iss
new file mode 100644
index 0000000..2bd441d
--- /dev/null
+++ b/manual tests/4 standalone binaries/myapp.iss
@@ -0,0 +1,18 @@
+; Innosetup file for My app.
+
+[Setup]
+AppName=My App
+AppVersion=1.0
+DefaultDirName={pf}\My App
+DefaultGroupName=My App
+UninstallDisplayIcon={app}\myapp.exe
+Compression=lzma2
+SolidCompression=yes
+OutputDir=.
+
+[Files]
+Source: "myapp.exe"; DestDir: "{app}"
+Source: "SDL2.dll"; DestDir: "{app}"
+
+;[Icons]
+;Name: "{group}\My App"; Filename: "{app}\myapp.exe"
diff --git a/manual tests/4 standalone binaries/myapp.sh b/manual tests/4 standalone binaries/myapp.sh
new file mode 100755
index 0000000..3191483
--- /dev/null
+++ b/manual tests/4 standalone binaries/myapp.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+cd "${0%/*}"
+
+if [ `uname` == 'Darwin' ]; then
+ ./myapp
+else
+ export LD_LIBRARY_PATH="`pwd`/lib"
+ bin/myapp
+fi
diff --git a/manual tests/4 standalone binaries/osx_bundler.sh b/manual tests/4 standalone binaries/osx_bundler.sh
new file mode 100755
index 0000000..3bad65f
--- /dev/null
+++ b/manual tests/4 standalone binaries/osx_bundler.sh
@@ -0,0 +1,6 @@
+#!/bin/sh -eu
+
+mkdir -p ${MESON_INSTALL_PREFIX}/Contents/Frameworks
+cp -R /Library/Frameworks/SDL2.framework ${MESON_INSTALL_PREFIX}/Contents/Frameworks
+
+install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 @executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2 ${MESON_INSTALL_PREFIX}/Contents/MacOS/myapp
diff --git a/manual tests/4 standalone binaries/readme.txt b/manual tests/4 standalone binaries/readme.txt
new file mode 100644
index 0000000..b689779
--- /dev/null
+++ b/manual tests/4 standalone binaries/readme.txt
@@ -0,0 +1,11 @@
+This directory shows how you can build redistributable binaries. On
+OSX this menans building an app bundle and a .dmg installer. On Linux
+it means building an archive that bundles its dependencies. On Windows
+it means building an .exe installer.
+
+To build each package you run the corresponding build_ARCH.sh build
+script.
+
+On Linux you must build the package on the oldest distribution you
+plan to support (Debian stable/oldstable and old CentOS are the common
+choice here).
diff --git a/manual tests/4 standalone binaries/template.dmg.gz b/manual tests/4 standalone binaries/template.dmg.gz
new file mode 100644
index 0000000..fcb6d61
--- /dev/null
+++ b/manual tests/4 standalone binaries/template.dmg.gz
Binary files differ
diff --git a/manual tests/5 rpm/lib.c b/manual tests/5 rpm/lib.c
new file mode 100644
index 0000000..efc230a
--- /dev/null
+++ b/manual tests/5 rpm/lib.c
@@ -0,0 +1,6 @@
+#include"lib.h"
+
+char *meson_print(void)
+{
+ return "Hello, world!";
+}
diff --git a/manual tests/5 rpm/lib.h b/manual tests/5 rpm/lib.h
new file mode 100644
index 0000000..08fc961
--- /dev/null
+++ b/manual tests/5 rpm/lib.h
@@ -0,0 +1 @@
+char *meson_print(void);
diff --git a/manual tests/5 rpm/main.c b/manual tests/5 rpm/main.c
new file mode 100644
index 0000000..8b1d193
--- /dev/null
+++ b/manual tests/5 rpm/main.c
@@ -0,0 +1,8 @@
+#include<lib.h>
+#include<stdio.h>
+int main(void)
+{
+ char *t = meson_print();
+ printf("%s", t);
+ return 0;
+}
diff --git a/manual tests/5 rpm/meson.build b/manual tests/5 rpm/meson.build
new file mode 100644
index 0000000..131da39
--- /dev/null
+++ b/manual tests/5 rpm/meson.build
@@ -0,0 +1,14 @@
+project('test spec', 'c')
+
+rpm = import('rpm')
+dependency('zlib')
+find_program('nonexistprog', required : false)
+
+lib = shared_library('mesontest_shared', ['lib.c', 'lib.h'],
+ version : '0.1', soversion : '0',
+ install : true)
+executable('mesontest-bin', 'main.c',
+ link_with : lib,
+ install : true)
+
+rpm.generate_spec_template()
diff --git a/manual tests/6 hg wrap/meson.build b/manual tests/6 hg wrap/meson.build
new file mode 100644
index 0000000..c7ac004
--- /dev/null
+++ b/manual tests/6 hg wrap/meson.build
@@ -0,0 +1,10 @@
+project('Mercurial outcheckker', 'c')
+
+sp = subproject('samplesubproject')
+
+exe = executable('gitprog', 'prog.c',
+include_directories : sp.get_variable('subproj_inc'),
+link_with : sp.get_variable('subproj_lib'),
+)
+
+test('maintest', exe)
diff --git a/manual tests/6 hg wrap/prog.c b/manual tests/6 hg wrap/prog.c
new file mode 100644
index 0000000..6e2c4d8
--- /dev/null
+++ b/manual tests/6 hg wrap/prog.c
@@ -0,0 +1,6 @@
+#include"subproj.h"
+
+int main(void) {
+ subproj_function();
+ return 0;
+}
diff --git a/manual tests/6 hg wrap/subprojects/samplesubproject.wrap b/manual tests/6 hg wrap/subprojects/samplesubproject.wrap
new file mode 100644
index 0000000..6d3b3f2
--- /dev/null
+++ b/manual tests/6 hg wrap/subprojects/samplesubproject.wrap
@@ -0,0 +1,4 @@
+[wrap-hg]
+directory=samplesubproject
+url=https://bitbucket.org/jpakkane/samplesubproject
+revision=tip
diff --git a/manual tests/7 vala composite widgets/meson.build b/manual tests/7 vala composite widgets/meson.build
new file mode 100644
index 0000000..579ca51
--- /dev/null
+++ b/manual tests/7 vala composite widgets/meson.build
@@ -0,0 +1,21 @@
+project('composite', 'vala', 'c')
+gnome = import('gnome')
+deps = [
+ dependency('glib-2.0', version : '>=2.38'),
+ dependency('gobject-2.0'),
+ dependency('gtk+-3.0'),
+]
+res = files('my-resources.xml')
+gres = gnome.compile_resources(
+ 'my', res,
+ source_dir : '.',
+)
+executable(
+ 'demo',
+ sources : [
+ 'mywidget.vala',
+ gres,
+ ],
+ dependencies : deps,
+ vala_args : ['--gresources', res],
+)
diff --git a/manual tests/7 vala composite widgets/my-resources.xml b/manual tests/7 vala composite widgets/my-resources.xml
new file mode 100644
index 0000000..b5743c1
--- /dev/null
+++ b/manual tests/7 vala composite widgets/my-resources.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/foo/my">
+ <file compressed="true" preprocess="xml-stripblanks">mywidget.ui</file>
+ </gresource>
+</gresources>
diff --git a/manual tests/7 vala composite widgets/mywidget.ui b/manual tests/7 vala composite widgets/mywidget.ui
new file mode 100644
index 0000000..2d6286c
--- /dev/null
+++ b/manual tests/7 vala composite widgets/mywidget.ui
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.8 -->
+ <template class="MyWidget" parent="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">This widget is defined with composite GtkBuilder script</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <signal name="changed" handler="on_entry_changed" object="MyWidget" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Press the button to fetch the internal entry text</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button">
+ <property name="label" translatable="yes">The Button</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">end</property>
+ <signal name="clicked" handler="on_button_clicked" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </template>
+</interface>
diff --git a/manual tests/7 vala composite widgets/mywidget.vala b/manual tests/7 vala composite widgets/mywidget.vala
new file mode 100644
index 0000000..68eaecc
--- /dev/null
+++ b/manual tests/7 vala composite widgets/mywidget.vala
@@ -0,0 +1,41 @@
+using Gtk;
+
+[GtkTemplate (ui = "/org/foo/my/mywidget.ui")]
+public class MyWidget : Box {
+ public string text {
+ get { return entry.text; }
+ set { entry.text = value; }
+ }
+
+ [GtkChild]
+ private Entry entry;
+
+ public MyWidget (string text) {
+ this.text = text;
+ }
+
+ [GtkCallback]
+ private void on_button_clicked (Button button) {
+ print ("The button was clicked with entry text: %s\n", entry.text);
+ }
+
+ [GtkCallback]
+ private void on_entry_changed (Editable editable) {
+ print ("The entry text changed: %s\n", entry.text);
+
+ notify_property ("text");
+ }
+}
+
+void main(string[] args) {
+ Gtk.init (ref args);
+ var win = new Window();
+ win.destroy.connect (Gtk.main_quit);
+
+ var widget = new MyWidget ("The entry text!");
+
+ win.add (widget);
+ win.show_all ();
+
+ Gtk.main ();
+}
diff --git a/manual tests/8 timeout/meson.build b/manual tests/8 timeout/meson.build
new file mode 100644
index 0000000..8ba7d4b
--- /dev/null
+++ b/manual tests/8 timeout/meson.build
@@ -0,0 +1,8 @@
+project('timeout', 'c')
+
+# This creates a test that times out. It is a manual test
+# because currently there is no test suite for test that are expected
+# to fail during unit test phase.
+
+exe = executable('sleepprog', 'sleepprog.c')
+test('timeout', exe, timeout : 1)
diff --git a/manual tests/8 timeout/sleepprog.c b/manual tests/8 timeout/sleepprog.c
new file mode 100644
index 0000000..8875e12
--- /dev/null
+++ b/manual tests/8 timeout/sleepprog.c
@@ -0,0 +1,6 @@
+#include<unistd.h>
+
+int main(void) {
+ sleep(1000);
+ return 0;
+}