# Copyright (c) 2013-2020, SIB - Swiss Institute of Bioinformatics and
#                          Biozentrum - University of Basel
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#   http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


Check installation of PM3:
==========================

The idea is that we setup a folder contraining a set of tests to check a given
installation of ProMod3.

First, we setup that folder:
Execute "prepare_sanity_checks.sh GIT_ROOT TRG_PATH", where:
- GIT_ROOT = root path of ProMod3 git repository (containing doc/tests folder)
- TRG_PATH = target path, which is created and contains tests for installation

Then, we adapt the variables "OST_ROOT" and "PROMOD3_ROOT" in the "Makefile".
They should point to the location, where OST and ProMod3 were installed.

Also, for the setup to work, we need to have LD_LIBRARY_PATH (to find OST and
ProMod3 libraries) and PROMOD3_SHARED_DATA_PATH to be set.

Execute tests: "pm test_all.py"
-> use "PM_BIN test_all.py PM_BIN" if "pm" is not in PATH
-> this will run all tests (it is quite verbose)
-> if all tests succeed, the error code 0 is returned, otherwise it's non-zero

Details on the tests:
- "pm test_module.py" should report the shared data path and the version
- "pm run_pipeline.py" runs a full modelling pipeline as we would use in 
SMNG (it should run w/o errors and create a model.pdb file)
- doctests: example codes used in the ProMod3 documentation
- C++ interface: "make run" should have same output as test_module.py
