Commit 770c6c0b authored by Sebastien Robin's avatar Sebastien Robin

add python code to launch automatically jio qunit tests

parent a91c592e
...@@ -14,7 +14,7 @@ PARSER_OUT = $(QUERIES_DIR)/parser.js ...@@ -14,7 +14,7 @@ PARSER_OUT = $(QUERIES_DIR)/parser.js
## js/cc using rhino ## js/cc using rhino
#JSCC_CMD = rhino ~/modules/jscc/jscc.js -t ~/modules/jscc/driver_web.js_ #JSCC_CMD = rhino ~/modules/jscc/jscc.js -t ~/modules/jscc/driver_web.js_
# sh -c 'cd ; npm install jscc-node' # sh -c 'cd ; npm install jscc-node'
JSCC_CMD = node ~/node_modules/jscc-node/jscc.js -t ~/node_modules/jscc-node/driver_node.js_ JSCC_CMD = nodejs ~/node_modules/jscc-node/jscc.js -t ~/node_modules/jscc-node/driver_node.js_
# sh -c 'cd ; npm install jslint' # sh -c 'cd ; npm install jslint'
LINT_CMD = $(shell which jslint || echo node ~/node_modules/jslint/bin/jslint.js) --terse LINT_CMD = $(shell which jslint || echo node ~/node_modules/jslint/bin/jslint.js) --terse
# sh -c 'cd ; npm install uglify-js' # sh -c 'cd ; npm install uglify-js'
......
import os
from setuptools import setup, find_packages
setup(
name = "test_launcher_for_jio",
version = "0.0.4",
author = "Sebastien Robin",
author_email = "andrewjcarter@gmail.com",
description = ("only launch jio test."),
license = "GPL",
keywords = "jio test",
url = "http://j-io.org",
packages=['test_launcher_for_jio', 'test_launcher_for_jio.tests'],
long_description="",
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: GPL License",
],
test_suite='test_launcher_for_jio.tests',
)
\ No newline at end of file
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
from unittest import TestCase
import subprocess
import os
class JIOTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_01_jio_without_requirejs(self):
"""
Launch jio test without requirejs
"""
command = ["%s %s %s; exit 0" % (
os.path.expanduser('~/bin/phantomjs'),
os.path.expanduser('~/parts/jio/test/run-qunit.js'),
os.path.expanduser('~/parts/jio/test/jiotests_withoutrequirejs.html'))]
print command
result = subprocess.check_output(
command,
stderr=subprocess.STDOUT,
shell=True)
print result
self.assertTrue(result.find("assertions of")>=0)
# we should have string like 443 assertions of 444 passed, 1 failed.
total_quantity = 0
passed_quantity = 0
failed_quantity = 0
for line in result.split('\n'):
if line.find("assertions of") >=0:
splitted_line = line.split()
passed_quantity = splitted_line[0]
total_quantity = splitted_line[3]
failed_quantity = splitted_line[5]
self.assertTrue(total_quantity > 0)
print "\nJIO SUB RESULT: %s Tests, %s Failures" % (total_quantity,
failed_quantity)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment