Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zer011b committed Jan 10, 2023
1 parent 72b76cc commit 3f07d82
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 17 deletions.
157 changes: 146 additions & 11 deletions Docs/Testing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# I. CI Testing

Testing for pull requests is performed using github actions CI: open pull request with your changes and it will be automatically tested. For details, see [build.yml](../.github/workflows/build.yml), [unit-test.yml](../.github/workflows/unit-test.yml) and [test-suite.yml](../.github/workflows/test-suite.yml). Cuda tests are only built but not launched in github actions CI, in other cases github actions CI is enough for release testing. For arm, arm64, riscv64, ppc64el testing is done under qemu.
Testing for pull requests is performed using github actions CI: open pull request with your changes and it will be automatically tested. For details, see [build.yml](../.github/workflows/build.yml), [unit-test.yml](../.github/workflows/unit-test.yml) and [test-suite.yml](../.github/workflows/test-suite.yml) and others. Cuda tests are only built but not launched in github actions CI, in other cases github actions CI is enough for release testing. For arm, arm64, riscv64, ppc64el testing is done under qemu.

# II. Manual Testing

Expand Down Expand Up @@ -57,7 +57,7 @@ For tests of build this means that next command should be finished successfully

However, even this might take too much time. Only next combinations are tested for release:

#### x64, sequential, mpi and cuda testing:
#### x64, sequential, mpi and cuda testing
```sh
./Tools/test-build.sh <home_dir> <build_dir> "" "" "" "" "" "" "OFF,1,x" "OFF,sm" "ALL" ""
./Tools/test-build.sh <home_dir> <build_dir> "" "" "" "" "" "" "ON,3,xyz" "OFF,sm" "ALL" ""
Expand Down Expand Up @@ -121,14 +121,11 @@ long double | -1.79769e+308 │ 2.00417e-292 │ 1.79769e+308

## 2. Unit tests

Next command should be finished successfully for x64, arm64, riscv64 architectures:
```sh
./Tools/test-units.sh <home_dir> <build_dir> "" "" "" "" "" "" ""
```
#### x64, sequential, mpi and cuda testing; native launch

Next command should be finished successfully for armhf, ppc64el architectures (`long double` testing is skipped):
Next command should be finished successfully for x64 architecture
```sh
./Tools/test-units.sh <home_dir> <build_dir> "" "" "" "" "" "f d" ""
./Tools/test-units.sh <home_dir> <build_dir> "" "" "" "" "" "" ""
```

Next command should be finished successfully for x64 mpi architecture:
Expand All @@ -141,9 +138,79 @@ Next command should be finished successfully for x64 cuda architecture:
./Tools/test-units-cuda.sh <home_dir> <build_dir> "" "" "RelWithDebInfo" "ON" "" "f d" "" ""
```

#### x64, aarch32(armhf) cross build, sequential; QEMU launch

Next command should be finished successfully for armhf architecture (`long double` testing is skipped) with cross build and launch under QEMU in rootfs:
```sh
export ROOTFS=`pwd`/rootfs/armhf
sudo ./create-ubuntu-rootfs.sh armhf jammy
TOOLCHAIN_VER=$(ls $ROOTFS/usr/include/c++/)
sed -i "s,set(TOOLCHAIN_VERSION \"8\"),set(TOOLCHAIN_VERSION \"$TOOLCHAIN_VER\")," arm-gcc-toolchain.cmake
./Tools/test-units.sh <home_dir> <build_dir> "" "arm-linux-gnueabihf-gcc,arm-linux-gnueabihf-g++" "" "" "" "f d" "arm-gcc-toolchain.cmake"
```

#### x64, aarch64 cross build, sequential; QEMU launch

Next command should be finished successfully for arm64 architecture with cross build and launch under QEMU in rootfs:
```sh
export ROOTFS=`pwd`/rootfs/arm64
sudo ./create-ubuntu-rootfs.sh arm64 jammy
TOOLCHAIN_VER=$(ls $ROOTFS/usr/include/c++/)
sed -i "s,set(TOOLCHAIN_VERSION \"7\"),set(TOOLCHAIN_VERSION \"$TOOLCHAIN_VER\")," arm64-gcc-toolchain.cmake
./Tools/test-units.sh <home_dir> <build_dir> "" "aarch64-linux-gnu-gcc,aarch64-linux-gnu-g++" "" "" "" "" "arm64-gcc-toolchain.cmake"
```

#### x64, riscv64 cross build, sequential; QEMU launch

