Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build testpackage definition automatically from directories. #782

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 19 additions & 129 deletions testpackage/small_test_definitions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,138 +18,28 @@ run_dir="run"
test_dir="tests"

# choose tests to run
run_tests=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 18 19)
tests=()

# acceleration test
test_name[1]="acctest_2_maxw_500k_100k_20kms_10deg"
comparison_vlsv[1]="fullf.0000001.vlsv"
comparison_phiprof[1]="phiprof_0.txt"
variable_names[1]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[1]="0 0 1 2"
single_cell[1]=1
# If no tests are specified, run all tests/ subdirectories.
if [ "${#tests[@]}" -eq "0" ]; then
tests=($(/bin/ls -d tests/*))
echo "No run_tests list specified, using all ${#tests[@]} subdirectories of tests/"
fi;

# acceleration test w/ substepping
test_name[2]="acctest_3_substeps"
comparison_vlsv[2]="fullf.0000001.vlsv"
comparison_phiprof[2]="phiprof_0.txt"
variable_names[2]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[2]="0 0 1 2"
single_cell[2]=1

# translation test
test_name[3]="transtest_2_maxw_500k_100k_20kms_20x20"
comparison_vlsv[3]="fullf.0000001.vlsv"
comparison_phiprof[3]="phiprof_0.txt"
variable_names[3]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[3]="0 0 1 2"
# Iterate through the specified tests and add them to the table
num_tests=0
for i in ${tests[@]}; do
if [ -f $i/test_spec.sh ]; then
test_name[$num_tests]=$i
. $i/test_spec.sh
num_tests=$((num_tests + 1))
else
echo "Warning: test $i does not have a test_spec.sh."
fi
done

test_name[4]="acctest_4_helium"
comparison_vlsv[4]="fullf.0000001.vlsv"
comparison_phiprof[4]="phiprof_0.txt"
variable_names[4]="helium/vg_rho helium/vg_v helium/vg_v helium/vg_v"
variable_components[4]="0 0 1 2"
single_cell[4]=1
run_tests=($(seq 0 $((num_tests-1))))

# Gyration test with protons and antiprotons
test_name[5]="acctest_5_proton_antiproton"
comparison_vlsv[5]="fullf.0000001.vlsv"
comparison_phiprof[5]="phiprof_0.txt"
variable_names[5]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[5]="0 0 1 2"
single_cell[5]=1
echo $num_tests test to run in total.

# Restart tests. Writing and reading
test_name[6]="restart_write"
comparison_vlsv[6]="bulk.0000001.vlsv"
comparison_phiprof[6]="phiprof_0.txt"
variable_names[6]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[6]="0 0 1 2 0 1 2 0 1 2"
test_name[7]="restart_read"
comparison_vlsv[7]="initial-grid.0000000.vlsv"
comparison_phiprof[7]="phiprof_0.txt"
variable_names[7]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[7]="0 0 1 2 0 1 2 0 1 2"

#Very small ecliptic magnetosphere, no subcycling in ACC or FS
test_name[8]="Magnetosphere_small"
comparison_vlsv[8]="bulk.0000001.vlsv"
comparison_phiprof[8]="phiprof_0.txt"
variable_names[8]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e proton"
variable_components[8]="0 0 1 2 0 1 2 0 1 2"

#Very small polar magnetosphere, with subcycling in ACC or FS
test_name[9]="Magnetosphere_polar_small"
comparison_vlsv[9]="bulk.0000001.vlsv"
comparison_phiprof[9]="phiprof_0.txt"
variable_names[9]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e proton/vg_v_nonthermal proton/vg_v_nonthermal proton/vg_v_nonthermal proton/vg_ptensor_nonthermal_diagonal proton/vg_ptensor_nonthermal_diagonal proton/vg_ptensor_nonthermal_diagonal proton"
variable_components[9]="0 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2"

# Field solver test
test_name[10]="test_fp_fsolver_only_3D"
comparison_vlsv[10]="fullf.0000001.vlsv"
comparison_phiprof[10]="phiprof_0.txt"
variable_names[10]="fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[10]="0 1 2 0 1 2"

# Field solver test w/ subcycles
test_name[11]="test_fp_substeps"
comparison_vlsv[11]="fullf.0000001.vlsv"
comparison_phiprof[11]="phiprof_0.txt"
variable_names[11]="fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[11]="0 1 2 0 1 2"

# Flowthrough tests
test_name[12]="Flowthrough_trans_periodic"
comparison_vlsv[12]="bulk.0000001.vlsv"
comparison_phiprof[12]="phiprof_0.txt"
variable_names[12]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[12]="0 0 1 2 0 1 2 0 1 2"

test_name[13]="Flowthrough_x_inflow_y_outflow"
comparison_vlsv[13]="bulk.0000001.vlsv"
comparison_phiprof[13]="phiprof_0.txt"
variable_names[13]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[13]="0 0 1 2 0 1 2 0 1 2"

test_name[14]="Flowthrough_x_inflow_y_outflow_acc"
comparison_vlsv[14]="bulk.0000001.vlsv"
comparison_phiprof[14]="phiprof_0.txt"
variable_names[14]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[14]="0 0 1 2 0 1 2 0 1 2"

# Self-consistent wave generation test
test_name[15]="Selfgen_Waves_Periodic"
comparison_vlsv[15]="fullf.0000001.vlsv"
comparison_phiprof[15]="phiprof_0.txt"
variable_names[15]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e proton"
variable_components[15]="0 0 1 2 0 1 2 0 1 2"

## Velocity AMR tests
# translation test
test_name[16]="transtest_amr"
comparison_vlsv[16]="fullf.0000001.vlsv"
comparison_phiprof[16]="phiprof_0.txt"
variable_names[16]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[16]="0 0 1 2"

## Spatial AMR tests
# Flowthrough test
test_name[17]="Flowthrough_amr"
comparison_vlsv[17]="bulk.0000001.vlsv"
comparison_phiprof[17]="phiprof_0.txt"
variable_names[17]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[17]="0 0 1 2 0 1 2 0 1 2"

# Magnetosphere 3D
test_name[18]="Magnetosphere_3D_small"
comparison_vlsv[18]="bulk.0000001.vlsv"
comparison_phiprof[18]="phiprof_0.txt"
variable_names[18]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[18]="0 0 1 2 0 1 2 0 1 2"

# Ionosphere 3D
test_name[19]="Ionosphere_small"
comparison_vlsv[19]="bulk.0000001.vlsv"
comparison_phiprof[19]="phiprof_0.txt"
variable_names[19]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e ig_upmappedarea ig_fac ig_rhon ig_potential"
variable_components[19]="0 0 1 2 0 1 2 0 1 2 0 0 0 0"
5 changes: 5 additions & 0 deletions testpackage/tests/Flowthrough_amr/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
comparison_vlsv[$num_tests]="bulk.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2"

4 changes: 4 additions & 0 deletions testpackage/tests/Flowthrough_trans_periodic/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="bulk.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2"
4 changes: 4 additions & 0 deletions testpackage/tests/Flowthrough_x_inflow_y_outflow/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="bulk.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="bulk.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2"
4 changes: 4 additions & 0 deletions testpackage/tests/Ionosphere_small/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="bulk.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e ig_upmappedarea ig_fac ig_rhon ig_potential"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2 0 0 0 0"
4 changes: 4 additions & 0 deletions testpackage/tests/Magnetosphere_3D_small/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="bulk.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2"
4 changes: 4 additions & 0 deletions testpackage/tests/Magnetosphere_polar_small/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="bulk.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e proton/vg_v_nonthermal proton/vg_v_nonthermal proton/vg_v_nonthermal proton/vg_ptensor_nonthermal_diagonal proton/vg_ptensor_nonthermal_diagonal proton/vg_ptensor_nonthermal_diagonal proton"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2"
4 changes: 4 additions & 0 deletions testpackage/tests/Magnetosphere_small/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="bulk.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e proton"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2"
4 changes: 4 additions & 0 deletions testpackage/tests/Selfgen_Waves_Periodic/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="fullf.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e proton"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# acceleration test
comparison_vlsv[$num_tests]="fullf.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[$num_tests]="0 0 1 2"
single_cell[$num_tests]=1
5 changes: 5 additions & 0 deletions testpackage/tests/acctest_3_substeps/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
comparison_vlsv[$num_tests]="fullf.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[$num_tests]="0 0 1 2"
single_cell[$num_tests]=1
5 changes: 5 additions & 0 deletions testpackage/tests/acctest_4_helium/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
comparison_vlsv[$num_tests]="fullf.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="helium/vg_rho helium/vg_v helium/vg_v helium/vg_v"
variable_components[$num_tests]="0 0 1 2"
single_cell[$num_tests]=1
5 changes: 5 additions & 0 deletions testpackage/tests/acctest_5_proton_antiproton/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
comparison_vlsv[$num_tests]="fullf.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[$num_tests]="0 0 1 2"
single_cell[$num_tests]=1
4 changes: 4 additions & 0 deletions testpackage/tests/restart_read/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="initial-grid.0000000.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2"
4 changes: 4 additions & 0 deletions testpackage/tests/restart_write/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="bulk.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[$num_tests]="0 0 1 2 0 1 2 0 1 2"
4 changes: 4 additions & 0 deletions testpackage/tests/test_fp_fsolver_only_3D/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="fullf.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[$num_tests]="0 1 2 0 1 2"
4 changes: 4 additions & 0 deletions testpackage/tests/test_fp_substeps/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="fullf.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="fg_b fg_b fg_b fg_e fg_e fg_e"
variable_components[$num_tests]="0 1 2 0 1 2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="fullf.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[$num_tests]="0 0 1 2"
4 changes: 4 additions & 0 deletions testpackage/tests/transtest_amr/test_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comparison_vlsv[$num_tests]="fullf.0000001.vlsv"
comparison_phiprof[$num_tests]="phiprof_0.txt"
variable_names[$num_tests]="proton/vg_rho proton/vg_v proton/vg_v proton/vg_v proton"
variable_components[$num_tests]="0 0 1 2"