Skip to main content

This project aims to provide tools for automated documentation generation for BeakerLib tests.

Project description

bkrdoc
======

This project aims to provide tools for automated documentation generation for BeakerLib tests.

## 1. Introduction
### 1.1 What is bkrdoc?
**bkrdoc** is a documentation generator from tests written using **BeakerLib** library. This generator makes documentation from test code with and also without any documentation markup.

### 1.2 What it`s good for?
For fast, brief and reliable documentation creation. It`s good for quick start with unknown **BeakerLib** test. Created documentations provides information about the documentation credibility. Also created documentations shows environmental variables and helps reader to run test script from which was documentation created.

**bkrdoc** is written in pure python.

### 1.3 What is BeakerLib?
**BeakerLib** is a shell-level integration testing library, providing convenience functions which simplify writing, running and analysis of integration and blackbox tests.

https://fedorahosted.org/beakerlib/

### 1.4 How is bkrdoc licensed?
BSD license. See the LICENSE file in the distribution.

### 1.5 Contact details
Feel free to send me an email (Kulda12@seznam.cz) for any question you have on **bkrdoc** project.

## 2. Installing

### 2.1 Prerequisites
- **bkrdoc** was tested on Python 2.7 and 3.3 versions on Linux.
- **bkrdoc** has no external dependencies.

### 2.2 Installation process
Instalation is very simple. You have two choices. First is to download rpm from [bkrdoc](https://pypi.python.org/pypi/bkrdoc) pypi and easily install it. Second choice is to download whole project and after that run setup.py script in bkrdoc folder. For executing setup.py file you need to run this standart `python setup.py install` command.

## 3. Using
### 3.1 Basic usage
Documentation generator for analysis is `documentation_generator.py` file and for markup is `tagged_generator.py`. For generation of documentation there is file called `bkrdoc/bkrdoc.py`. Shown on this example:
```
for analysis:
python bkrdoc.py analysis [analysis-options] [BeakerLib_test.sh]

for markup:
python bkrdoc.py markup [markup-options] [BeakerLib_test.sh]
```

### 3.2 Documentation tags
First important thing is that all documentation comments **must** start with `#@`. For example this code comment `#@ Makes temporary directory and saves work in it` will create this documentation line: `Makes temporary directory and saves work in it`.

If a documentation comment is before BeakerLib phase, function, loop or condition this comment will be taken as a description. You can see what will happen on this example:
```bash
#@ Various types of arguments will start this part
rlPhaseStartTest "various argument types"

#@ for every argument in selected word will do...
for arg in disabled EnAbLeD dIsAblEd enabled no Yes nO yes 0 1
do
#@ Report argument
rlRun "abrt-auto-reporting $arg"
done
#@ Reporting finished
rlPhaseEnd
```
result:

```
Test "various argument types"
Various types of arguments will start this part
loop: for every argument in selected word will do...
Report argument
Reporting finished
```

In the top of every generated documentation are three lines consits of description, information about authors and keyword of the test. These three lines are generated from test template. But it can occur that the template is missing or you want to add more data and that you can do using these tags: `@keyword`, `@key`, `@author` and `@description`. For example: `#@ @key httpd` will add key into keywords line:
```
Description: Simple test
Author: Jan Kresla
Keywords: httpd
```

Also tagged generator supports block comments. Block comments must start with `#@` but following documentation comments can start with simple `#` as you can see on this example:

```bash
#@ Somenthing in start of the test
# Could be anything
# Make temporary directory and saves work in it
rlPhaseStartSetup
TmpDir=$(mktemp -d)
pushd $TmpDir
rlPhaseEnd
```
will generate:

```
Setup
Somenthing in start of the test
Could be anything
Make temporary directory and saves work in it
```

## 4. Package contents
After downloading bkrdoc project, you will see following files and directories:

_**README.md:**_
This README file.

_**LICENSE:**_
File with bkrdoc license.

_**bkrdoc/:**_
Folder with bkrdoc generator which is creating documentations from **BeakerLib** tests with and without any documentation markup.

_**bkrdoc/analysis/:**_
Folder with sources for automated documentation generator without documentation markup

_**bkrdoc/markup/:**_
Folder with sources for automated documentation generator with documentation markup

_**examples/:**_
This folder contains some **BeakerLib** tests and generated documentations

_**docs/:**_
Folder contains TODO options and first documentation format.

_**tests/:**_
Folder contains files for bkrdoc testing

## 5. CI Status
**bkrdoc** is automatically tested by [Travis CI project](https://travis-ci.org). Latest build status is:
[![Build Status](https://travis-ci.org/rh-lab-q/bkrdoc.svg?branch=master)](https://travis-ci.org/rh-lab-q/bkrdoc)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bkrdoc-1.2.4.tar.gz (55.4 kB view details)

Uploaded Source

Built Distributions

bkrdoc-1.2.4-1.src.rpm (62.2 kB view details)

Uploaded Source

bkrdoc-1.2.4-1.noarch.rpm (79.1 kB view details)

Uploaded Source

File details

Details for the file bkrdoc-1.2.4.tar.gz.

File metadata

  • Download URL: bkrdoc-1.2.4.tar.gz
  • Upload date:
  • Size: 55.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bkrdoc-1.2.4.tar.gz
Algorithm Hash digest
SHA256 e6c779c2b0b8c4e9b41d22f5268f73780627275938e6b42fdda973295a5f7af4
MD5 cce176e0994dff6d4f39420538979198
BLAKE2b-256 fffd532f0eedb1d8d1cdc6d2a0773a455d6a76203b1e9c2b7898e045c810fb9f

See more details on using hashes here.

File details

Details for the file bkrdoc-1.2.4-1.src.rpm.

File metadata

  • Download URL: bkrdoc-1.2.4-1.src.rpm
  • Upload date:
  • Size: 62.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bkrdoc-1.2.4-1.src.rpm
Algorithm Hash digest
SHA256 51ce6b974f953ac69032ddf6f81a49787286bd1750987677ee0e3383d64fb913
MD5 29b5a87c7fe270e14e401294b4a0aea6
BLAKE2b-256 6ea6cf8041a4fe296f58308fbce6efc742a8a541db418b6a8a49705f52f42925

See more details on using hashes here.

File details

Details for the file bkrdoc-1.2.4-1.noarch.rpm.

File metadata

File hashes

Hashes for bkrdoc-1.2.4-1.noarch.rpm
Algorithm Hash digest
SHA256 2aa7f8b3a6aadd389e5549186acf58b3f373bda194a36585bd3422d158cd7889
MD5 7f371c7c08e7fdedb0ebf1322560abb6
BLAKE2b-256 79634df378b3e7134f5dd0550168da040e6ce4f80e07ce53bdfaf3464e22158e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page