[ignition-cmake] 03/03: Update autopkg-test
Jose Luis Rivero
jrivero-guest at moszumanska.debian.org
Mon Nov 20 16:45:57 UTC 2017
This is an automated email from the git hooks/post-receive script.
jrivero-guest pushed a commit to branch master
in repository ignition-cmake.
commit 798f388c661e19102df834e75e36bf6f7a79b778
Author: Jose Luis Rivero <jrivero at osrfoundation.org>
Date: Mon Nov 20 16:45:51 2017 +0000
Update autopkg-test
---
debian/tests/build | 88 +++++++++++++++++-----------------------------------
debian/tests/control | 2 +-
2 files changed, 29 insertions(+), 61 deletions(-)
diff --git a/debian/tests/build b/debian/tests/build
index 5cf9a64..b8cfbc8 100755
--- a/debian/tests/build
+++ b/debian/tests/build
@@ -9,75 +9,43 @@ set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
-cat <<EOF > igntest.c
+cat <<EOF > CMakeLists.txt
+#============================================================================
+# Find ignition-cmake
+#============================================================================
+# If you get an error at this line, you need to install ignition-cmake
+find_package(ignition-cmake0 REQUIRED)
-#include <iostream>
-#include <ignition/math.hh>
+#============================================================================
+# Set up the project
+#============================================================================
+ign_configure_project(math 4.0.0)
-int main(int argc, char **argv)
-{
- // Create a triangle with the following vertices:
- // 1: x = -1, y = 0
- // 2: x = 0, y = 1
- // 3: x = 1, y = 0
- ignition::math::Triangled tri(
- ignition::math::Vector2d(-1, 0),
- ignition::math::Vector2d(0, 1),
- ignition::math::Vector2d(1, 0));
- // The individual vertices are accessible through the [] operator
- std::cout << "Vertex 1: " << tri[0] << "\n"
- << "Vertex 2: " << tri[1] << "\n"
- << "Vertex 3: " << tri[2] << "\n";
+#============================================================================
+# Set project-specific options
+#============================================================================
- // Each side of the triangle is also accessible via the Side function
- std::cout << "Side 1: " << tri.Side(0) << "\n"
- << "Side 2: " << tri.Side(1) << "\n"
- << "Side 3: " << tri.Side(2) << "\n";
+# ignition-math currently has no options that are unique to it
- // It's also possible to set each vertex individually.
- tri.Set(0, ignition::math::Vector2d(-10, 0));
- tri.Set(1, ignition::math::Vector2d(0, 20));
- tri.Set(2, ignition::math::Vector2d(10, 2));
- // Or set all the vertices at once.
- tri.Set(ignition::math::Vector2d(-1, 0),
- ignition::math::Vector2d(0, 1),
- ignition::math::Vector2d(1, 0));
+#============================================================================
+# Search for project-specific dependencies
+#============================================================================
- // You can get the perimeter length and area of the triangle
- std::cout << "Perimeter=" << tri.Perimeter()
- << " Area=" << tri.Area() << "\n";
+# ignition-math currently has no dependencies that are unique to it
- // The Contains functions check if a line or point is inside the triangle
- if (tri.Contains(ignition::math::Vector2d(0, 0.5)))
- std::cout << "Triangle contains the point 0, 0.5\n";
- else
- std::cout << "Triangle does not contain the point 0, 0.5\n";
+#============================================================================
+# Configure the build
+#============================================================================
+ign_configure_build(QUIT_IF_BUILD_ERRORS)
- // The Intersect function check if a line segment intersects the triangle.
- // It also returns the points of intersection
- ignition::math::Vector2d pt1, pt2;
- if (tri.Intersects(ignition::math::Line2d(-2, 0.5, 2, 0.5), pt1, pt2))
- {
- std::cout << "A line from (-2, 0.5) to (2, 0.5) intersects "
- << "the triangle at the\nfollowing points:\n"
- << "\t Pt1=" << pt1 << "\n"
- << "\t Pt2=" << pt2 << "\n";
- }
- else
- {
- std::cout << "A line from (-2, 0.5) to (2, 0.5) does not intersect "
- << "the triangle\n";
- }
- // There are more functions in Triangle. Take a look at the API;
- // http://ignitionrobotics.org/libraries/ign_mat/api
-}
+#============================================================================
+# Create package information
+#============================================================================
+ign_create_packages()
EOF
-g++ -o igntest igntest.c `pkg-config --cflags --libs ignition-math3`
-echo "build: OK"
-[ -x igntest ]
-./igntest
-echo "run: OK"
+cmake .
+echo "configure: OK"
diff --git a/debian/tests/control b/debian/tests/control
index 13f08fa..2cbb565 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,2 @@
Tests: build
-Depends: libignition-math3-dev, pkg-config, build-essential
+Depends: libignition-cmake-dev, cmake
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ignition-cmake.git
More information about the debian-science-commits
mailing list