3 new revisions:

Revision: 152341717e54
Author:   Pekka Klärck
Date:     Wed Feb 15 06:11:04 2012
Log:      windows test fixes
http://code.google.com/p/robotframework/source/detail?r=152341717e54

Revision: a0b58038d275
Author:   Pekka Klärck
Date:     Wed Feb 15 06:26:44 2012
Log:      LibDocLib: normalize newlines on Windows
http://code.google.com/p/robotframework/source/detail?r=a0b58038d275

Revision: 5edd87ebf96f
Author:   Pekka Klärck
Date:     Wed Feb 15 07:43:46 2012
Log: LibDoc: 1) Added test and fixed using Python libs with relative paths,...
http://code.google.com/p/robotframework/source/detail?r=5edd87ebf96f

==============================================================================
Revision: 152341717e54
Author:   Pekka Klärck
Date:     Wed Feb 15 06:11:04 2012
Log:      windows test fixes
http://code.google.com/p/robotframework/source/detail?r=152341717e54

Modified:
 /atest/robot/core/resource_and_variable_imports.txt
 /atest/robot/test_libraries/library_imports_by_path.txt

=======================================
--- /atest/robot/core/resource_and_variable_imports.txt Thu Jan 5 06:32:14 2012 +++ /atest/robot/core/resource_and_variable_imports.txt Wed Feb 15 06:11:04 2012
@@ -102,9 +102,8 @@
Check Stderr Contains [ WARN ] Imported resource file '${path}' is empty

 Invalid Resource Import Parameters
-    ${path} =  Normalize Path  resources_and_variables/resources.html
     Stderr Should Contain Error    ${DATAFILE}
-    ...  Resource file '${path} only one parameter allowed' does not exist
+ ... Resource file 'resources_and_variables/resources.html only one parameter allowed' does not exist

 Invalid Setting In Resource File
     Stderr Should Contain Error    ${RESDIR}/resources.html
=======================================
--- /atest/robot/test_libraries/library_imports_by_path.txt Thu May 19 13:13:43 2011 +++ /atest/robot/test_libraries/library_imports_by_path.txt Wed Feb 15 06:11:04 2012
@@ -49,7 +49,7 @@
Check Stderr Contains Importing test library 'java_libraries.html' failed: ImportError: No module named java_libraries

 Importing Non Python Dir Fails
-    Check Stderr Contains  Test library 'library_scope${/}' does not exist.
+    Check Stderr Contains  Test library 'library_scope/' does not exist.

 Importing Non Existing Py File
Check Stderr Contains Test library 'this_does_not_exist.py' does not exist.

==============================================================================
Revision: a0b58038d275
Author:   Pekka Klärck
Date:     Wed Feb 15 06:26:44 2012
Log:      LibDocLib: normalize newlines on Windows
http://code.google.com/p/robotframework/source/detail?r=a0b58038d275

Modified:
 /atest/robot/libdoc/LibDocLib.py

=======================================
--- /atest/robot/libdoc/LibDocLib.py    Thu Feb  9 06:14:02 2012
+++ /atest/robot/libdoc/LibDocLib.py    Wed Feb 15 06:26:44 2012
@@ -23,6 +23,6 @@
         stdout = tempfile.TemporaryFile()
call(cmd, env=self._env, stdout=stdout, stderr=STDOUT, shell=os.sep=='\\')
         stdout.seek(0)
-        output = stdout.read()
+        output = stdout.read().replace('\r\n', '\n')
         logger.debug(output)
         return output

==============================================================================
Revision: 5edd87ebf96f
Author:   Pekka Klärck
Date:     Wed Feb 15 07:43:46 2012
Log: LibDoc: 1) Added test and fixed using Python libs with relative paths, 2) Added some more tests for creating content in different formats. Two of these currently fail on Windows and I want to see do they also fail elsewhere.
http://code.google.com/p/robotframework/source/detail?r=5edd87ebf96f

Modified:
 /atest/robot/libdoc/cli.txt
 /src/robot/libdocpkg/robotbuilder.py

=======================================
--- /atest/robot/libdoc/cli.txt Tue Feb 14 13:13:03 2012
+++ /atest/robot/libdoc/cli.txt Wed Feb 15 07:43:46 2012
@@ -2,43 +2,56 @@
 Force Tags       regression    pybot    jybot
 Resource         libdoc_resource.txt
 Test Template    Run Libdoc And Verify Created Output File
