1====================
2Inform Logging Tests
3====================
4
5These tests turn the model upside down a bit to make things easier.
6
7Two bits are needed at the top of each .cf test file:
8
9```cf3
10body file control
11{
12  inputs => { "$(sys.policy_entry_dirname)/../common.cf.sub" };
13}
14
15bundle common testcase
16{
17  vars:
18    "filename" string => "$(this.promise_filename)";
19}
20
21```
22
23This is the boiler-plate to drive the tests.
24
25The framework automatically cleans up `$(G.testfile)` and `$(G.testdir)`.
26
27For the simplest case you can just include a `main` bundle to do the operation you want to perform.
28
29```cf3
30bundle agent main
31{
32  files:
33    "$(G.testfile)"
34      create => "true";
35}
36```
37
38And when the test is run it will generate a `<test.cf>.actual` and check it against
39a `<test.cf>.expected`.
40
41There are temporary files created during the test involving the results.
42If the test fails, these files will be kept, if the test passes, they will be removed.
43
44
45The little framework also supports a `setup` and `teardown` optional bundle for things you might need in that regard.
46
47Next to common.cf.sub there is a shell script called accept-actual.sh which will mv the .actual files to .expected and add them via `git`.
48