Skip to content

Commit

Permalink
Merge branch 'release/0_3_469'
Browse files Browse the repository at this point in the history
  • Loading branch information
lcaminiti committed Sep 5, 2017
2 parents d1a259c + 53dd64c commit 0cad528
Show file tree
Hide file tree
Showing 406 changed files with 33,285 additions and 0 deletions.
4 changes: 4 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Copyright (C) 2009-2010 Lorenzo Caminiti.
Use, modification, and distribution is subject to the
Contract++ Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt.)
27 changes: 27 additions & 0 deletions LICENSE_1_0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(File: LICENSE_1_0.txt)

Contract Programming for C++ (Contract++) Software License, Version 1.0
April 19th, 2009

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

62 changes: 62 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright (C) 2009-2010 Lorenzo Caminiti.
# Use, modification, and distribution is subject to the
# Contract++ Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt.)

# Default target.
help:
@echo "Contract Programming for C++ (Contract++)"
@echo
@echo "This library does not need to be built. It is composed of "
@echo "C++ header files only (contained in the \"src/\" directory)."
@echo
@echo "make [OPTION] example"
@echo " Build example programs to \"build/example/\" and their"
@echo " code documentation to \"codedoc/example/\"."
@echo
@echo "make [OPTION] test"
@echo " Build test programs to \"build/test/\" and their"
@echo " code documentation to \"codedoc/test/\"."
@echo
@echo "make doc"
@echo " Build libaray HTML documentation into \"doc/html/\" (requires"
@echo " Boost.QuickBook to be installed and compiled on your system)."
@echo
@echo "make clean"
@echo " Clean all (build etc)."
@echo
@echo "OPTION"
@echo " CXX Specify 'GCC' to use GNU C++ compiler 'g++' (e.g., on"
@echo " Linux) or 'MSVC' to use Microsoft Visual C++ compiler "
@echo " (e.g., MSVC version 8 under Cygwin). CXX=GCC by default."
@echo " debug Specify '1' to enable library debug messages and"
@echo " C++ debug symbols."
@echo
@echo "EXAMPLE"
@echo " # Build all examples using g++ with debug messages enabled."
@echo " make CXX=GCC debug=1 example# Build all examples using g++"
exit 0

force_:

