Skip to content

Commit a42b332

Browse files
authored
doc(README): describe operators & improve structure
1 parent 37bcc95 commit a42b332

1 file changed

Lines changed: 66 additions & 44 deletions

File tree

README.md

Lines changed: 66 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,83 +14,102 @@ Users construct tests by
1414
3. Defining a `results()` function that
1515
- Defines a result comprised of an array of `test_result_t` objects.
1616
- Defines a local array of `test_description_t` objects, each of which encapsulates
17-
* A string describing a function that produces one or more `test_diagnosis_t` result objects, each of which encapsulates
18-
* A `logical` indicator of whether the test passed and
19-
* A `character` or `string_t` diagnostics string.
20-
* The corresponding function name.
17+
* A string describing a test performed by a test-diagnosis function and
18+
* The corresponding test-diagnosis function's name.
2119

22-
Julienne empowers users to customize the diagnostic information that prints when tests fail.
23-
For this purpose, Julienne's `string_t` constructors convert various data types, kinds, and ranks to character data.
24-
Julienne also provides `string_t` operators supporting concatenation and delimited lists such as comma-separated value lists.
20+
Test-diagnosis functions conform to the [`diagnosis_function_i`] abstract interface, which stipulates that
21+
the function takes no arguments and produces a result of the `test_diagnosis_t` type.
22+
23+
Users have two ways to construct a `test_diagnosis_t` object:
24+
1. Write an expression using Julienne's user-defined operators, which are inspired by natural language, or
25+
2. Invoke one of Julienne's `test_diagnosis_t` constructor functions.
26+
27+
Approach 1 is simpler, covers several common use cases, and automates the construction of the diagnostic
28+
output to be printed when a test fails. Approach 2 facilitates user-customization of diagnostic output
29+
using Julienne's string-handling capabilities to format the output. Such string handling centers around
30+
Julienne's `string_t` type.
31+
32+
Alternatively, Julienne's `vector_test_description_t` type facilitates writing test functions that produce
33+
multiple test diagnoses. Such functions conform to Julienne's [`vector_test_diagnosis_i`] abstract interface,
34+
which requires conforming functions to produce a one-dimensional array of `test_diagnosis_t` objects.
35+
36+
Origin Story
37+
------------
2538

2639
Julienne's name derives from the term for vegetables sliced into thin strings: julienned vegetables.
27-
The [Veggies] unit-testing framework inspired the structure of Julienne's tests and output.
40+
The [Veggies] and [Garden] unit-testing frameworks inspired the structure of Julienne's tests and output.
2841
Julienne aims to be a more lightweight alternative that is more portable across compilers.
2942

3043
Getting Started
3144
---------------
3245
Please see the [example-test-suite README.md](./example/example-test-suite/README.md).
3346

34-
Supported Compilers
35-
-------------------
47+
Compiler Support
48+
----------------
49+
The table below shows the compiler that Julienne fully or partially supports. When built with a fully
50+
supported compiler, all Julienne tests pass. When built with a partially supported compiler, the Julienne
51+
test suite skips some tests due to compiler bugs. The test output reports which tests are skipped and
52+
thereby details the features, if any, that are not supported with a given compiler.
3653

37-
Compiler | Version(s) Tested | Known Issues
38-
-----------------|--------------------------|-------------
39-
GCC `gfortran` | 13.1.0, 14.2.0_1, 15.0.1 | items 1-3 below
40-
Intel `ifx` | 2025.1 | item 4 below
41-
LLVM `flang-new` | 19, 20 | none
42-
NAG `nagfor` | 7.2 Build 7227 | none
54+
Compiler | Version(s) Tested | Support
55+
-----------------|--------------------------|----------------------
56+
LLVM `flang-new` | 19, 20 | full
57+
NAG `nagfor` | 7.2 Build 7227 | full
58+
GCC `gfortran` | 13.1.0, 14.2.0_1, 15.0.1 | partial (see 1 below)
59+
Intel `ifx` | 2025.4 Build 20241205 | partial (see 2 below)
4360

44-
Compiler bugs related to the following issues have been reported to the GCC project:
61+
Compiler bugs related to the following issues have been reported:
4562

