From ec688b4723a041044226358bcd4dd6e2da39da49 Mon Sep 17 00:00:00 2001 From: Luca Muscariello Date: Thu, 23 Feb 2017 17:01:02 +0100 Subject: Initial commit: cframework. Longbow and Libparc Change-Id: I90378dbd30da6033b20fb1f829b3b822cf366c59 Signed-off-by: Luca Muscariello --- longbow/README.md | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 longbow/README.md (limited to 'longbow/README.md') diff --git a/longbow/README.md b/longbow/README.md new file mode 100644 index 00000000..66c75d1e --- /dev/null +++ b/longbow/README.md @@ -0,0 +1,112 @@ +LongBow +======= +_The Best Defense is a Good Offense_ + +The LongBow C language software framework + +## Quick Start ## +``` +$ git clone -b cframework/master https://gerrit.fd.io/r/cicn cframework +$ cd cframework/longbow +$ mkdir build +$ cd build +$ cmake .. +$ make +$ make test +$ make install +``` + +## Introduction ## + +LongBow is a C language software framework that combines the fail-fast philosophy of an offensive-stance of program +development and xUnit style unit testing. Using LongBow's to aid an offensive-development stance is largely a matter +of using its entry and exit assertions in your code. Similarly using LongBow's unit-test framework uses the same entry +and exit assertions in the unit test cases themselves. The runtime assertions and the unit-test assertions work +together in the unit test framework and do not conflict. This framework grew out of the need for a unit testing for +Test Driven Development on the CCNx Distillery software distribution. +Two other test frameworks were considered and used to develop unit tests: Unity and GoogleTest. Ultimately Unity +was not used (although this framework is indebted to Unity for inspiration) mainly due to ease-of-use problems, +and Googletest was not used mainly because it is a C++ framework, is not compatible with some features of C99, and is +difficult to use. + +## Using LongBow ## + +### Platforms ### + +LongBow has been tested in: + +- Ubuntu 16.04 (x86_64) +- Debian Testing +- MacOSX 10.12 + +Other platforms and architectures may work. + +### Dependencies ### + +- c99 (clang / gcc) +- CMake 3.4 +- Python 2.7 + +While the LongBow unit test framework and runtime assertions don't have any unusual requirements other than CMake, +the software quality development tools that LongBow provides can make use of the following tools: + +- Doxygen +- Uncrustify + +### Using LongBow ### + +#### LongBow Lib + +To use LongBow in your software you will need to link your programs to the LongBow libraries. +Longbow comes as a set of libraries. A main library and a set of reporting libraries. Your software will need to +link to the main library (`liblongbow`) and one of the reporting libraries. Currently there are 2 reporting libraries +available `longbow-textplain` and `longbow-ansiterm`. + +``` +LONGBOW_DIR= + +-I${LONGBOW_DIR}/include -L${LONGBOW_DIR}/lib -llongbow -llongbow_textplain.a +``` + +#### LongBow Unit Testing + +LongBow unit testing works in conjuction with the LongBow library. Please take a look at the examples and the +documentation for information on how to write unit tests. You can also look at some of the software that uses LongBow +for unit testing as examples. A good starting point would be Libparc. + +#### LongBow Utilities + +LongBow comes with a set of utilities (scripts) to make C programs better. This includes code analysis and reporting +tools. You will find these in the `${INSTALL_DIR}/bin` directory. Each of those utilities should come with a `-h` +option that will give you online help. For more information please check the LongBow documentation. + +### GDB and LongBow ### +LongBow uses signals to interrupt program flow when an assertion fails. +When using `gdb` this will cause `gdb` to stop running of the test which probably isn't what you want. +You probably would prefer that gdb just ignore the signal and let the LongBow unit test signal handler take care of the +signal. To do this, you must configure `gdb` to ignore the signal and to allow it to pass to the programme being +executed. + +`handle 6 nostop pass` + + +### License ### + +This software is distributed under the following license: + +``` +Copyright (c) 2017 Cisco and/or its affiliates. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + + -- cgit 1.2.3-korg From 7290b8411c9ba7f4758be8a50d353414382d1d62 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 6 Apr 2017 17:25:47 +0200 Subject: Minor modification Change-Id: Id683657e83d5aa4fb5218f0316967cf6d8563b48 Signed-off-by: Mauro Sardara --- longbow/README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'longbow/README.md') diff --git a/longbow/README.md b/longbow/README.md index 66c75d1e..01d46075 100644 --- a/longbow/README.md +++ b/longbow/README.md @@ -5,6 +5,7 @@ _The Best Defense is a Good Offense_ The LongBow C language software framework ## Quick Start ## + ``` $ git clone -b cframework/master https://gerrit.fd.io/r/cicn cframework $ cd cframework/longbow -- cgit 1.2.3-korg From 72462a4971319d354c00b5b3305ad2aeb558664b Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 7 Apr 2017 10:25:26 +0200 Subject: Removed useless space Change-Id: I4b39ddf5426d95b1d079cbe7d4852bded0223dc9 Signed-off-by: Mauro Sardara --- longbow/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'longbow/README.md') diff --git a/longbow/README.md b/longbow/README.md index 01d46075..5da82a69 100644 --- a/longbow/README.md +++ b/longbow/README.md @@ -19,15 +19,15 @@ $ make install ## Introduction ## -LongBow is a C language software framework that combines the fail-fast philosophy of an offensive-stance of program -development and xUnit style unit testing. Using LongBow's to aid an offensive-development stance is largely a matter -of using its entry and exit assertions in your code. Similarly using LongBow's unit-test framework uses the same entry -and exit assertions in the unit test cases themselves. The runtime assertions and the unit-test assertions work -together in the unit test framework and do not conflict. This framework grew out of the need for a unit testing for +LongBow is a C language software framework that combines the fail-fast philosophy of an offensive-stance of program +development and xUnit style unit testing. Using LongBow's to aid an offensive-development stance is largely a matter +of using its entry and exit assertions in your code. Similarly using LongBow's unit-test framework uses the same entry +and exit assertions in the unit test cases themselves. The runtime assertions and the unit-test assertions work +together in the unit test framework and do not conflict. This framework grew out of the need for a unit testing for Test Driven Development on the CCNx Distillery software distribution. -Two other test frameworks were considered and used to develop unit tests: Unity and GoogleTest. Ultimately Unity -was not used (although this framework is indebted to Unity for inspiration) mainly due to ease-of-use problems, -and Googletest was not used mainly because it is a C++ framework, is not compatible with some features of C99, and is +Two other test frameworks were considered and used to develop unit tests: Unity and GoogleTest. Ultimately Unity +was not used (although this framework is indebted to Unity for inspiration) mainly due to ease-of-use problems, +and Googletest was not used mainly because it is a C++ framework, is not compatible with some features of C99, and is difficult to use. ## Using LongBow ## -- cgit 1.2.3-korg