• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

analysis/H09-Apr-2021-342,193341,208

element/Fbar/H09-Apr-2021-679671

nonlinear/H09-Apr-2021-21,81621,682

solver/H09-Apr-2021-11,66011,628

README.ja.mdH A D09-Apr-20213.4 KiB10472

README.mdH A D09-Apr-20212.4 KiB9366

compare_res.plH A D09-Apr-20213.9 KiB11696

create_reference.shH A D03-May-20221.4 KiB7660

create_reference_docker.shH A D03-May-20221.4 KiB6240

test.shH A D03-May-20223.9 KiB179134

README.ja.md

1[English Version](./README.md)
2
3テストの実行方法
4-----------------
5
6[ctest][ctest]を使います。
7FrontISTRプロジェクト自体を[cmake][cmake]で次の様にビルドしたと想定します
8
9```
10git clone https://gitlab.com/FrontISTR-Commons/FrontISTR
11cd FrontISTR   # このディレクトリの事を以降 FRONTISTR_HOME と呼びます
12cmake . -Bbuild
13cmake --build build/ -j $(nproc)
14```
15
16これで `${FRONTISTR_HOME}/build` 以下に `fistr1` 等の実行バイナリが生成されています。
17この状態で
18
19```
20cd build/
21ctest
22```
23
24これで全てのテストが実行されます。
25
26### テストのラベル
27
28テストはラベルによって管理されていて、並列化について以下のラベルが存在します
29
30| label | OpenMP | MPI |
31|:------|:------:|:---:|
32|serial | OFF    | OFF |
33|openmp | ON     | OFF |
34|mpi    | OFF    | ON  |
35|hybrid | ON     | ON  |
36
37これらのラベルが付いたテストだけを実行するには例えば
38
39```
40ctest -L mpi
41```
42
43の様に `-L` (`--label-regex`) を付けて実行します。
44
45テストには並列化に関するものの他に以下に説明するように `target` によるものがあります。
46テストは下記の節で説明されているように [cmake][cmake] によって自動的に追加されますが、
47例えば `${FRONTISTR_HOME}/tests/analysis/eigen/exK/` ディレクトリにあるテストには
48`${FRONTISTR_HOME}/tests/` からの相対パスをそのまま文字列として用いて `analysis/eigen/exK` というラベルを付けます
49このディレクトリにあるテストだけを実行するには次の様にします
50
51```
52ctest -L analysis/eigen/exK
53```
54
55また `-L` は部分マッチで選択出きるので、
56
57```
58ctest -L analysis
59```
60
61とすれば `${FRONTISTR_HOME}/tests/analysis` 以下の全てのテストを実行します。
62 
63### 出力の調整
64
65`ctest` の一般的な使い方として、
66
67```
68ctest -V
69```
70
71は全ての出力を表示、
72
73```
74ctest --output-on-failure
75```
76
77は失敗したテストの結果のみ出力を表示します。詳しくは `ctest -h` を確認してください。
78 
79テストの追加方法
80-----------------
81
82テストは [cmake][cmake] が `${FRONTISTR_HOME}/tests/` ディレクトリ以下にあるメッシュデータ(`*.msh`)を自動的に走査して、
83発見したものを自動的に登録します。
84このテストは信頼できるリファレンスと現在のソースコードに基づく `fistr1` での計算結果を比較して、
85それが十分に小さいかどうかを判定します。
86
87したがって、テストを新たに追加するには
88
891. `${FRONTISTR_HOME}/tests` 以下に新たにディレクトリを追加し
902. `*.msh` ファイル、`*.cnt` ファイルを追加し
913. `${FRONTISTR_HOME}/tests/create_reference.sh` でリファレンスデータを生成し
924. 計算結果が妥当かどうかを手動で確認する
93
94というプロセスを経ます。
95
96`create_reference.sh` の実行には`${FRONTISTR_HOME}/build/fistr/fistr1`をデフォルトで利用しますので事前にビルドが必要です。
97`create_reference_docker.sh` の実行にはFrontISTRの公式リリースのコンテナイメージを用いるので
98[Docker][docker] の実行権限が必要です。
99
100
101[cmake]: https://cmake.org/cmake/help/latest/manual/cmake.1.html
102[ctest]: https://cmake.org/cmake/help/latest/manual/ctest.1.html
103[docker]: https://www.docker.com/
104

README.md

1[Japanese Version](./README.ja.md)
2
3Run test
4---------
5
6Use [ctest][ctest].
7We assume here that FrontISTR project is built by [cmake][cmake]:
8
9```
10git clone https://gitlab.com/FrontISTR-Commons/FrontISTR
11cd FrontISTR   # we call here as FRONTISTR_HOME
12cmake . -Bbuild
13cmake --build build/ -j $(nproc)
14```
15
16Then `fistr1` and other executables are built in `${FRONTISTR_HOME}/build`.
17You can run test on this directory:
18
19```
20cd build/
21ctest
22```
23
24### Labels of tests
25
26Tests are managed by ctest's label. There are 4 labels about parallelization:
27
28| label | OpenMP | MPI |
29|:------|:------:|:---:|
30|serial | OFF    | OFF |
31|openmp | ON     | OFF |
32|mpi    | OFF    | ON  |
33|hybrid | ON     | ON  |
34
35To execute labeled tests, please run [ctest][ctest] with `-L` (`--label-regex`) flag:
36
37```
38ctest -L mpi
39```
40
41In addition to these parallelization labels, there are labels for "target".
42As described below, [cmake][cmake] seeks tests in this directory,
43and put a label `analysis/eigen/exK` to tests for `${FRONTISTR_HOME}/tests/analysis/eigen/exK` for example.
44To run tests on this directory, please use this label:
45
46```
47ctest -L analysis/eigen/exK
48```
49
50Because `-L` flag can select by partial match,
51
52```
53ctest -L analysis
54```
55
56will executes all tests in `${FRONTISTR_HOME}/tests/analysis`
57
58### Configure test output
59
60As a general technique of [ctest][ctest],
61
62```
63ctest -V
64```
65
66displays all output of test processes, and
67
68```
69ctest --output-on-failure
70```
71
72displays the output of failed tests. See `ctest -h` for detail.
73
74Add test
75---------
76
77[cmake][cmake] seeks mesh data (`*.msh`) from `${FRONTISTR_HOME}/tests/`, and then registers it as a test target.
78This target compares the result of `fistr1` of current build with reference build,
79and tests the difference is enough small.
80In order to append a new test, you should
81
821. Create a directory under `${FRONTISTR_HOME}/tests`
832. Put `*.msh` and `*.cnt` files
843. Generate reference result by `${FRONTISTR_HOME}/tests/create_reference.sh`
854. and Confirm this result is correct by your eye
86
87Be sure that because `create_reference.sh` uses executable binary `${FRONTISTR_HOME}/build/fistr/fistr1` by default, you have to build it in advance.
88Be sure that because `create_reference_docker.sh` uses official release image, you need the authority for execution of [Docker][docker].
89
90[cmake]: https://cmake.org/cmake/help/latest/manual/cmake.1.html
91[ctest]: https://cmake.org/cmake/help/latest/manual/ctest.1.html
92[docker]: https://www.docker.com/
93