Next command should be finished successfully for arm64 architecture with cross build and launch under QEMU in rootfs:
```sh
export ROOTFS=`pwd`/rootfs/riscv64
sudo ./create-ubuntu-rootfs.sh riscv64 jammy
TOOLCHAIN_VER=$(ls $ROOTFS/usr/include/c++/)
sed -i "s,set(TOOLCHAIN_VERSION \"9\"),set(TOOLCHAIN_VERSION \"$TOOLCHAIN_VER\")," riscv64-gcc-toolchain.cmake
./Tools/test-units.sh <home_dir> <build_dir> "" "riscv64-linux-gnu-gcc,riscv64-linux-gnu-g++" "" "" "" "" "riscv64-gcc-toolchain.cmake"
```

#### x64, ppc64el cross build, sequential; QEMU launch

Next command should be finished successfully for armhf architecture (`long double` testing is skipped) with cross build and launch under QEMU in rootfs:
```sh
export ROOTFS=`pwd`/rootfs/ppc64el
sudo ./create-ubuntu-rootfs.sh ppc64el jammy
TOOLCHAIN_VER=$(ls $ROOTFS/usr/include/c++/)
sed -i "s,set(TOOLCHAIN_VERSION \"9\"),set(TOOLCHAIN_VERSION \"$TOOLCHAIN_VER\")," ppc64el-gcc-toolchain.cmake
./Tools/test-units.sh <home_dir> <build_dir> "" "powerpc64le-linux-gnu-gcc,powerpc64le-linux-gnu-g++" "" "" "" "f d" "ppc64el-gcc-toolchain.cmake"
```

#### OPTIONAL: aarch32(armhf), sequential; native launch

```sh
./Tools/test-units.sh <home_dir> <build_dir> "" "" "" "" "" "f d" ""
```

#### OPTIONAL: aarch64, sequential; native launch

```sh
./Tools/test-units.sh <home_dir> <build_dir> "" "" "" "" "" "" ""
```

#### OPTIONAL: riscv64, sequential; native launch

```sh
./Tools/test-units.sh <home_dir> <build_dir> "" "" "" "" "" "" ""
```

#### OPTIONAL: ppc64el, sequential; native launch

```sh
./Tools/test-units.sh <home_dir> <build_dir> "" "" "" "" "" "f d" ""
```

## 3. Test suite

Next command should be finished successfully for each architecture:
#### x64, sequential, mpi and cuda testing; native launch

Next command should be finished successfully for x64 architecture:
```sh
./Tests/run-testsuite.sh 0 0
```
Expand All @@ -153,12 +220,80 @@ Next command should be finished successfully for x64 mpi architecture:
./Tests/run-testsuite.sh 1 0 mpicc mpicxx
```

Next command should be finished successfully for x64 cuda architecture:
Next command should be finished successfully for x64 cuda architecture (this one is not launched in CI!):
```sh
./Tests/run-testsuite.sh 0 1
```

Next command should be finished successfully for x64 cuda/mpi architecture:
Next command should be finished successfully for x64 cuda/mpi architecture (this one is not launched in CI!):
```sh
./Tests/run-testsuite.sh 1 1 mpicc mpicxx
```

#### x64, aarch32(armhf) cross build, sequential; QEMU launch

Next command should be finished successfully for armhf architecture (`long double` testing is skipped) with cross build and launch under QEMU in rootfs:
```sh
export ROOTFS=`pwd`/rootfs/armhf
sudo ./create-ubuntu-rootfs.sh armhf jammy
TOOLCHAIN_VER=$(ls $ROOTFS/usr/include/c++/)
sed -i "s,set(TOOLCHAIN_VERSION \"8\"),set(TOOLCHAIN_VERSION \"$TOOLCHAIN_VER\")," arm-gcc-toolchain.cmake
./Tests/run-testsuite.sh 0 0 arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ arm-gcc-toolchain.cmake
```

#### x64, aarch64 cross build, sequential; QEMU launch

Next command should be finished successfully for arm64 architecture with cross build and launch under QEMU in rootfs:
```sh
export ROOTFS=`pwd`/rootfs/arm64
sudo ./create-ubuntu-rootfs.sh arm64 jammy
TOOLCHAIN_VER=$(ls $ROOTFS/usr/include/c++/)
sed -i "s,set(TOOLCHAIN_VERSION \"7\"),set(TOOLCHAIN_VERSION \"$TOOLCHAIN_VER\")," arm64-gcc-toolchain.cmake
./Tests/run-testsuite.sh 0 0 aarch64-linux-gnu-gcc aarch64-linux-gnu-g++ arm64-gcc-toolchain.cmake
```

#### x64, riscv64 cross build, sequential; QEMU launch

Next command should be finished successfully for arm64 architecture with cross build and launch under QEMU in rootfs:
```sh
export ROOTFS=`pwd`/rootfs/riscv64
sudo ./create-ubuntu-rootfs.sh riscv64 jammy
TOOLCHAIN_VER=$(ls $ROOTFS/usr/include/c++/)
sed -i "s,set(TOOLCHAIN_VERSION \"9\"),set(TOOLCHAIN_VERSION \"$TOOLCHAIN_VER\")," riscv64-gcc-toolchain.cmake
./Tests/run-testsuite.sh 0 0 riscv64-linux-gnu-gcc riscv64-linux-gnu-g++ riscv64-gcc-toolchain.cmake
```

#### x64, ppc64el cross build, sequential; QEMU launch

Next command should be finished successfully for armhf architecture (`long double` testing is skipped) with cross build and launch under QEMU in rootfs:
```sh
export ROOTFS=`pwd`/rootfs/ppc64el
sudo ./create-ubuntu-rootfs.sh ppc64el jammy
TOOLCHAIN_VER=$(ls $ROOTFS/usr/include/c++/)
sed -i "s,set(TOOLCHAIN_VERSION \"9\"),set(TOOLCHAIN_VERSION \"$TOOLCHAIN_VER\")," ppc64el-gcc-toolchain.cmake
./Tests/run-testsuite.sh 0 0 powerpc64le-linux-gnu-gcc powerpc64le-linux-gnu-g++ ppc64el-gcc-toolchain.cmake
```

#### OPTIONAL: aarch32(armhf), sequential; native launch

```sh
./Tests/run-testsuite.sh 0 0
```

#### OPTIONAL: aarch64, sequential; native launch

```sh
./Tests/run-testsuite.sh 0 0
```

#### OPTIONAL: riscv64, sequential; native launch

```sh
./Tests/run-testsuite.sh 0 0
```

#### OPTIONAL: ppc64el, sequential; native launch

```sh
./Tests/run-testsuite.sh 0 0
```
27 changes: 24 additions & 3 deletions Tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Test suite contains different electromagnetics tests, which should **all be successful** in order to merge change into `master`.

# Run on CPU
## Run on CPU

To run test suite execute next script from home folder of fdtd3d:
```
./run-testsuite.sh
./Tests/run-testsuite.sh
```

This script will fail on the first failed test. To run each individual test execute next script from home folder of fdtd3d (example for test `t1.1`):
Expand All @@ -21,11 +21,32 @@ for i in t1.1 t1.2 t2.1 t2.2 t2.3 t3 t4.1 t4.2 t4.3 t5 t6.1 t6.2 t6.3 t6.4 t6.5
done
```

# Run on GPU
To run test suite with specific compiler execute next script from home folder of fdtd3d:
```
./Tests/run-testsuite.sh 1 0 $C_COMPILER $CXX_COMPILER
```

## Run on GPU

To run test suite execute next script from home folder of fdtd3d:
```
./Tests/run-testsuite.sh 1 1
```

To run each individual test on GPU execute next script from home folder of fdtd3d (example for test `t1.1`):
```
./Tests/run-test.sh t1.1 1 1 `pwd`/Tests `pwd`
```

Do not forget to use `cmake >= 3.8` for Cuda builds.

## Run under QEMU in rootfs

To run test suite execute next script from home folder of fdtd3d (example for arm64):
```
export ROOTFS=`pwd`/rootfs/arm64
sudo ./create-ubuntu-rootfs.sh arm64 jammy
TOOLCHAIN_VER=$(ls $ROOTFS/usr/include/c++/)
sed -i "s,set(TOOLCHAIN_VERSION \"7\"),set(TOOLCHAIN_VERSION \"$TOOLCHAIN_VER\")," arm64-gcc-toolchain.cmake
./Tests/run-testsuite.sh 0 0 aarch64-linux-gnu-gcc aarch64-linux-gnu-g++ arm64-gcc-toolchain.cmake
```
5 changes: 2 additions & 3 deletions Tests/run-testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ TEST_MPI=$1; shift
# 1 to test in CUDA mode
CUDA_MODE=$1; shift

C_COMPILER=$1
CXX_COMPILER=$2
ARGS=$@

# check exit code
function check_res ()
Expand Down Expand Up @@ -61,7 +60,7 @@ for testdir in `ls $CUR_DIR/Tests/suite`; do

echo "$test_num. Testing <$testdir> ($percent_before%):"

$CUR_DIR/Tests/run-test.sh $testdir $TEST_MPI $CUDA_MODE $CUR_DIR/Tests $SOURCE_DIR $C_COMPILER $CXX_COMPILER &> /dev/null
$CUR_DIR/Tests/run-test.sh $testdir $TEST_MPI $CUDA_MODE $CUR_DIR/Tests $SOURCE_DIR $ARGS &> /dev/null
check_res

echo "OK!"
Expand Down

0 comments on commit 3f07d82

Please sign in to comment.