File: gli-tests

package info (click to toggle)
gli 0.8.2.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 16,136 kB
  • ctags: 2,371
  • sloc: cpp: 17,205; sh: 24; makefile: 10
file content (42 lines) | stat: -rwxr-xr-x 938 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
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
# Copyright 2016 Ghislain Antony Vaillant
#
# This file is part of the packaging testsuite for gli.

set -e

# Copy the upstream CMake lists and testsuite.
cp -a ./data/ ./test/* $AUTOPKGTEST_TMP
cd $AUTOPKGTEST_TMP

# Create a standalone project.
rm CMakeLists.txt
cat << EOF > CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(glm-tests)

enable_testing()

add_definitions(-DSOURCE_DIR="\${CMAKE_CURRENT_SOURCE_DIR}")

find_package(gli REQUIRED)
include_directories(SYSTEM \${gli_INCLUDE_DIRS})

find_package(glm REQUIRED)
include_directories(SYSTEM \${glm_INCLUDE_DIRS})

function(glmCreateTestGTC NAME)
  set(SAMPLE_NAME test-\${NAME})
  add_executable(\${SAMPLE_NAME} \${NAME}.cpp)
  add_test(NAME \${SAMPLE_NAME}
           COMMAND \$<TARGET_FILE:\${SAMPLE_NAME}>)
endfunction()

add_subdirectory(bug)
add_subdirectory(core)

EOF

# Configure, build and run.
mkdir build && cd build
cmake .. && make && make test