#! /usr/bin/env python
import sys
import os
import os.path
import crds
from crds import config, log

os.chdir(os.path.dirname(sys.argv[0]) or ".")
topdir = os.getcwd()

# Unlike historical CRDS with builtin cache,  test cache is now a separate 
# subversion checkout from ^/branches/crds_cache_test to ../crds_cache_test.
# os.environ["CRDS_MAPPATH"] = os.path.join(os.getcwd(), "..", "crds_cache_archive", "mappings")
os.environ["CRDS_CACHE_TEST"] = os.path.join(os.getcwd(), "..", "crds_cache_test")

os.system("python -m crds.sync --all --stats")    
os.system("./install")
# os.system("nosetests --with-coverage --cover-html --cover-html-dir={0}/coverage --cover-branches --cover-package=crds --cover-erase".format(topdir))
os.system("nosetests")

