Sample Scenarios
|
|
|
|
|
Online Documentation Home Page
Ada-Audit can be invoked either from a command line or from within
Ada-ASSURED.
Scenario 1
Here is a typical command-line invocation:
aa-audit -gnat -G demo_library
What happens is:
- The STYLE table is updated for all Ada source files in the gnat
library demo_library that have been modified since STYLE was
last updated.
- The updated STYLE table is displayed in an HTML browser.
- An Ada-ASSURED window is opened, if necessary, to serve as a
control panel.
Ada-ASSURED menu Tools/Ada-Audit/View contains commands
for changing the view of the STYLE table. Ada-ASSURED menu
Tools/Ada-Audit/Find invokes a command that restricts
attention to a subset of the facts.
At any time while reviewing the database:
- You can print the current view by invoking command Print
(menu: File/Print) in the HTML browser.
- You can save the current view as an HTML file by invoking the
Save As command (menu: File/Save As) in the HTML
browser. This file can be loaded later into any HTML browser without
using Ada-Audit. It can also be incorporated into other HTML
documents. Note, however, that the current view of the table is frozen
in the HTML file and cannot be changed later.
- You can save the current table in a file format that permits it
to be reloaded later. For example, you may wish to record a snapshot
of the database for later comparison. Command
audit-save
(menu: Tools/Ada-Audit/Save Audit) saves the table, and
command
audit-load
(menu: Tools/Ada-Audit/Load Audit)
restores it. Once the table has been restored from the file, it can be
manipulated at will.
The Ada-Audit session is terminated by executing command
exit
(menu: File/Exit) from the Ada-ASSURED window.
Scenario 1 updates a persistent record of the STYLE table that is
associated with the given library. If no Ada source files change
between subsequent invocations of Scenario 1, the STYLE table will be
up to date and will not need updating.
Scenario 2
The updating process of Scenario 1 requires time proportional to the
number of files changed since the previous update. You may wish to do
this updating periodically rather than on demand, as in Scenario 1.
The command-line invocation:
aa-audit -update_only -gnat -G demo_library
just updates the STYLE table to be consistent with respect to the
current Ada source files, and omits invocation of the browsers. For
example, you might wish to invoke this command nightly, or as part of
a check-in process.
When the -update_only flag is used, Ada-ASSURED will be
invoked in batch mode and no window will appear.
Scenario 3
Suppose you wish to review the database "as is" without performing an
update. The command-line invocation:
aa-audit -view_only -gnat -G demo_library
omits the updating and just loads whatever table resulted from the
most recent update for the given library.
Senario 4
Instead of loading Ada-Audit with the facts for a whole library, you
can view just the facts pertinent to a list of files. The command-line
aa-audit -f f1.a f2.a f3.a
updates the STYLE table for files f1.a, f2.a, and
f3.a, and displays the STYLE table with the facts associated
with these files. The -view_only and -update_only
options also work with a list of files.
Senario 5
If you have a long list of files to be audited, you may wish to list
their paths in a separate file, one per line. The command-line
aa-audit -l filelist
updates the STYLE table for all files whose paths are given in file
filelist, and displays the STYLE table with the facts
associated with these files.
Senario 6
Audits can be invoked from within Ada-ASSURED by executing command
audit-library-or-files
(menu: Tools/Audit/Library or
Files). If the audit of a library is requested, the default
vendor information is based on Ada-ASSURED's compiler preferences
(menu: Options/Compiler Preferences).
If a user is using Ada-ASSURED interactively, then performing an
audit will use the running Ada-ASSURED process unless the -update_only
flag is used.
Senario 7
Interactive users of Ada-ASSURED can set the STYLE table based on the
contents of files currently in edit buffers:
- Command
audit-current-buffer
(menu: Tools/Ada-Audit/Audit/Current Buffer) sets the table with
facts about the Ada source code contained in the current edit buffer.
- Command
audit-all-buffers
menu: Tools/Ada-Audit/Audit/All Buffers) sets the table with facts
about the Ada source code contained in all edit buffers of syntactic
category compilation.