File: testsuite

package info (click to toggle)
libjsoncpp 1.7.2-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,720 kB
  • sloc: cpp: 8,041; python: 1,557; ansic: 168; makefile: 41; sh: 33
file content (41 lines) | stat: -rw-r--r-- 1,078 bytes parent folder | download | duplicates (2)
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
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
# Copyright 2016 Ghislain Antony Vaillant <ghisvail@gmail.com>
#
# This file is part of the autopkgtest testsuite for the libjsoncpp
# source package.

set -e

# Presence of $ADTTMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$ADTTMP" ]
then
        echo "Required envvar \"$ADTTMP\"is not set" >&2
        exit 1
fi

# Copy testsuite source code.
cp -a ./src/test_lib_json/* "$ADTTMP"
cd "$ADTTMP"

cat <<EOF > CMakeLists.txt
cmake_minimum_required(VERSION 2.6.2)
project(jsoncpp_test)

find_package(jsoncpp REQUIRED)
# Using pkg-config instead of cmake config-mode because the
# packaged jsoncppConfig.cmake does not seem to work beyond detection.
find_package(PkgConfig)
pkg_check_modules(PC_jsoncpp QUIET jsoncpp)
include_directories(\${PC_jsoncpp_INCLUDE_DIRS})
link_libraries(\${PC_jsoncpp_LIBRARIES})

add_executable(jsoncpp_test main.cpp jsontest.cpp jsontest.h)

EOF

# Configure, build and execute.
mkdir build && cd build
cmake ..
make VERBOSE=1 -j$(nproc)
./jsoncpp_test