Move from CUnit to BCUnit

parent 2b682aa2
# cunit-to-junit
# bcunit-to-junit
Convert CUnit xml test report to JUnit schema and make it easy to integrate with Jenkins CI xUnit plugin
Convert BCUnit xml test report to JUnit schema and make it easy to integrate with Jenkins CI xUnit plugin
--
## Purpose
[CUnit](http://cunit.sourceforge.net/) is a uniting framework written in pure C. Like other xUnit framework, CUnit can generate xml test reports. This XSL is able to convert CUnit xml report to popular JUnit schema and makes it easy to integrate CUnit with [Jenkin CI](http://jenkins-ci.org/).
[BCUnit](https://github.com/BelledonneCommunications/bcunit/) is a uniting framework written in pure C. Like other xUnit framework, BCUnit can generate xml test reports. This XSL is able to convert BCUnit xml report to popular JUnit schema and makes it easy to integrate BCUnit with [Jenkin CI](http://jenkins-ci.org/).
## Use with Jenkins CI
......@@ -14,8 +14,8 @@ Convert CUnit xml test report to JUnit schema and make it easy to integrate with
1. Install [xUnit plugin](https://wiki.jenkins-ci.org/display/JENKINS/xUnit+Plugin) to your Jenkins CI
2. Configure project's post build action to "Publish xUnit test result report"
3. Choose "custom tool" as report type
4. Specify CUnit report file pattern
5. Specify the path to <code>cunit-to-junit.xsl</code>
4. Specify BCUnit report file pattern
5. Specify the path to <code>bcunit-to-junit.xsl</code>
And there you GO!
......@@ -3,10 +3,10 @@
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<testsuites>
<xsl:for-each select="//CUNIT_RUN_SUITE_SUCCESS">
<xsl:for-each select="//BCUNIT_RUN_SUITE_SUCCESS">
<xsl:variable name="suiteName" select="normalize-space(SUITE_NAME/text())"/>
<xsl:variable name="numberOfTests" select="count(CUNIT_RUN_TEST_RECORD/CUNIT_RUN_TEST_SUCCESS)"/>
<xsl:variable name="numberOfFailures" select="count(CUNIT_RUN_TEST_RECORD/CUNIT_RUN_TEST_FAILURE)"/>
<xsl:variable name="numberOfTests" select="count(BCUNIT_RUN_TEST_RECORD/BCUNIT_RUN_TEST_SUCCESS)"/>
<xsl:variable name="numberOfFailures" select="count(BCUNIT_RUN_TEST_RECORD/BCUNIT_RUN_TEST_FAILURE)"/>
<testsuite
name="{$suiteName}"
tests="{$numberOfTests}"
......@@ -15,13 +15,13 @@
errors="0"
skipped="0">
<xsl:for-each select="CUNIT_RUN_TEST_RECORD/CUNIT_RUN_TEST_SUCCESS">
<xsl:for-each select="BCUNIT_RUN_TEST_RECORD/BCUNIT_RUN_TEST_SUCCESS">
<xsl:variable name="testname" select="normalize-space(TEST_NAME/text())"></xsl:variable>
<testcase classname="{$suiteName}" name="{$testname}" time="0.0">
</testcase>
</xsl:for-each>
<xsl:for-each select="CUNIT_RUN_TEST_RECORD/CUNIT_RUN_TEST_FAILURE">
<xsl:for-each select="BCUNIT_RUN_TEST_RECORD/BCUNIT_RUN_TEST_FAILURE">
<xsl:variable name="testname" select="normalize-space(TEST_NAME/text())"></xsl:variable>
<testcase classname="{$suiteName}" name="{$testname}" time="0.0">
<failure>
......
......@@ -79,7 +79,7 @@ else()
linphone_builder_add_builder_to_target(TARGET_bctoolbox polarssl)
endif()
if (ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_bctoolbox cunit)
linphone_builder_add_builder_to_target(TARGET_bctoolbox bcunit)
endif()
linphone_builder_add_builder_to_target(TARGET_bctoolbox bctoolbox)
endif()
......
......@@ -37,7 +37,7 @@ if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
endif()
list(APPEND EP_bctoolbox_CMAKE_OPTIONS "-DENABLE_TESTS=${ENABLE_UNIT_TESTS}")
if(ENABLE_UNIT_TESTS AND LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_bctoolbox_DEPENDENCIES EP_cunit)
list(APPEND EP_bctoolbox_DEPENDENCIES EP_bcunit)
endif()
if(MSVC)
......
############################################################################
# cunit.cmake
# bcunit.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
......@@ -20,16 +20,16 @@
#
############################################################################
set(EP_cunit_GIT_REPOSITORY "git://git.linphone.org/cunit.git" CACHE STRING "cunit repository URL")
set(EP_cunit_GIT_TAG_LATEST "linphone" CACHE STRING "cunit tag to use when compiling latest version")
set(EP_cunit_GIT_TAG "0a0a9c60f5a1b899ae26b705fa5224ef25377982" CACHE STRING "cunit tag to use")
set(EP_cunit_EXTERNAL_SOURCE_PATHS "cunit" "externals/cunit")
set(EP_cunit_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_cunit_IGNORE_WARNINGS TRUE)
set(EP_bcunit_GIT_REPOSITORY "git://git.linphone.org/bcunit.git" CACHE STRING "bcunit repository URL")
set(EP_bcunit_GIT_TAG_LATEST "linphone" CACHE STRING "bcunit tag to use when compiling latest version")
set(EP_bcunit_GIT_TAG "0a0a9c60f5a1b899ae26b705fa5224ef25377982" CACHE STRING "bcunit tag to use")
set(EP_bcunit_EXTERNAL_SOURCE_PATHS "bcunit" "externals/bcunit")
set(EP_bcunit_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_bcunit_IGNORE_WARNINGS TRUE)
set(EP_cunit_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_bcunit_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
set(EP_cunit_EXTRA_LDFLAGS "/SAFESEH:NO")
set(EP_bcunit_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
set(EP_cunit_CMAKE_OPTIONS "-DENABLE_AUTOMATED=YES" "-DENABLE_CONSOLE=NO")
set(EP_bcunit_CMAKE_OPTIONS "-DENABLE_AUTOMATED=YES" "-DENABLE_CONSOLE=NO")
......@@ -41,6 +41,6 @@ endif()
set(EP_bzrtp_CMAKE_OPTIONS "-DENABLE_TESTS=${ENABLE_UNIT_TESTS}")
if(ENABLE_UNIT_TESTS AND LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_bzrtp_DEPENDENCIES EP_cunit)
list(APPEND EP_bzrtp_DEPENDENCIES EP_bcunit)
endif()
......@@ -106,7 +106,7 @@ if(WIN32)
add_list_file(zlib)
endif()
if(ENABLE_UNIT_TESTS)
add_list_file(cunit)
add_list_file(bcunit)
endif()
if(ENABLE_VCARD)
add_list_file(vcard)
......@@ -185,7 +185,7 @@ if(WIN32)
PATTERN "man" EXCLUDE
PATTERN "manifest" EXCLUDE
PATTERN "share/aclocal" EXCLUDE
PATTERN "share/CUnit" EXCLUDE
PATTERN "share/BCUnit" EXCLUDE
PATTERN "share/glib-2.0" EXCLUDE
PATTERN "share/gtk-2.0" EXCLUDE
PATTERN "share/gtk-doc" EXCLUDE
......
@LIBDIR@/@LIBPREFIX@bcunit*.@LIBEXT@
\ No newline at end of file
@LIBDIR@/@LIBPREFIX@cunit*.@LIBEXT@
\ No newline at end of file
......@@ -22,7 +22,7 @@
# Common build options
option(ENABLE_UNIT_TESTS "Enable unit tests support with CUnit library." "${DEFAULT_VALUE_ENABLE_UNIT_TESTS}")
option(ENABLE_UNIT_TESTS "Enable unit tests support with BCUnit library." "${DEFAULT_VALUE_ENABLE_UNIT_TESTS}")
add_feature_info("Unit tests" ENABLE_UNIT_TESTS "Build unit tests programs for belle-sip, mediastreamer2 and linphone.")
option(ENABLE_DEBUG_LOGS "Enable debug level logs in libinphone and mediastreamer2." NO)
......
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