-Suite Setup      Remove File    ${FILE}
-Suite Teardown   Remove File    ${FILE}
+Suite Setup      Remove File    ${FILE}*
+Suite Teardown   Remove File    ${FILE}*

 *** Variables ***
 ${FILE}          ${TEMPDIR}${/}robot-libdoc-test-file.html

 *** Test Cases ***

-HTML output file
-    --format hTmL -o ${FILE} BuiltIn                HTML    BuiltIn
-
-Default is gotten from output extension
+Default format is got from output file extension
     --output ${FILE} String                         HTML    String
+ --output ${FILE}.xml String XML String path=${FILE}.xml

 Using --format overrides output file extension
-    -f XmL --output ${FILE} BuiltIn                 XML     BuiltIn
+    -f XmL -o ${FILE} ${TESTDATADIR}/resource.txt   XML     Resource
+ --format hTmL -o ${FILE}.xxx BuiltIn HTML BuiltIn path=${FILE}.xxx
+
+Default format is HTML
+    [Template]    NONE
+    Run Libdoc And Verify Output    BuiltIn    <!DOCTYPE*BuiltIn</html>

 Override name and version
     --name MyName --version 42 -o ${FILE} String    HTML    MyName    42
     -n MyName -v 42 -o ${FILE} -f xml BuiltIn       XML     MyName    42

+Relative path with Python libraries
+    [Template]    NONE
+    [Setup]    Directory Should Not Exist    TempDirInExecDir
+    Create Directory    TempDirInExecDir
+    Create File    TempDirInExecDir/MyLibrary.py    def my_keyword(): pass
+    Run Libdoc And Parse Output    TempDirInExecDir/MyLibrary.py
+    Name Should Be    MyLibrary
+    Keyword Name Should Be    0    My Keyword
+    [Teardown]    Remove Directory    TempDirInExecDir    recursively
+
 *** Keywords ***
 Run Libdoc And Verify Created Output File
-    [Arguments]    ${args}   ${format}    ${name}    ${version}=
-    Run Libdoc And Verify Output    ${args}    ${FILE}
- Run Keyword ${format} Doc Should Have Been Created ${name} ${version} + [Arguments] ${args} ${format} ${name} ${version}= ${path}=${FILE}
+    Run Libdoc And Verify Output    ${args}    ${path}
+ Run Keyword ${format} Doc Should Have Been Created ${path} ${name} ${version}

 HTML Doc Should Have Been Created
-    [Arguments]    ${name}    ${version}
-    ${libdoc}=    Get File    ${FILE}
+    [Arguments]    ${path}    ${name}    ${version}
+    ${libdoc}=    Get File    ${path}
     Should Start With    ${libdoc}    <!DOCTYPE
     Should Contain    ${libdoc}    ${name}
     Should Contain    ${libdoc}    ${version}

 XML Doc Should Have Been Created
-    [Arguments]    ${name}    ${version}
-    ${libdoc}=    Parse Xml    ${FILE}
+    [Arguments]    ${path}    ${name}    ${version}
+    ${libdoc}=    Parse Xml    ${path}
     Set Test Variable   ${libdoc}
     Name Should Be    ${name}
     Run Keyword If    "${version}"    Version Should Match    ${version}
=======================================
--- /src/robot/libdocpkg/robotbuilder.py        Tue Feb 14 05:38:50 2012
+++ /src/robot/libdocpkg/robotbuilder.py        Wed Feb 15 07:43:46 2012
@@ -26,7 +26,7 @@
 class LibraryDocBuilder(object):

     def build(self, library, arguments=None):
-        lib = TestLibrary(library, arguments)
+        lib = TestLibrary(self._normalize_library_path(library), arguments)
         libdoc = LibraryDoc(name=lib.name,
                             doc=self._get_doc(lib),
                             version=lib.version,
@@ -36,6 +36,12 @@
         libdoc.keywords = KeywordDocBuilder().build_keywords(lib)
         return libdoc

+    def _normalize_library_path(self, library):
+        path = library.replace('/', os.sep)
+        if os.path.exists(path):
+            return os.path.abspath(path)
+        return library
+
     def _get_doc(self, lib):
         return lib.doc or "Documentation for test library `%s`." % lib.name

Reply via email to