summaryrefslogtreecommitdiffstats
path: root/debian/tests/basicmeson
blob: 1dd3a7fc90d9f77ec431cb9ab88032f438cff964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

set -eu

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > meson.build
project('debian package test', 'c')
e = executable('prog', 'prog.c')
test('debtest', e)
EOF
cat <<EOF > prog.c
int main(int argc, char **argv) {
  return 0;
}
EOF
mkdir build
CC=gcc meson build
cd build
ninja test
# Test that conf tools and build regeneration works.
meson introspect . --tests > /dev/null
meson configure -Dbuildtype=debugoptimized
ninja test