File: run-examples

package info (click to toggle)
msgpack-c 6.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 596 kB
  • sloc: ansic: 3,573; cpp: 2,052; makefile: 27; sh: 22
file content (30 lines) | stat: -rwxr-xr-x 562 bytes parent folder | download
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
26
27
28
29
30
#!/bin/sh
set -e

SRCDIR=$(pwd)

cd "$AUTOPKGTEST_TMP"

[ -d example ] || cp -r "$SRCDIR"/example .

cat > CMakeLists.txt <<EOF
cmake_minimum_required(VERSION 3.16)
project(msgpack_autopkgtests)
find_package(msgpack-c REQUIRED CONFIG)
find_package(Threads)
add_subdirectory(example)
EOF

export CFLAGS

DIR="$AUTOPKGTEST_TMP/c"
mkdir -p "$DIR"
trap "rm -r '$DIR'" EXIT
cd "$DIR"

cmake -Wno-dev $CMAKE_ARGS ..
cmake --build .
for example_bin in $(find example -type f -perm /a+x); do
  echo "Testing example '$(basename "$example_bin")'"
  ./"$example_bin"
done