Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61740 - sandbox/example/libs/example/test
From: daniel_james_at_[hidden]
Date: 2010-05-02 18:37:06


Author: danieljames
Date: 2010-05-02 18:37:05 EDT (Sun, 02 May 2010)
New Revision: 61740
URL: http://svn.boost.org/trac/boost/changeset/61740

Log:
Quick test example.

Added:
   sandbox/example/libs/example/test/
   sandbox/example/libs/example/test/Jamfile.v2 (contents, props changed)
   sandbox/example/libs/example/test/bar_fail.cpp (contents, props changed)
   sandbox/example/libs/example/test/foo_test.cpp (contents, props changed)

Added: sandbox/example/libs/example/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/example/libs/example/test/Jamfile.v2 2010-05-02 18:37:05 EDT (Sun, 02 May 2010)
@@ -0,0 +1,18 @@
+
+# Copyright (C) 2008-2009 John Doe
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+# Run the example tests.
+
+# First create an alias for the boost unit test framework. You don't need this
+# if you're using minimal or lightweight test.
+
+use-project /boost/test : $(BOOST_ROOT)/libs/test/build ;
+alias boost_unit_test : /boost/test//boost_unit_test_framework/<link>static ;
+
+test-suite "example test"
+ :
+ [ run foo_test.cpp boost_unit_test ]
+ [ compile-fail bar_fail.cpp ]
+ ;

Added: sandbox/example/libs/example/test/bar_fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/example/libs/example/test/bar_fail.cpp 2010-05-02 18:37:05 EDT (Sun, 02 May 2010)
@@ -0,0 +1,12 @@
+
+// Copyright (C) 2008-2009 John Doe
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/example/example.hpp>
+
+int main()
+{
+ boost::example<int> a;
+ a.bar();
+}

Added: sandbox/example/libs/example/test/foo_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/example/libs/example/test/foo_test.cpp 2010-05-02 18:37:05 EDT (Sun, 02 May 2010)
@@ -0,0 +1,20 @@
+
+// Copyright (C) 2008-2009 John Doe
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/example/example.hpp>
+#include <boost/test/unit_test.hpp>
+
+void foo_test()
+{
+ boost::example<int> a;
+ a.foo();
+}
+
+boost::unit_test::test_suite* init_unit_test_suite(int, char* [])
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE("foo test");
+ test->add(BOOST_TEST_CASE(&foo_test));
+ return test;
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk