-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
351 changed files
with
37,520 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(File: LICENSE_1_0.txt) | ||
|
||
Design By Contract for C++ (DBC++) 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
all: | ||
@echo "Design by Contract for C++ (DbC++)" | ||
@echo | ||
@echo "This library does not need to be build. It is composed only of " | ||
@echo "C/C++ header files contained int the \"./include/\" directory." | ||
@echo | ||
@echo "make install Install DbC++ files onto your system (you might " | ||
@echo " need to be root). This will prompt for path." | ||
@echo "make doc Build library documentation as" | ||
@echo " \"./build/doc/index.html\"." | ||
@echo "make example Build example programs in \"./build/example/\" and" | ||
@echo " Doxygen documentation in \"./codedoc/example/\"." | ||
@echo "make test Build test programs in \"./build/test/\" and" | ||
@echo " Doxygen documentation in \"./codedoc/test/\"." | ||
exit 0 | ||
|
||
force_: | ||
|
||
install: | ||
bin/install | ||
|
||
example: force_ | ||
make -f build/Makefile.example | ||
|
||
test: force_ | ||
make -f build/Makefile.test | ||
|
||
doc: force_ | ||
rm -f doc/html/*.* | ||
rm -f doc/html/str/*.* | ||
# Build str example, run it to upd str.out, create its doc. | ||
make -f build/Makefile.example str_codeapi | ||
make -f build/Makefile.example str | ||
/bin/bash -c "./build/example/str &> doc/src/str.out" | ||
doxygen doc/src/Doxyfile.str | ||
# Create library doc (will href to str example). | ||
cd doc/src && doxygen # From doc/src for correct path names. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Design By Contract for C++ (DBC++) | ||
================================== | ||
|
||
The DBC++ library supports Design By Contract (DBC) for the C++ programming | ||
language. | ||
|
||
Essentially, all Eiffel programming language DBC features are supported by | ||
DBC++. Among others: | ||
1) "old" prefix in postconditions; | ||
2) Subcontracting; | ||
3) Optional contract compilation; | ||
4) Full integration with Doxygen. | ||
|
||
IMPORTANT: The library is still under development, its API should be | ||
considered experimental and subject to change. | ||
|
||
The documentation is yet to be written. Please look at the examples in the | ||
"example/" directory for illustrations on how to use the library. In | ||
particular, the followings are good examples to get started: | ||
"example/OO_SW_Contruction/Stack4" | ||
"example/DBC_by_Example/NameList" | ||
|
||
Run `make' to see how to build examples, test, install, etc. | ||
|
||
The library requires the C++ Boost library http://www.boost.org/. In particular | ||
Boost.Preprocessor and Boost.MPL are required. | ||
|
||
|
||
INSTALL | ||
------- | ||
|
||
To install run `make install'. | ||
|
||
The library is composed of C/C++ header files only so it does not need to be | ||
built. The library files are contained in the "include/" directory, they are: | ||
"include/dbc.hpp" Main file that includes entire library. | ||
"include/dbc/*" All other header files that implement the library. | ||
|
||
Executing `make install' will copy these files into your system include | ||
directory (e.g., "/usr/include/" by default on Linux systems). Make sure the | ||
directory on which you specify to copy the files is included in your C/C++ | ||
compiler include path (e.g., "-I" option for the gcc compiler) then you can | ||
include and use the library simply specifying "#include <dbc.hpp>" at the top | ||
of your C/C++ files. | ||
|
||
|
||
RELEASE HISTORY | ||
--------------- | ||
|
||
Release number convention: | ||
Release_Number ::= Major_Revision.Minor_Revision.SVN_Revision | ||
|
||
(Release history, from newest to oldest release.) | ||
Release 0.1.55 (2009-04-19) | ||
Reorganized files to cleanup root directory. | ||
Added installation program. | ||
Release 0.1.50 (2009-04-19) | ||
First public release. | ||
|
||
|
||
LICENSE | ||
------- | ||
|
||
Copyright (C) 2009 Lorenzo Caminiti. Distributed under DBC++ Software License | ||
(see file LICENSE_1_0.txt). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Binary files, programs, and scripts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
echo "Design By Contract for C++ (DBC++) Library Installation" | ||
|
||
dest="" | ||
echo | ||
echo -en "Enter C/C++ header files directory [/use/include/]: " | ||
read dest | ||
if [ -z $dest ]; then dest="/usr/include/"; fi | ||
|
||
mkdir -p $dest && cp -R include/dbc* $dest | ||
ret=$? | ||
echo | ||
if [ $ret -ne 0 ]; then | ||
echo "ERROR: Unable to copy DBC++ header files to \"$dest\"." | ||
echo "Do you need to be root to access this directory?" | ||
else | ||
echo "DBC++ header files successfully copied to \"$dest\"." | ||
echo "Make sure this directory is in your C/C++ headers path (-I compiler option) and you are ready to use DBC++." | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# Execute program given at command line. | ||
$@ | ||
|
||
# If program did not fail, return error code 1. | ||
if [ $? -eq 0 ]; then | ||
echo | ||
echo "must-fail: error: executed program did not fail as expected" | ||
echo | ||
exit 1; | ||
fi | ||
|
||
# Else (program failed), return OK code 0. | ||
echo | ||
echo "must-fail: executed program failed as expected -- returning OK" | ||
echo | ||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# On some installations rst2html is called rst2html.py. This scripts selects | ||
# the correct one. | ||
|
||
which rst2html &> /dev/null | ||
if [ $? -eq 0 ]; then | ||
rst2html $* | ||
exit $? | ||
fi | ||
|
||
which rst2html.py &> /dev/null | ||
if [ $? -eq 0 ]; then | ||
rst2html.py $* | ||
exit $? | ||
fi | ||
|
||
echo "ERROR: Unable to find rst2html (or rst2html.py) -- make sure it is installed and it is in your path" | ||
exit 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# $Id$ # | ||
|
||
def:=-DDBC_ALL -DDBC_CONFIG_LOG_LEVEL=DBC_LOG_LEVEL_ALL | ||
|
||
inc:=-I./include | ||
src:=./example | ||
build:=./build/example | ||
codedoc:=./codedoc/example | ||
|
||
all: DBC_by_Example OO_SW_Construction CPP_Prog_Lang doc | ||
|
||
clean: | ||
rm -rf build | ||
|
||
force_: | ||
|
||
Str: str str_codeapi | ||
str: force_ | ||
mkdir -p $(build) | ||
# Always compile with these -D (don't use 'def') -- this is how compiled in documentation text. | ||
g++ -Wall $(inc) -DDBC_ALL -DDBC_CONFIG_LOG_LEVEL=DBC_LOG_LEVEL_ALL $(src)/str/str.cpp -o $(build)/str | ||
str_codeapi: force_ | ||
mkdir -p $(build) | ||
# Always compile with these -D (don't use 'def') -- this is how compiled in documentation text. | ||
g++ -Wall $(inc) -DDBC_ALL -DDBC_CONFIG_LOG_LEVEL=DBC_LOG_LEVEL_ALL $(src)/str/str-codeapi.cpp -o $(build)/str-codeapi | ||
|
||
DBC_by_Example: CustomerManager Stack Dictionary SimpleQueue Courier NameList Observer Counter | ||
CustomerManager: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/DBC_by_Example/CustomerManager/CustomerManager.cpp $(src)/DBC_by_Example/CustomerManager/main.cpp -o $(build)/CustomerManager | ||
Stack: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/DBC_by_Example/Stack/main.cpp -o $(build)/Stack | ||
Dictionary: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/DBC_by_Example/Dictionary/main.cpp -o $(build)/Dictionary | ||
SimpleQueue: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/DBC_by_Example/SimpleQueue/main.cpp -o $(build)/SimpleQueue | ||
Courier: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/DBC_by_Example/Courier/couriers.cpp $(src)/DBC_by_Example/Courier/main.cpp -o $(build)/Courier | ||
NameList: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/DBC_by_Example/NameList/names.cpp $(src)/DBC_by_Example/NameList/main.cpp -o $(build)/NameList | ||
Observer: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/DBC_by_Example/Observer/main.cpp -o $(build)/Observer | ||
Counter: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/DBC_by_Example/Counter/main.cpp -o $(build)/Counter | ||
|
||
OO_SW_Construction: Gcd Stack4 Stack3 | ||
Gcd: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/OO_SW_Construction/Gcd/main.cpp -o $(build)/Gcd | ||
Stack4: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/OO_SW_Construction/Stack4/main.cpp -o $(build)/Stack4 | ||
Stack3: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/OO_SW_Construction/Stack3/main.cpp -o $(build)/Stack3 | ||
|
||
CPP_Prog_Lang: String | ||
String: force_ | ||
mkdir -p $(build) | ||
g++ -Wall $(inc) $(def) $(src)/CPP_Prog_Lang/String/main.cpp -o $(build)/String | ||
|
||
doc: force_ | ||
mkdir -p $(codedoc) | ||
doxygen codedoc/Doxyfile.example | ||
|
Oops, something went wrong.