Skip to content

Commit 2330c54

Browse files
committed
deploy: f606c4f
0 parents  commit 2330c54

File tree

693 files changed

+131236
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

693 files changed

+131236
-0
lines changed

.nojekyll

Whitespace-only changes.

_images/gh_action_commit.png

109 KB
Loading

_images/gl_action_commit.png

33.7 KB
Loading

_images/gl_green_check_mark.png

14.3 KB
Loading

_images/green_check_mark.png

14.5 KB
Loading

_images/python_application.png

80.4 KB
Loading

_images/testing_group_work.png

154 KB
Loading
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
orphan: true
3+
---
4+
5+
# Example installation of pFUnit and pFUnit_demos
6+
7+
## Set up the environment
8+
9+
Installing pFUnit requires Git, a Fortran compiler and CMake.
10+
11+
### On a cluster
12+
13+
On an HPC cluster you might need to add a few environment modules. For
14+
example, on [Tetralith](https://www.nsc.liu.se/systems/tetralith/) you
15+
would do:
16+
17+
```bash
18+
module add git/2.19.3-nsc1-gcc-system
19+
module add CMake/3.16.4-nsc1
20+
export FC=/software/sse/manual/mpprun/4.1.3/nsc-wrappers/ifort
21+
```
22+
23+
### On own computer
24+
25+
If you don't have [CMake](https://cmake.org/) or a Fortran compiler
26+
installed yet, one option is to install them into a conda environment
27+
by first saving the following into a file `environment.yml`:
28+
29+
```yaml
30+
name: compilers
31+
channels:
32+
- conda-forge
33+
dependencies:
34+
- cmake
35+
- compilers
36+
```
37+
38+
followed by installing the packages into a new environment:
39+
```bash
40+
conda env create -f environment.yml
41+
```
42+
and finally activating the environment:
43+
```bash
44+
conda activate compilers
45+
```
46+
47+
For good measure, set the `FC` variable to point to your
48+
Fortran compiler (adjust path as needed):
49+
```bash
50+
export FC=$HOME/miniconda3/envs/compilers/bin/gfortran
51+
```
52+
53+
## Clone the pFUnit repository
54+
55+
```bash
56+
git clone --recursive git@github.com:Goddard-Fortran-Ecosystem/pFUnit.git
57+
cd pFUnit
58+
```
59+
60+
## Configure with Cmake
61+
62+
```bash
63+
mkdir build
64+
cd build
65+
cmake ..
66+
```
67+
68+
## Build and install
69+
70+
The following will install pFUnit into a directory `installed` under
71+
the `build` directory.
72+
73+
```bash
74+
make tests
75+
make install
76+
```
77+
78+
## Compiling with pFUnit
79+
80+
When compiling with pFUnit, set:
81+
```bash
82+
export PFUNIT_DIR=$HOME/path/to/pFUnit/build/installed
83+
```
84+
85+
and run CMake with `-DCMAKE_PREFIX_PATH=$PFUNIT_DIR`.
86+
87+
88+
## Clone the pFUnit_demos repository
89+
90+
This is for testing and learning purposes.
91+
92+
```bash
93+
git clone git@github.com:Goddard-Fortran-Ecosystem/pFUnit_demos.git
94+
```
95+
96+
### Try out the Trivial, Basic, and MPI examples
97+
98+
```bash
99+
cd pFUnit_demos
100+
export PFUNIT_DIR=~pFUnit/build/installed/PFUNIT-4.2
101+
cd Trivial
102+
./build_with_cmake_and_run.x
103+
cd ../Basic
104+
./build_with_cmake_and_run.x
105+
cd ../MPI
106+
./build_with_cmake_and_run.x
107+
´´´

_sources/concepts.md.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
orphan: true
3+
---
4+
5+
This page has been merged with [Motivation](motivation)

_sources/conclusions.md.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Conclusions and recommendations
2+
3+
## The basics
4+
5+
- Learn one test framework well enough for basics
6+
- Explore and use the good tools that exist out there
7+
- An incomplete list of testing frameworks can be found in the [Quick Reference](quick-reference)
8+
- Start with some basics
9+
- Some simple thing that test all parts
10+
- Automate tests
11+
- Faster feedback and reduce the number of surprises
12+
13+
14+
## Going more in-depth
15+
16+
- Strike a healthy balance between unit tests and integration tests
17+
- As the code gets larger and the chance of undetected bugs
18+
increases, tests should increase
19+
- When adding new functionality, also add tests
20+
- When you discover and fix a bug, also commit a test against this bug
21+
- Use code coverage analysis to identify untested or unused code
22+
- If you make your code easier to test, it becomes more modular
23+
24+
25+
## Ways to get started
26+
27+
You probably won't do everything perfectly when you start off... But
28+
what are some of the easy starting points?
29+
30+
- Do you have some single functions that are easy to test, but hard to
31+
verify just by looking at them? Add unit tests.
32+
33+
- Do you have data analysis or simulation of some sort? Make an
34+
end-to-end test with sample data, or sample parameters. This is
35+
useful as an example anyway.
36+
37+
- A local testing framework + GitHub actions is very easy! And works
38+
well in the background - you do whatever you want and get an email
39+
if you break things. It's actually pretty freeing.

0 commit comments

Comments
 (0)