Author: sebastien.lelong
Date: Sun Oct 12 09:14:33 2008
New Revision: 399
Modified:
trunk/tools/jallib
Log:
start impl. "test" action (doc) + will not include subprocess module in not
in "compile" action
Modified: trunk/tools/jallib
==============================================================================
--- trunk/tools/jallib (original)
+++ trunk/tools/jallib Sun Oct 12 09:14:33 2008
@@ -21,7 +21,8 @@
import sys, os
import getopt
-import subprocess
+import re
+
@@ -46,6 +47,9 @@
def do_compile(args):
+ # localized import: subprocess seems not working
+ # on certain OS or python installation.
+ import subprocess
# If we can't parse given args, this means there're all
# for the compiler. Keep them as backup
@@ -119,8 +123,6 @@
# VALIDATE #
#----------#
-import re
-
def content_not_empty(val):
return val.strip() != ''
def compiler_version(val):
@@ -348,6 +350,16 @@
sys.exit(0)
+#------#
+# TEST #
+#------#
+
+def do_test(args):
+ # localized import: if one doesn't want to deal
+ # with test, don't force him to install yaml lib
+ import yaml
+ print "do_test, args: %s" % repr(args)
+
#############
# HELP FUNC #
@@ -358,6 +370,7 @@
Actions:
- compile : compile the given file, expanding one or more root
directories containing libraries
- validate : validate the given file, according to Jallib Style Guide
(JSG)
+ - test : handle testing matrix and test results.
Use 'help' with each action for more (eg. "jallib help compile")
@@ -403,6 +416,24 @@
See: http://code.google.com/p/jallib/wiki/JallibStyleGuide for more
"""
+def test_help():
+ print """
+ jallib test -U -F testing_matrix.yaml [-S path/to/sample]
+
+Use this option to handle test.
+
+ -U: update an existing testing matrix, by searching for new samples
and tests.
+ This won't erase previous testing results, but will potentially
add new test line
+ to the testing matrix file.
+
+ -F: file storing the testing matrix results. YAML formatted
+
+ -S: path to the sample directory. If no option is given, it will
expect to define
+ as an environment variable, JALLIB_SAMPLEDIR
+
+
+"""
+
def do_help(action_args=[]):
action = None
if action_args:
@@ -417,6 +448,7 @@
ACTIONS = {
'compile' : {'callback' : do_compile, 'options' : 'R:E:',
'help' :
compile_help},
'validate' : {'callback' : do_validate, 'options' : '',
'help' :
validate_help},
+ 'test' : {'callback' : do_test, 'options' : 'S:GU',
'help' : test_help},
'help' : {'callback' : do_help, 'options' : '', 'help'
: None},
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---