#!/usr/bin/env python2.7
#
# Runs the TC-Jasmine tests under PhantomJS.
#
# Copyright (C) 2015-2016 Menlo Security, Inc.
#
# Author: Gautam Altekar
##############################################################################

import os
import subprocess
import sys

root = os.path.abspath(os.path.dirname(__file__))
os.chdir(os.path.join(root, 'src'))
# SpecRunner runs tests against minified TC, so we must 'make' the TC before
# we run the tests to ensure that tests are running against the latest code.
subprocess.check_call(['make'])
os.chdir(root)
subprocess.check_call(['phantomjs', './run-jasmine.js', 'SpecRunner.html'])