46-
1. The `test_description_t` constructor's `diagnosis_function` actual argument must be a procedure pointer.
47-
2. Each element of a `vector_test_description_t` array must be defined in a separate program statement.
48-
3. If executed, the `string_t` type's `bracket` procedure causes a program crash.
49-
4. Two `string_t` tests fail as described in issue [#51](https://github.com/BerkeleyLab/julienne/issues/51).
63+
1. `gfortran` issues:
64+
- The `test_description_t` constructor's `diagnosis_function` actual argument must be a procedure pointer.
65+
- Each element of a `vector_test_description_t` array must be defined in a separate program statement.
66+
- The `string_t` type's `bracket` type-bound procedure causes a program crash.
67+
2. `ifx` issue:
68+
- Two `string_t` tests fail as described in issue [#51](https://github.com/BerkeleyLab/julienne/issues/51).
5069

51-
Some `gfortran` fixes related to items 1-3 above have been pushed to the GCC repository for release with GCC 14.3 and 15.1.0.
70+
Some `gfortran` fixes related to item 1 above are GCC 15.1.0 and should be in GCC 14.3 when released.
5271

5372
Building and Testing
5473
--------------------
5574

56-
### GNU (`gfortran`)
57-
#### `gfortran` versions 14 or higher
75+
#### LLVM (`flang-new`) compiler
76+
##### `flang-new` version 20 or later
5877
```
59-
fpm test --compiler gfortran --profile release
78+
export FPM_FC=flang-new
79+
fpm test --compiler flang-new
6080
```
6181

62-
#### `gfortran` version 13
82+
##### `flang-new` version 19
83+
Add the following command before the `fpm` command recommended above for LLVM 20 or later:
6384
```
64-
fpm test --compiler gfortran --profile release --flag "-ffree-line-length-none"
85+
export FPM_FFLAGS="-mmlir -allow-assumed-rank"
6586
```
66-
where the `-ffree-line-length-none` turns on support for lines exceeding the Fortran 2018 limit of 132 columns.
67-
(Fortran 2023 expands the allowable line length to 5,000 characters.)
87+
where this `FPM_FFLAGS` setting turns on the support for Fortran's assumed-rank dummy arguments.
88+
89+
If you do not have access to LLVM 19 or 20, we recommend building the main branch of llvm-project from source.
90+
A script that might be helpful for doing so is in the [handy-dandy] repository.
6891

69-
### Intel (`ifx`) 2025.4 Build 20241205 tested
92+
### NAG (`nagfor`) compiler
7093
```
71-
fpm test --compiler ifx --flag "-fpp -O3 -coarray" --profile release
94+
fpm test --compiler nagfor --flag -fpp
7295
```
7396

74-
### LLVM (`flang-new`)
75-
#### `flang-new` version 20 or later
97+
#### GNU (`gfortran`) compiler
98+
##### `gfortran` versions 14 or higher
7699
```
77-
export FPM_FC=flang-new
78-
fpm test
100+
fpm test --compiler gfortran --profile release
79101
```
80102

81-
#### `flang-new` version 19
82-
Add the following command before the `fpm` command recommended above for LLVM 20 or later:
103+
##### `gfortran` version 13
83104
```
84-
export FPM_FFLAGS="-mmlir -allow-assumed-rank"
105+
fpm test --compiler gfortran --profile release --flag "-ffree-line-length-none"
85106
```
86-
where this `FPM_FFLAGS` setting turns on the support for Fortran's assumed-rank dummy arguments.
87-
88-
If you do not have access to LLVM 19 or 20, we recommend building the main branch of llvm-project from source.
89-
A script that might be helpful for doing so is in the [handy-dandy] repository.
107+
where the `-ffree-line-length-none` turns on support for lines exceeding the Fortran 2018 limit of 132 columns.
108+
(Fortran 2023 expands the allowable line length to 5,000 characters.)
90109

91-
### NAG (`nagfor`)
110+
#### Intel (`ifx`) compiler
92111
```
93-
fpm test --compiler nagfor --flag -fpp
112+
fpm test --compiler ifx --flag "-fpp -O3 -coarray" --profile release
94113
```
95114

96115
Documentation
@@ -99,7 +118,10 @@ See our online [documentation] or build the documentation locally by installing
99118

100119
[Sourcery]: https://github.com/sourceryinstitute/sourcery
101120
[Veggies]: https://gitlab.com/everythingfunctional/veggies
121+
[Garden]: https://gitlab.com/everythingfunctional/garden
102122
[here]: https://github.com/rouson/handy-dandy/blob/7caaa4dc3d6e5331914a3025f0cb1db5ac1a886f/src/fresh-llvm-build.sh
103123
[documentation]: https:///berkeleylab.github.io/julienne/
104124
[FORD]: https://github.com/Fortran-FOSS-Programmers/ford
105125
[handy-dandy]: https://github.com/rouson/handy-dandy/blob/7caaa4dc3d6e5331914a3025f0cb1db5ac1a886f/src/fresh-llvm-build.sh
126+
[`diagnosis_function_i`]: https://github.com/BerkeleyLab/julienne/blob/37bcc959efa8f9e27ae50fecfd37a6bf52ef0a43/src/julienne/julienne_test_description_m.f90#L16
127+
[`vector_test_diagnosis_i`]: https://github.com/BerkeleyLab/julienne/blob/37bcc959efa8f9e27ae50fecfd37a6bf52ef0a43/src/julienne/julienne_vector_test_description_m.F90#L18

0 commit comments

Comments
 (0)