Skip to content

Commit 14f4f13

Browse files
authored
Merge pull request #329 from thk123/patch-1
Make the compiling steps a little more explicit
2 parents 3bbafbe + 640425d commit 14f4f13

File tree

2 files changed

+41
-10
lines changed

2 files changed

+41
-10
lines changed

gnat2goto/COMPILING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Note: you will *not* be able to build using the debian/ubuntu gnat and gprbuild,
1212
For **Debian**, install the following debian packages:
1313
- build-essential
1414

15-
For **Mac OSX**, you will need the XCode Command Line tools, which require XCode itself and then a
15+
For **Mac OSX**, you will need the XCode Command Line tools, which require XCode itself and then a
1616
```
1717
xcode-select --install
1818
```
@@ -27,7 +27,7 @@ select your platform and then 2016 (in that order). Download
2727
* gnatcoll-gpl-2016
2828

2929

30-
The following assumes you installed GNAT GPL 2016 into /opt/gnat using the doinstall script.
30+
Install the GNAT GPL Ada 2016 using the `doinstall` script inside the zip. The following instructions assume you picked `/opt/gnat` as the install destination.
3131

3232
Install GNATCOLL GPL 2016:
3333
- `$ export PATH=/opt/gnat/bin:${PATH}`
@@ -38,7 +38,7 @@ Install GNATCOLL GPL 2016:
3838

3939
# Building gnat2goto
4040

41-
Assuming that you've built the dependencies as per the above instructions
41+
Assuming that you've built the dependencies as per the above instructions, do the following from within `gnat2goto`.
4242

4343
- `$ export PATH=/opt/gnat/bin:${PATH}`
4444
- `$ export GPR_PROJECT_PATH=/opt/gnat/lib/gnat`
@@ -48,6 +48,8 @@ This should build into install/bin. You can test if it works by calling:
4848

4949
` $ install/bin/gnat2goto examples/foo.adb`
5050

51+
If it has worked, you should have two files: `foo.ali` and `foo.json_symtab`.
52+
5153
# Building and running gnat2goto unit tests
5254

5355
gnat2goto includes a selection of unit tests. These are built as a seperate
@@ -66,7 +68,7 @@ In addition to the unit tests, gnat2goto also includes end-to-end regression
6668
tests. These tests aim to test the full pipeline from Ada source code input
6769
through to final analysis by CBMC.
6870

69-
Instructions for running the regression test suite are described in [testsuite/gnat2goto/README.md](testsuite/gnat2goto/README.md)
71+
Instructions for running the regression test suite are described in [testsuite/gnat2goto/README.md](../testsuite/gnat2goto/README.md)
7072

7173
# Running and updating missing features tests
7274

@@ -93,7 +95,7 @@ one file per project. Simply copy the '<project>-summary.txt' file from
9395

9496
# Updating the CBMC submodule
9597

96-
As described in [testsuite/gnat2goto/README.md](testsuite/gnat2goto/README.md)
98+
As described in [testsuite/gnat2goto/README.md](../testsuite/gnat2goto/README.md)
9799
gnat2goto includes a GIT submodule for CBMC. In most cases this should not need
98100
changing, but if you are developing gnat2goto features or fixes that require a
99101
different version of CBMC then you will need to update the CBMC submodule

testsuite/gnat2goto/README.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,34 @@ Requirements
8989

9090
Running tests
9191
-------------
92+
93+
Ensure that both gnat2goto and cbmc are on the path:
94+
95+
```
96+
export PATH=${PATH}:/path/to/gnat2goto/lib/cbmc/path/to/cbmc:/path/to/gnat2goto/gnat2goto/install
97+
```
98+
99+
_Note for `make` users `/path/to/cbmc` will point to `lib/cbmc/src/cbmc`. For
100+
`cmake` it will be something like `lib/cbmc/build/bin`._
101+
102+
From within [gnat2goto/testsuite/gnat2goto](.) run:
103+
104+
```
105+
$ ./testsuite.py -j 4 --timeout 60 --enable-color
106+
```
107+
where ```-j``` sets the number of tests to run in parallel (default is 1).
108+
109+
`--timeout` will limit how long a test can run
110+
111+
`--enable-color` will enable color printing in the output.
112+
113+
This will output which tests pass and fail. If a test fails, you can inspect the output
114+
inside `out`. Each test will produce a file called `test_name.diff` which contains a git
115+
diff between the expected an actual output.
116+
117+
Alternatively, `--diffs` can be turned on to see the difference between the expected
118+
and actual outputs for all of `XFAIL`, `FAIL`, or `UPASS` results.
119+
92120
For the gnat2goto test suite each test subdirectory has a file test.py.
93121
In this file is a call to a subprogram prove. This subprogram has an
94122
optional parameter, debug <prove (debug=True>),
@@ -98,6 +126,12 @@ For the gnat2goto test suite each test subdirectory has a file test.py.
98126
of course this will cause a DIFF to be reported between actual and
99127
expected output. By default debug=False.
100128

129+
Updating Expected Results
130+
-------------------------
131+
132+
Sometimes the tests will need to be updated for the new behaviour. This can be done
133+
using [`./update-expected-outputs`](update-expected-outputs).
134+
101135
WARNING running ./update-expected outputs will replace all test.out
102136
(expected result) files with the actual results.
103137
A summary of the diffs between expected and actual results,
@@ -108,11 +142,6 @@ WARNING running ./update-expected outputs will replace all test.out
108142
revert all the changed test.out files, i.e.,
109143
git checkout -- tests/<test-dir>/test.out for each changed test.out).
110144

111-
* To run test suite:
112-
```
113-
$ ./testsuite.py -j 4
114-
```
115-
where ```-j``` sets the number of tests to run in parallel (default is 1).
116145

117146
* then, optionally
118147

0 commit comments

Comments
 (0)