Adding a program generating test data.

The program that generate this gen.c produces
a set of rules to be loaded to load/load2
file system interace of smacke. Or to be used
as input file for smackload.

The count of differents labels (option l=N) and of
different access rights (option r=N) can be specified.
The count of rules produced to the ouput can also
be specified (option o=N). By default, l=5, r=100 and o=500.

The generated labels are made of 4 to 7 random letters.
The standard C function 'rand' is used without seeding it;
what means that same options produces same results.

Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
tests: Change program generating test data

-Change program to produce more parametrized output:
	*Introduce parameters to set number of unique rules (u) and merges in policy (m).
	*Introduce parametr for maximum number of reocurrances of a label in merged policy (L).
	*Add possibility of getting list of labels from stdin in addition to generating random ones.
-Some minor style adjustments to libsmack coding style.

Also:
-Add makefile for policies generation
-Add script generating different type of policies

Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
tests: Changing filenames

Changing two filenames:
- tests/gen.c    becomes tests/generator.c
- tests/makefile becomes tests/Makefile

That is obviously better to have the main file of the program
`generator` named `generator.c`.

The default naming of makefiles is Makefile with a capital
letter. Conforming to that rule is better.

Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
tests: Renaming 'r' to 'alea'

Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
tests: Correcting exit codes

The valid exit code are form 0 to 255. Then using -1 means that the
effective exit code will be 0377==255. It isn't accurate. The exit code
of 1 is merely very often used for failure status.

Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
tests: Adding some comments

Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
tests: Adding a usage function.

Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
tests: Improved formating of code

Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
tests: Produce sorted policy with unique rule only

There is no need for tests of sorted policies with non unique rules.
If someone prepares sorted policy, redundancy of rules should also
be removed during sorting.
tests: Improved version of generator

This version use a generating algorithm to ensure
the generator constraints. It has two new options:
- s=N to shuffle or sort the result
- p=N to set the percentage of modification rules

The Makefile now make optimisation and have warning detection.

The make_policies script now use the shuffle option.

Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
Merge remote-tracking branch 'jobol/addgen' into v1.0.x