2018-11-08 13:56:15 +01:00
|
|
|
#!/bin/bash -e
|
2018-04-22 08:32:48 +00:00
|
|
|
|
|
|
|
|
# author: Ole Schuett
|
|
|
|
|
|
2021-04-09 14:17:21 +02:00
|
|
|
function run_test {
|
|
|
|
|
TEST_COMMAND=("$@")
|
|
|
|
|
echo -en "Running \"${TEST_COMMAND[*]}\"... "
|
|
|
|
|
if "${TEST_COMMAND[@]}" &> test.out; then
|
|
|
|
|
echo "done."
|
|
|
|
|
else
|
|
|
|
|
echo -e "failed.\n\n"
|
|
|
|
|
tail -n 100 test.out
|
2023-12-12 17:17:07 +01:00
|
|
|
mkdir -p /workspace/artifacts/
|
|
|
|
|
cp test.out /workspace/artifacts/
|
2021-04-09 14:17:21 +02:00
|
|
|
echo -e "\nSummary: Test \"${TEST_COMMAND[*]}\" failed."
|
|
|
|
|
echo -e "Status: FAILED\n"
|
|
|
|
|
exit 0
|
2021-02-17 17:02:43 +01:00
|
|
|
fi
|
2019-05-14 12:56:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-08 16:07:05 +00:00
|
|
|
#===============================================================================
|
2022-03-11 12:33:27 +01:00
|
|
|
cd /opt/cp2k
|
2018-11-08 13:56:15 +01:00
|
|
|
|
2023-10-04 11:42:07 +02:00
|
|
|
echo "Using $(python3 --version) and the following packages:"
|
|
|
|
|
pip3 freeze
|
2021-04-09 14:17:21 +02:00
|
|
|
echo ""
|
2018-04-08 16:07:05 +00:00
|
|
|
|
2022-02-19 14:35:21 +01:00
|
|
|
# prepare inputs for minimax_to_fortran_source.py
|
|
|
|
|
unzip -q -d ./tools/minimax_tools/1_xData 1_xData.zip
|
|
|
|
|
|
2024-08-04 11:51:04 +02:00
|
|
|
run_test ./tools/precommit/format_fortran_test.py
|
2021-11-10 22:10:06 +01:00
|
|
|
run_test ./tools/minimax_tools/minimax_to_fortran_source.py --check
|
2022-01-30 00:26:23 +01:00
|
|
|
run_test ./tools/docker/generate_dockerfiles.py --check
|
2021-11-10 22:10:06 +01:00
|
|
|
|
2025-01-07 21:54:18 +01:00
|
|
|
# Test pao-ml training.
|
2026-02-08 17:01:06 +01:00
|
|
|
# Passing example.pao twice to have enough samples to split off 20% for validation.
|
|
|
|
|
run_test ./tools/pao-ml/pao-train.py --kind=H --epochs=200 ./tools/pao-ml/example.pao ./tools/pao-ml/example.pao
|
|
|
|
|
run_test ./tools/pao-ml/pao-retrain.py --model="DZVP-MOLOPT-GTH-PAO4-H.pt" --epochs=200 ./tools/pao-ml/example.pao ./tools/pao-ml/example.pao
|
2025-01-08 22:13:53 +01:00
|
|
|
run_test ./tools/pao-ml/pao-validate.py --threshold=1e-1 --model="DZVP-MOLOPT-GTH-PAO4-H.pt" ./tools/pao-ml/example.pao
|
2025-01-07 21:54:18 +01:00
|
|
|
run_test ./tools/pao-ml/pao-validate.py --threshold=1e-6 --model="tests/QS/regtest-pao-5/DZVP-MOLOPT-GTH-PAO4-H.pt" ./tools/pao-ml/example.pao
|
|
|
|
|
run_test ./tools/pao-ml/pao-validate.py --threshold=1e-5 --model="tests/QS/regtest-pao-5/DZVP-MOLOPT-GTH-PAO4-O.pt" ./tools/pao-ml/example.pao
|
|
|
|
|
|
2025-12-10 18:16:03 +01:00
|
|
|
# Test vibronic_spec
|
|
|
|
|
run_test ./tools/vibronic_spec/main.py ./tools/vibronic_spec/example/example_config.toml
|
|
|
|
|
|
2025-01-07 21:54:18 +01:00
|
|
|
run_test mypy --strict ./tools/pao-ml/
|
2026-07-20 23:42:41 +02:00
|
|
|
run_test mypy --strict ./tools/mace/create_cp2k_model.py
|
2021-11-10 22:10:06 +01:00
|
|
|
run_test mypy --strict ./tools/minimax_tools/minimax_to_fortran_source.py
|
2021-04-09 14:17:21 +02:00
|
|
|
run_test mypy --strict ./tools/dashboard/generate_dashboard.py
|
2021-06-03 23:40:05 +02:00
|
|
|
run_test mypy --strict ./tools/regtesting/optimize_test_dirs.py
|
2026-05-17 18:30:20 +02:00
|
|
|
run_test mypy --strict ./tools/regtesting/compare_wannier90_mmn.py
|
2026-05-17 22:20:32 +02:00
|
|
|
run_test mypy --strict ./tools/regtesting/validate_wannier90_export.py
|
2022-07-16 13:47:33 +02:00
|
|
|
run_test mypy --strict ./tools/precommit/precommit.py
|
2021-07-23 22:16:57 +02:00
|
|
|
run_test mypy --strict ./tools/precommit/check_file_properties.py
|
2022-02-06 14:13:52 +01:00
|
|
|
run_test mypy --strict ./tools/precommit/format_makefile.py
|
2023-12-18 20:52:09 +01:00
|
|
|
run_test mypy --strict ./tools/precommit/format_input_file.py
|
2022-01-30 00:26:23 +01:00
|
|
|
run_test mypy --strict ./tools/docker/generate_dockerfiles.py
|
2026-01-02 12:47:17 +01:00
|
|
|
run_test mypy --strict ./tools/docker/scripts/plot_performance.py
|
2025-12-03 21:15:14 +01:00
|
|
|
run_test mypy --strict ./tools/conventions/redirect_gfortran_output.py
|
2022-10-07 18:04:52 +02:00
|
|
|
run_test mypy --strict ./tools/conventions/analyze_gfortran_ast.py
|
2023-09-26 21:49:06 +02:00
|
|
|
run_test mypy --strict ./tests/do_regtest.py
|
2023-06-06 22:20:50 +02:00
|
|
|
run_test mypy --strict ./docs/generate_input_reference.py
|
2023-09-10 16:32:04 +02:00
|
|
|
run_test mypy --strict ./docs/fix_github_links.py
|
2025-12-10 18:16:03 +01:00
|
|
|
run_test mypy --strict ./tools/vibronic_spec/
|
2018-04-08 16:07:05 +00:00
|
|
|
|
2026-05-17 22:20:32 +02:00
|
|
|
# Test Wannier90 .wout parsing without requiring an external wannier90.x binary.
|
|
|
|
|
W90_TEST_DIR=$(mktemp -d)
|
|
|
|
|
cat > "${W90_TEST_DIR}/test.wout" << EOF
|
|
|
|
|
Final State
|
|
|
|
|
WF centre and spread 1 ( 1.000000, 2.000000, 3.000000 ) 1.25000000
|
|
|
|
|
Sum of centres and spreads ( 1.000000, 2.000000, 3.000000 ) 1.25000000
|
|
|
|
|
|
|
|
|
|
Spreads (Bohr^2) Omega I = 1.250000000
|
|
|
|
|
================ Omega D = 0.000000000
|
|
|
|
|
Omega OD = 0.000000000
|
|
|
|
|
Final Spread (Bohr^2) Omega Total = 1.250000000
|
|
|
|
|
All done: wannier90 exiting
|
|
|
|
|
EOF
|
|
|
|
|
run_test ./tools/regtesting/validate_wannier90_export.py run test \
|
|
|
|
|
--workdir "${W90_TEST_DIR}" --require-all-done --max-omega-total 2.0
|
|
|
|
|
|
2022-02-19 14:35:21 +01:00
|
|
|
# TODO: Find a way to test generate_dashboard.py without git repository.
|
|
|
|
|
#
|
|
|
|
|
# # Test generate_dashboard.py. Running it twice to also execute its caching.
|
|
|
|
|
# mkdir -p /workspace/artifacts/dashboard
|
|
|
|
|
# for _ in {1..2}; do
|
|
|
|
|
# run_test ./tools/dashboard/generate_dashboard.py \
|
|
|
|
|
# ./tools/dashboard/dashboard.conf \
|
|
|
|
|
# /workspace/artifacts/dashboard/status.pickle \
|
|
|
|
|
# /workspace/artifacts/dashboard/
|
|
|
|
|
# done
|
2019-05-14 12:56:39 +02:00
|
|
|
|
2026-02-24 19:06:05 +08:00
|
|
|
run_test cmake -S . -B build -DCP2K_ENABLE_CONSISTENCY_CHECKS=ON
|
2023-04-17 23:41:44 +02:00
|
|
|
|
2018-04-08 16:07:05 +00:00
|
|
|
echo ""
|
2023-04-17 19:17:17 +02:00
|
|
|
echo "Summary: Miscellaneous tests passed"
|
2021-04-09 14:17:21 +02:00
|
|
|
echo "Status: OK"
|
|
|
|
|
|
|
|
|
|
#EOF
|