#!/usr/bin/env python """run the browsertest script""" import sys import os import py #sys.path.append(str(py.magic.autopath().dirpath())) from browsertest import browsertest, config def which(name): """return the results of a 'which' lookup""" pipe = os.popen('which %s 2> /dev/null' % name) try: path = pipe.read() finally: pipe.close() return path.strip() def run(config): driver = browsertest.BrowserTest() driver.start_server(config) for browser in config.browsers: command = which(browser) if not command: continue print 'Going to test browser:', browser driver.run_tests_in_browser(command, config.tests, config.pathprefix) driver.drive() driver.end_server() run(config)