8. Source code scoring tools#

These tools should be used by anyone who wants to develop in a reference version of the*Code_Aster*.

They are located in the /aster/astest/vers directory where vers refers to the associated version and are also available via the asterix user environment [D1.02.01 §12].

In general, all the tools described below return an error code via the return code of a process UNIX (searchable by $status in C- SHELL and $? in Bourne- SHELL).

This code is as follows:

  • 0 if everything is OK,

  • 2 if an alarm message has been sent,

  • 4 if an error has been encountered.

8.1. asno: unit notation#

Note source units in the notated code files (quirou or quicat or quites).

8.1.1. Call mode#

my_file refers to a file that is either of the type Fortran or CAL or C or catalog or UNIGEST or CASTEST.

version is a parameter that bears the name of the reference version in question (NEW1, NEW2, NEW3). The current value taken by default is NEW3.

message refers to an output file where the alarm and error messages sent by asno will be recorded. The name taken by default is: message_asno.

8.1.2. Tasks completed#

Three main tasks:

A

Search for the file type source code FORTRANou CALou C, source code CATALOGUE, UNIGEST, or CASTESTsur the following criteria:

  • If the file contains a line beginning with:

C AJOUT or C MODIF

the C being in the first column, the number of blanks between C and AJOUT or between C and MODIF not being significant,

then the file will be considered to contain code FORTRAN

  • If the file contains a line beginning with:

/AJOUT or / MODIF

the /being in the first column, the number of blanks between / and AJOUT or between /* and MODIF not being significant,

then the file will be considered to contain C code

  • If the file contains a line beginning with:

AJOUT or MODIF

the being in the first column, the number of blanks between and AJOUT or between * and MODIF not being significant,

then the file will be considered to contain code CAL

  • If the file contains a line beginning with:

% AJOUT or% MODIF

the% being in the first column, the number of blanks between% and AJOUT or between% and MODIF not being significant,

then the file will be considered to contain code CATALOGUE

  • If the file contains a line beginning with:

% TITRE

the% being in the first column, the number of blanks between% and TITRE not being significant,

and a line starting with:

DEBUT (CODE: (NOM: 'testcase_name')

then the file will be considered to contain code CASTEST

  • If the file contains a line beginning with:

FORSUPPR, CATSUPPR, TESSUPPR, FORDEPLA, then the file will be considered to be of type UNIGEST.

If the file contains only one source type*Aster*:

The scoring can continue

Sinon

an error message is entered and FIN.

B

Search for the name of the source units and the name of the libraries or catalogs:

  • In the case of a file type FORTRAN:

The names of the routines are found according to the FORTRAN declaration standards:

PROGRAM unit_name

SUBROUTINE unit_name

FUNCTION unit_name

INTEGER FUNCTION unit_name

… etc…

The names of the libraries are found by line INFO.

  • In the case of a file type CATALOGUE or CAL or C:

The names of the units and the catalog (or library) are found using lines INFO:

%& MODIF catalog_name DATE dd/mm/aa AUTEUR author_name

or

%& AJOUT catalog_name

The% being in column 1 & in the 2nd column and the number of blanks not being significant. (respectively with /for C and for CAL).

  • In the case of a file type CASTEST:

The names of the test cases are found thanks to the name of the test case in the name of the test case in the instruction DEBUT (CODE :( NOM :”name_test”,

  • In the case of a file of type UNIGEST:

The names of the unit elements are found in an obvious way.

C

For each of the units to be noted:

  • If it is already noted in a file:

If the first notation in this unit came from the developer calling asno:

there is nothing to do.

If not:

an alarm is sounded.

The names of the people who graded this unit as well as the times and dates of scoring are entered in the message file.

If the developer calling asno has not already noted this unit:

The unit is noted

If not:

the source unit is noted in the code file noted with the caller identifier, time and date.

8.2. asdeno: denotation of units#

Denote source units from a source file.

8.2.1. Call mode#

my_file refers to a file containing either Fortran or CAL or C code, or catalog code, or type UNIGEST or CASTEST.

version is a parameter that bears the name of the reference version in question (NEW1, NEW2, NEW3). The current value taken by default is NEW3.

message refers to an output file where the alarm and error messages sent by asdeno will be recorded. The name taken by default is: message_asdeno.

8.2.2. Tasks completed#

  • Task A the same as asno.

  • Task B the same as asno.

  • Search, in the noted code file, for source units already noted by the calling identifier, and delete the corresponding lines.

8.3. xasdeno: denotation of units by name#

Denote source units from a file containing module names and a module type.

8.3.1. Call mode#

my_file refers to a file containing one module name per line; module names must refer to units of the same type.

version is a parameter that bears the name of the reference version in question (NEW1, NEW2, NEW3). The current value taken by default is NEW3.

type: to designate the type of unit to denote among f (fortran), c, cal (assembly), cata (catalog), test (test case).

message refers to an output file where the alarm and error messages sent by xasdeno will be written. The name taken by default is: message_xasdeno.

8.3.2. Tasks completed#

Deleting, in the noted code file, the source units already noted by the calling identifier with the given version of the modules whose names are in the file.

8.4. asdeno_adm: denotation by the administrator#

Possibility given only to the*Aster* administrator to invalidate all unit ratings. The “denoted” units will have their version field replaced by the mention “RAYE” and the date of this denotation will be added to the rating files (so that developers who rated these units are notified).

Striped units will only be “visible” with asqui and asquit.

8.4.1. Call mode#

my_file refers to a file containing either Fortran or CAL or C code, or catalog code, or of the UNIGEST or CASTEST type.

version is a parameter that bears the name of the reference version in question (NEW1, NEW2, NEW3). The current value taken by default is NEW3.

message refers to an output file where the alarm and error messages sent by asdeno_adm will be written. The name taken by default is: message_asdeno_adm.

8.4.2. Tasks completed#

  • Task A the same as asno

  • Task B the same as asno

  • Search the noted code file for source units that have already been noted, replace the version field with “RAYE” and add the denotation date.

8.5. asqui: unit notation list#

Know the developers who have rated source units.

8.5.1. Call mode#

my_file refers to a file containing either Fortran or CAL or C code, or catalog code, or of the UNIGEST or CASTEST type.

message refers to an output file where the alarm and error messages sent by asqui will be recorded. The name taken by default is: message_asqui.

8.5.2. Tasks completed#

  • Task A the same as asno.

  • Task B the same as asno.

  • Search in the noted code file if the source units are already noted (all versions are concerned).

If this is the case:

The names of source units and persons as well as the times and dates of scoring are entered in*message and FIN.

(task identical to ASNO task C).

8.6. asquit: list of all notations#

Know all the source units that are noted.

8.6.1. Call mode#

message: definition identical to asno. The name taken by default is: message_asquit.

8.6.2. Task completed#

Copy the noted code files (quirou and quicat and quites) into the message file.