On 31.08.07 23:04:57, Andreas Pakulat wrote:
> On 31.08.07 12:51:46, Allen Winter wrote:
> > On Friday 31 August 2007 11:51:55 am Andreas Pakulat wrote:
> > > On 31.08.07 17:34:02, Thibault wrote:
> > > > No, this patch produce the xml output variant of QTestLib. The log is
> > > > save in a file named <testname>.tml.
> > > 
> > > I strongly object this patch as it is now.
> >
> > Yes, I'll revert.
> > Sorry.  
> 
> Well, I'm sorry too because it means the EBN needs again a bit longer
> until it runs automated tests and post the results on kde4, which I find
> very important and helpful. 
> 
> I modified the patch to use a variable KDE4_TEST_OUTPUT (currently
> recognizes "xml" in any case) to activate the xml output, else it'll use
> plain text. Also added an existence-check for source files, I had a case
> where a source file for a test obviously is generated and thus cmake
> would generate an error trying to read it..

Ping? Found a small error in the patch, so I'm sending an updated one.
Shall I commit or is the idea of having xml-output from the QTests
dropped completely?

Andreas

-- 
Troubled day for virgins over 16 who are beautiful and wealthy and live
in eucalyptus trees.
Index: KDE4Macros.cmake
===================================================================
--- KDE4Macros.cmake	(Revision 706772)
+++ KDE4Macros.cmake	(Arbeitskopie)
@@ -695,8 +695,32 @@
         list(REMOVE_AT _srcList 0 1)
     endif( ${ARGV1} STREQUAL "TESTNAME" )
     kde4_add_test_executable( ${_test_NAME} ${_srcList} )
-    add_test( ${_targetName} ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME} )
 
+    if(NOT KDE4_TEST_OUTPUT)
+        set(KDE4_TEST_OUTPUT plaintext)
+    endif(NOT KDE4_TEST_OUTPUT)
+    set(KDE4_TEST_OUTPUT ${KDE4_TEST_OUTPUT} CACHE STRING "The output to generate when running the QTest unit tests")
+
+    set(using_qtest "")
+    foreach(_filename ${_srcList})
+        if(NOT using_qtest)
+            if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}")
+                file(READ ${_filename} file_CONTENT)
+                string(REGEX MATCH "QTEST_(KDE)?MAIN" using_qtest "${file_CONTENT}")
+            endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}")
+        endif(NOT using_qtest)
+    endforeach(_filename)
+
+    if (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml")
+        #MESSAGE(STATUS "${_targetName} : Using QTestLib, can produce XML report.")
+        add_test( ${_targetName} ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME} -xml -o ${_targetName}.tml)
+    else (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml")
+        #MESSAGE(STATUS "${_targetName} : NOT using QTestLib, can't produce XML report, please use QTestLib to write your unit tests.")
+        add_test( ${_targetName} ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME} )
+    endif (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml")
+
+#    add_test( ${_targetName} ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME} -xml -o ${_test_NAME}.tml ) 
+
     if (NOT MSVC_IDE)   #not needed for the ide
         # if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests
         if (NOT KDE4_BUILD_TESTS)
_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem

Reply via email to