Author: sebastien.lelong
Date: Mon Oct 20 22:54:47 2008
New Revision: 435

Added:
    trunk/tools/jallib.py
       - copied, changed from r434, /trunk/tools/jallib

Log:
rename to .py extension since different wrappers (different OS) will point  
to it, so explicitely show it as a python script. Alos reformat help to be  
80 cols, so display correctly on win

Copied: trunk/tools/jallib.py (from r434, /trunk/tools/jallib)
==============================================================================
--- /trunk/tools/jallib (original)
+++ trunk/tools/jallib.py       Mon Oct 20 22:54:47 2008
@@ -139,7 +139,7 @@
        try:
                status = subprocess.check_call(cmd,shell=False)
        except subprocess.CalledProcessError,e:
-               print >> sys.stderr, "Error while compiling file (status=%s). 
See  
previous message." % e.returncode
+               print >> sys.stderr, "Error while compiling file 
(status=%s).\nSee  
previous message." % e.returncode
                sys.exit(e.returncode)
        pass

@@ -442,7 +442,7 @@
                try:
                        outfile = os.environ['JALLIB_MATRIX']
                except KeyError:
-                       print >> sys.stderr,"Please provide a file to get/store 
the testing  
matrix (-f option or JALLIB_MATRIX env. var)"
+                       print >> sys.stderr,"Please provide a file to get/store 
the testing  
matrix\n(-f option or JALLIB_MATRIX env. var)"
                        sys.exit(255)
        if not sample_dirs:
                v = os.environ.get('JALLIB_SAMPLEDIR',os.path.curdir)
@@ -541,7 +541,7 @@
        try:
                pic,testfile,result = test_str.split(":")
        except ValueError:
-               print >> sys.stderr,"Please specify the result as  
<pic>:<test_file>:<result> (eg. 16f88:serial_hw_echo.jal:true)"
+               print >> sys.stderr,"Please specify the result as  
<pic>:<test_file>:<result>\n(eg. 16f88:serial_hw_echo.jal:true)"
                sys.exit(1)
        # normalize
        try:
@@ -569,7 +569,7 @@
        try:
                pic,testfile = test_str.split(":")
        except ValueError:
-               print >> sys.stderr,"Please specify the test to remove as  
<pic>:<test_file> (eg. 16f88:bad_test.jal)"
+               print >> sys.stderr,"Please specify the test to remove as  
<pic>:<test_file>\n(eg. 16f88:bad_test.jal)"
                sys.exit(1)
        try:
                print "Unregistering test '%s' from PIC %s" % (testfile,pic)
@@ -619,9 +619,10 @@
  def generic_help():
        print """
  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.
+    - 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")

@@ -639,24 +640,27 @@
  all are included in the command line (except hidden dir, starting  
with '.').

  All arguments given to this action will be passed to the jalv2 compiler
-(so please, do not pass any -s option...). Also be aware the 'jalv2'  
executable
-must be declare in the path (PATH) by default.
+(so please, do not pass any -s option...). Also be aware the 'jalv2'
+executable must be declare in the path (PATH) by default.

  Additional options:

-    -R path1[:path2[:path3]...] : use this option to specify one or more  
root path
-                                  to jallib directories. Directory paths  
are seperated
-                                  using ':' char. If no option is given,  
this script will
-                                  also look at a JALLIB_REPOS environment  
variable. If no
-                                  variable is set, then this script will  
consider the current
-                                  path (cwd) as the root path.
+    -R path1[:path2[:path3]...] : use this option to specify one or more
+                                  root path to jallib directories.  
Directory
+                                  paths are seperated using ':' char. If no
+                                  option is given, this script will also
+                                  look at a JALLIB_REPOS environment  
variable.
+                                  If no variable is set, then this script
+                                  will consider the current path (cwd) as
+                                  the root path.
                                    Precedence: cwd < var < option

-    -E path    : use this option to manually set the path to jalv2  
executable. If not set,
-                 will search for a JALLIB_JALV2 environment variable, or  
default to 'jalv2'
-                                and expect it to be on path.
+    -E path    : use this option to manually set the path to jalv2  
executable.
+                 If not set, will search for a JALLIB_JALV2 environment
+                 variable, or default to 'jalv2' and expect it to be on  
path.

-(for convenience, jallib script's options are uppercased, whereas jalv2's  
are lowercased)
+(for convenience, jallib script's options are uppercased, whereas jalv2's
+are lowercased)

  """

@@ -673,19 +677,21 @@

  def test_help():
        print """
-    jallib test [-u|-a|-d|-m other_matrix.yaml] [-f testing_matrix.yaml]  
[-s path/to/sample]
-                      [-g template.tmpl [-o page.html] [-1] [-t  
template.tmpl]]
-                      [-p picname] [-n pic1,pic2,...]
+    jallib test [-u|-a|-d|-m other_matrix.yaml] [-f testing_matrix.yaml]
+                [-s path/to/sample] [-p picname] [-n pic1,pic2,...]
+                [-g template.tmpl [-o page.html] [-1] [-t template.tmpl]]
+

  Use this option to handle the testing matrix and the test result page.

-    -u: update an existing testing matrix, by searching for new samples.  
Tests must be
-        manually added to the testing matrix file (because tests are not  
relevant to all target chips).
-        This won't erase previous testing results, but will potentially  
add new sample lines
-        to the testing matrix file.
+    -u: update an existing testing matrix, by searching for new samples.
+        Tests must be manually added to the testing matrix file (because
+        tests are not relevant to all target chips). This won't erase
+        previous testing results, but will potentially add new sample
+        lines to the testing matrix file.

-    -a: add or update a test result. If the test does not exist, it's  
added to the matrix, else
-        results will be updated.
+    -a: add or update a test result. If the test does not exist, it's
+        added to the matrix, else results will be updated.
          The format is target:test_file:result. For example:
           * to register a new test which passed, for 16f88
              -a 16f88:new_test.jal:true
@@ -698,33 +704,40 @@
          To remove a test from 16f88 device:
              -d 16f88:bad_test.jal

-    -m: merge another testing matrix with the main one specified with  
option -f. All test results found
-        in this other matrix will replace those found in the main matrix.  
This option, with -n one, allows
-        to work on a small subset of PICs, and then re-integrate the  
results in the main testing matrix.
+    -m: merge another testing matrix with the main one specified with
+        option -f. All test results found in this other matrix will
+        replace those found in the main matrix. This option, with -n one,
+        allows to work on a small subset of PICs, and then re-integrate
+        the results in the main testing matrix.

      -p: print current test result for a given PIC

-    -n: only consider the list of PICs while generating the matrix. PICs  
are comma separated. Ex:
+    -n: only consider the list of PICs while generating the matrix. PICs
+        are comma separated. Ex:
              -n 16f88,16f877,16f877a

-    -g: generate HTML a testing matrix from tests results, and dedicated  
test result pages
-        for each PIC, from both samples and tests. Needs -W option.
+    -g: generate HTML a testing matrix from tests results, and dedicated
+        test result pages for each PIC, from both samples and tests.

-    -1: only generate testing matrix for PIC which have at least one test  
passed.
-       
-    -t: also generate dedidated test result pages for each PIC, using  
given template. The output
-        file will be named as: test_<picname>.html
+    -1: only generate testing matrix for PIC which have at least one test
+        passed.
+
+    -t: also generate dedidated test result pages for each PIC, using given
+        template. The output file will be named as: test_<picname>.html
+        (not implemented yet)

-    -o: specify output HTML file. Used with -g option. If omitted, will be  
named the same as the
-        template file, with ".html" extension
+    -o: specify output HTML file. Used with -g option. If omitted, will be
+        named the same as the template file, with ".html" extension

-    -f: file storing the testing matrix results. YAML formatted. If not  
specified, will look for a
-        JALLIB_MATRIX environment variable.
+    -f: file storing the testing matrix results. YAML formatted. If not
+        specified, will look for a JALLIB_MATRIX environment variable.

-    -s: path to the sample directory (or multiple sample directory, ':'  
separated). If no option is given,
-        it will expect to define as an environment variable,  
JALLIB_SAMPLEDIR. If no option is given, and
-        no env. variable can be found, the current directory will be  
considered.
-        The sample(s) directory(ies) *must* contain a 'by_device'  
directory.
+    -s: path to the sample directory (or multiple sample directory,
+        ':' separated). If no option is given, it will expect to define as
+        an environment variable, JALLIB_SAMPLEDIR. If no option is given,
+        and no env. variable can be found, the current directory will be
+        considered. The sample(s) directory(ies) *must* contain a
+        'by_device' directory.

  """


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to