#! /usr/bin/env python

"""
runs the manual tests without the need to build and install
"""

import os
import sys
import shutil
import logging
import glob

sys.path.insert(0, "..")

from keres import _bayestest

if __name__ == "__main__":

  logging.basicConfig(level=logging.INFO)

  logging.info("%%%%%%%%%%%%%%%%%%%% testing %%%%%%%%%%%%%%%%%%%%")

  files = glob.glob("./*.results-normal.test")
  files += ["results.tmp", "temporary.cps"]
  for f in files:
    if os.path.exists(f):
      logging.info("Removing '%s'." % (f,))
      if os.path.isdir(f):
        shutil.rmtree(f)
      else:
        os.remove(f)

  logging.info("Running _bayestest()")
  _bayestest._bayestest()

