From 70f21759d03cfc930d26f8abac0d56a8279276b8 Mon Sep 17 00:00:00 2001 From: Richard Dale Date: Tue, 21 May 2013 11:11:04 +0100 Subject: Add detection for cmake and qmake build systems Add tests for cmake and qmake build systems --- tests.build/build-system-cmake.script | 59 +++++++++++++++++++++++++++++++++ tests.build/build-system-cmake.stdout | 8 +++++ tests.build/build-system-qmake.script | 61 +++++++++++++++++++++++++++++++++++ tests.build/build-system-qmake.stdout | 8 +++++ 4 files changed, 136 insertions(+) create mode 100755 tests.build/build-system-cmake.script create mode 100644 tests.build/build-system-cmake.stdout create mode 100755 tests.build/build-system-qmake.script create mode 100644 tests.build/build-system-qmake.stdout (limited to 'tests.build') diff --git a/tests.build/build-system-cmake.script b/tests.build/build-system-cmake.script new file mode 100755 index 00000000..00b9ed23 --- /dev/null +++ b/tests.build/build-system-cmake.script @@ -0,0 +1,59 @@ +#!/bin/sh +# +# Copyright (C) 2011-2013 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +## Convert the hello-chunk project to something cmake-like, then +## build it. + +set -eu + +chunkrepo="$DATADIR/chunk-repo" +cd "$chunkrepo" + +git checkout --quiet farrokh + +cat <<'EOF' >CMakeLists.txt +cmake_minimum_required(VERSION 2.8) +project(hello) + +set(hello_SOURCES hello.c) +add_executable(hello ${hello_SOURCES}) +install(TARGETS hello RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +EOF + +git add CMakeLists.txt + +cat < hello.morph +{ + "name": "hello", + "kind": "chunk", + "build-system": "cmake", + "install-commands": ["make DESTDIR=\"\$DESTDIR\" install"] +} +EOF +git add hello.morph +git commit --quiet -m "Convert hello to a cmake project" + +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo master hello-system + +for chunk in "$DATADIR/cache/artifacts/"*.chunk.* +do + echo "$chunk:" | sed 's/[^.]*//' + tar -tf "$chunk" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' + echo +done diff --git a/tests.build/build-system-cmake.stdout b/tests.build/build-system-cmake.stdout new file mode 100644 index 00000000..ccf80a86 --- /dev/null +++ b/tests.build/build-system-cmake.stdout @@ -0,0 +1,8 @@ +.chunk.hello: +./ +baserock/ +baserock/hello.meta +usr/ +usr/bin/ +usr/bin/hello + diff --git a/tests.build/build-system-qmake.script b/tests.build/build-system-qmake.script new file mode 100755 index 00000000..c9175b99 --- /dev/null +++ b/tests.build/build-system-qmake.script @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Copyright (C) 2011-2013 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +## Convert the hello-chunk project to something qmake-like, then +## build it. + +set -eu + +chunkrepo="$DATADIR/chunk-repo" +cd "$chunkrepo" + +git checkout --quiet farrokh + +cat <<'EOF' >hello.pro +TEMPLATE = app +TARGET = hello +DEPENDPATH += . +INCLUDEPATH += . + +SOURCES += hello.c +hello.path = /usr/bin +hello.files = hello +INSTALLS += hello +EOF +git add hello.pro + +cat < hello.morph +{ + "name": "hello", + "kind": "chunk", + "build-system": "qmake", + "install-commands": ["make INSTALL_ROOT=\"\$DESTDIR\" install"] +} +EOF +git add hello.morph +git commit --quiet -m "Convert hello to an qmake project" + +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo master hello-system + +for chunk in "$DATADIR/cache/artifacts/"*.chunk.* +do + echo "$chunk:" | sed 's/[^.]*//' + tar -tf "$chunk" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' + echo +done diff --git a/tests.build/build-system-qmake.stdout b/tests.build/build-system-qmake.stdout new file mode 100644 index 00000000..ccf80a86 --- /dev/null +++ b/tests.build/build-system-qmake.stdout @@ -0,0 +1,8 @@ +.chunk.hello: +./ +baserock/ +baserock/hello.meta +usr/ +usr/bin/ +usr/bin/hello + -- cgit v1.2.1