clean: force_
rm -rf build/*

example: force_
make -f example/Makefile

test: force_
make -f test/Makefile

doc: force_
# Requires Boost.QuickBook to be installed and compiled on your system.
# Workaround: QuickBook uses all full paths but the ones relative to "boost/", Perl removes full path prefixes from HTML.
cd ../boost-quickbook/doc && bjam --v2 && perl -p -i -e 'use Cwd; $$x=getcwd()."/qbk/src/contract"; s/$$x/contract/g' html/*.html html/contract/*.html
# Copies documentation examples into doc/html directory.
tmp="/tmp/contract-example.`date +%s`" && mkdir -p $$tmp && cp -R example $$tmp && find $$tmp -depth -name ".svn" -exec rm -rf {} \; && cp -R $$tmp/example doc/html
clean_doc: force_
rm -rf doc/html/*.html
rm -rf doc/html/contract/*.html
rm -rf doc/html/contract__/*.html
find doc/html/example -depth -name "*.[hc]pp -exec rm -rf {} \;

23 changes: 23 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

Contract Programming for C++ (Contract++)
=========================================

See "doc/html/index.html" for the library documentation.

All Contract Programming features of the Eiffel programming language
are supported by this library, among others:
* Optional compilation and checking of invariants, preconditions,
and postconditions.
* Customizable actions on contract failure (terminate by default
but it can throw, exit, etc).
* Subcontracting for derived classes (with support for multiple
inheritance).
* Access to "old" variable values (before body execution) and
return value "result" in postconditions.
* Block invariants and loop variants.

Files organization:
* All library source is in the "src/" directory.
* Examples are in "example/" and test programs in "test/".
* Run `make' in the main directory to see how to build examples, etc.

1 change: 1 addition & 0 deletions bin/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Binary tools to support library maintainance.
18 changes: 18 additions & 0 deletions bin/env-MSVC8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# source this `$ source THIS_FILE'.

# Can be executed, for example under Cygwin, to setup enviroment to run
# Microsoft Visual C++ command line compiler `cl.exe'.

msvc="E:\bin\Microsoft Visual Studio 8"
echo "bin/env-MSVC8.sh: Assuming MVSC 8 installed at \"$msvc\" -- is this correct?"

# Setup Cygwin PATH.
export PATH="$PATH:/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/IDE:/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/BIN:/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/Tools:/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/Tools/bin:/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/bin:/cygdrive/c/Program Files/Microsoft Visual Studio 8/SDK/v2.0/bin:/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727:/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/VCPackages:/cygdrive/c/oracle/ora81/bin:/cygdrive/c/Program Files/Oracle/jre/1.1.7/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/Program Files/TortoiseSVN/bin:/cygdrive/c/Program Files/Windows Imaging/:"

# MSVC INCLUDE for this libray ./include, Boost 1.34.0, and MSVC 8.
export INCLUDE="./include;C:\Program Files\boost\boost_1_34_0;$msvc\VC\ATLMFC\INCLUDE;$msvc\VC\INCLUDE;$msvc\VC\PlatformSDK\include;$msvc\SDK\v2.0\include;"

# MSVC LIB.
export LIB="$msvc\VC\ATLMFC\LIB;$msvc\VC\LIB;$msvc\VC\PlatformSDK\lib;$msvc\SDK\v2.0\lib;"


78 changes: 78 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

dbc_dir=`pwd`

# Preconditions.
echo -en "Did you add the release notes in the documentation? (Y/n) "; read ci
if [ "$ci" != "Y" ]; then
echo -en "ERROR: You must add the release notes before releasing\n"
exit 1;
fi
echo -en "Did you commit to SVN? (Y/n) "; read ci
if [ "$ci" != "Y" ]; then
echo -en "ERROR: You must commit before releasing\n"
exit 1;
fi

# Load release number.

old_major=`cat $dbc_dir/bin/release.dat | egrep "^Major: .*$" | sed 's/^Major: //'`
old_minor=`cat $dbc_dir/bin/release.dat | egrep "^Minor: .*$" | sed 's/^Minor: //'`
old_rev=`cat $dbc_dir/bin/release.dat | egrep "^Revision: .*$" | sed 's/^Revision: //'`

new_rev=`svn info | egrep "^Revision: .*$" | sed 's/^Revision: //'`

echo
echo "release-number := major.minor.subversion-revision"
echo -en "New major release number [old = $old_major]: "; read new_major
if [ -z "$new_major" ]; then new_major=$old_major; fi
echo -en "New minor release number [old = $old_minor]: "; read new_minor
if [ -z "$new_minor" ]; then new_minor=$old_minor; fi
echo -en "New revision: $new_rev (current SVN revision)\n"

name=contractpp_${new_major}_${new_minor}_${new_rev}

# Tar ball from trunk.
echo
echo "Exporting SVN repository..."
cd /tmp
svn export https://dbcpp.svn.sourceforge.net/svnroot/dbcpp/trunk $name
tar czf $name.tar.gz $name

# Save release number.
echo """# Lateset release-number := major.minor.subversion-revision
Major: $new_major
Minor: $new_minor
Revision: $new_rev" > $dbc_dir/bin/release.dat

# Manual steps.
echo -en """
IMPORTANT: To complete the release do the following manual steps.
RELEASE FILE
1. Log into 'http://sourceforge.net/projects/dbcpp/' as administrator.
2. In the Summary page, click EDIT next to the download area.
3. Left click on the gear next to the \"/releases\" directory.
4. Click 'Upload here' and upload \"/tmp/$name.tar.gz\".
5. Select the uploaded files and click Save (no need to specify label, etc).
The latest uploaded files is automatically set to the download file.
DOCUMENTATION
1. Open Places > Home and click on Go > Location.
2. Enter 'sftp://<USER_NAME>,[email protected]' and type the password.
3. Go to 'home/groups/d/db/dbcpp/htdocs' (website directory).
4. Remove all files from this directory (old documentation).
5. Copy (drag-n-drop) all files from 'trunk/doc/html/*' into the 'htdocs'
directory opened via sftp.
DEVELOPMENT STATUS
0. Update release status (Alpha, Beta, etc) but only if really necessary.
1. Log into 'http://sourceforge.net/projects/dbcpp/' as administrator.
2. In the Summary page, click EDIT next to the library title.
3. Click Edit Trove Categorization (on the right).
4. Edit the Development Status.
SUBVERSION
1. Commit this sandbox to SVN -- local modiciations made by this script.
"""

4 changes: 4 additions & 0 deletions bin/release.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Lateset release-number := major.minor.subversion-revision
Major: 0
Minor: 3
Revision: 467
69 changes: 69 additions & 0 deletions doc/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (C) 2009-2010 Lorenzo Caminiti.
# Use, modification, and distribution is subject to the
# Contract++ Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt.)

# To compile the documention:
# 1. Boost source code must be compiled and installed on your system.
# 2. Compiled Boost code must be at the same level as trunk.
# 3. Create symbolic links in compiled Boost code directory to the trunk files.

import path ;
import quickbook ;
using boostbook ;
using doxygen ;

path-constant here : . ;

doxygen reference
:
# This order does not matter (always alphabetic in doc).
$(here)/qbk/src/contract.hpp
[ glob $(here)/qbk/src/contract/*.hpp ]
:
# Most of these Doxygen options seem not to work... maybe they are overridden by Boost...
<doxygen:param>CREATE_SUBDIRS=NO
# Header files are included anyway -- user will get an error...
<doxygen:param>VERBATIM_HEADERS=NO
<doxygen:param>INLINE_SOURCES=NO
# Full path is used anyway for anything but "boost/*"...
<doxygen:param>FULL_PATH_NAMES=NO
<doxygen:param>STRIP_FROM_PATH=$(here)/qbk/src/
<doxygen:param>STRIP_FROM_INC_PATH=$(here)/qbk/src/
# These options seem to work instead.
<doxygen:param>EXTRACT_ALL=YES
<doxygen:param>HIDE_UNDOC_MEMBERS=NO
<doxygen:param>EXTRACT_PRIVATE=NO
<doxygen:param>SEARCH_INCLUDES=NO
# Special Doxygen commands required by this doc.
<doxygen:param>ALIASES=" Params=\"<b>Parameters:</b> <table border="0">\" Param{2}=\"<tr><td><b><tt>\\1</tt></b></td><td>\\2</td></tr>\" EndParams=\"</table>\" Returns=\"<b>Returns:</b>\" Note=\"<b>Note:</b>\" Warning=\"<b>Warning:</b>\" See=\"<b>See:</b>\" "
<reftitle>"Reference"
;

xml contract
:
qbk/contract.qbk
:
<dependency>qbk/introduction.qbk
<dependency>qbk/getting_started.qbk
<dependency>qbk/tutorial.qbk
<dependency>qbk/without_the_macros.qbk
<dependency>qbk/throw_on_failure.qbk
<dependency>qbk/contract_programming.qbk
<dependency>qbk/examples.qbk
<dependency>reference
<dependency>qbk/bibliography.qbk
<dependency>qbk/release_history.qbk
<dependency>qbk/license.qbk
<dependency>qbk/todo.qbk
;

boostbook standalone
:
contract
:
<xsl:param>toc.max.depth=1
<xsl:param>boost.root="."
<xsl:param>html.stylesheet=doc/html/boostbook.css
;

1 change: 1 addition & 0 deletions doc/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The library documentation.
68 changes: 68 additions & 0 deletions doc/html/CONTRACT_ASSERT.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Macro CONTRACT_ASSERT</title>
<link rel="stylesheet" href="doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="Contract++ 0.3.469">
<link rel="up" href="reference.html#header..home.lcaminiti.sandbox.dbcpp_sourceforge.boost-quickbook.doc.qbk.src.contract.assert_hpp" title="Header &lt;contract/assert.hpp&gt;">
<link rel="prev" href="contract/postcondition_failed.html" title="Function postcondition_failed">
<link rel="next" href="CONTRACT_ASSERT_MSG.html" title="Macro CONTRACT_ASSERT_MSG">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="spirit-nav">
<a accesskey="p" href="contract/postcondition_failed.html"><img src="./doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header..home.lcaminiti.sandbox.dbcpp_sourceforge.boost-quickbook.doc.qbk.src.contract.assert_hpp"><img src="./doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="./doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_MSG.html"><img src="./doc/html/images/next.png" alt="Next"></a>
</div>
<hr>
<div class="refentry" lang="en">
<a name="CONTRACT_ASSERT"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Macro CONTRACT_ASSERT</span></h2>
<p>CONTRACT_ASSERT</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="emphasis"><em>// In header: &lt;<a class="link" href="reference.html#header..home.lcaminiti.sandbox.dbcpp_sourceforge.boost-quickbook.doc.qbk.src.contract.assert_hpp" title="Header &lt;contract/assert.hpp&gt;">contract/assert.hpp</a>&gt;

</em></span>CONTRACT_ASSERT(boolean_condition)</pre></div>
<div class="refsect1" lang="en">
<a name="id2652076"></a><h2>Description</h2>
<p>Macro used to assert contract conditions for class invariants, preconditions, and postconditions.</p>
<p>Whenever possible, it is recommended to use this macro instead of throwing <code class="computeroutput">contract::failure</code> directly. For example (see the Tutorial section for more information): </p>
<pre class="programlisting"> CONTRACT_ASSERT( true );
</pre>
<p>The code asserting the specified boolean condition is used as the description of the assertion (otherwise use <code class="computeroutput">CONTRACT_ASSERT_MSG()</code>).</p>
<p><span class="bold"><strong>Parameters:</strong></span> </p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<tbody><tr>
<td><span class="bold"><strong><code class="computeroutput">boolean_condition</code></strong></span></td>
<td>The boolean contract condition being asserted. </td>
</tr></tbody>
</table></div>
<p>
</p>
<p><span class="bold"><strong>Returns:</strong></span> This macro expands to code equivalent to the following (see the Without the Macros section): </p>
<pre class="programlisting"> if (!(boolean_condition))
throw contract::failure(__FILE__, __LINE__, # boolean_condition);
</pre>
<p> Note how <code class="computeroutput">__FILE__</code> and <code class="computeroutput">__LINE__</code> are automatically used by the macro to improve error reporting. (The preprocessor operator <code class="computeroutput">#</code> makes a string from the specified token.)</p>
<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_ASSERT_MSG()</code>, <code class="computeroutput">contract::failure</code> </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2009 -2010 Lorenzo Caminiti<p>
Distributed under the Contract++ Software License, Version 1.0 (see accompanying
file LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="contract/postcondition_failed.html"><img src="./doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header..home.lcaminiti.sandbox.dbcpp_sourceforge.boost-quickbook.doc.qbk.src.contract.assert_hpp"><img src="./doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="./doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="CONTRACT_ASSERT_MSG.html"><img src="./doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Loading

0 comments on commit 0cad528

Please sign in to comment.