buildframework/helium/tools/preparation/test/test_bom.ant.xml
author wbernard
Wed, 23 Dec 2009 19:29:07 +0200
changeset 179 d8ac696cc51f
child 217 0f5e3a7fb6af
permissions -rw-r--r--
helium_7.0-r14027

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
============================================================================ 
Name        : test_ci.ant.xml 
Part of     : Helium 

Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved.
This component and the accompanying materials are made available
under the terms of the License "Eclipse Public License v1.0"
which accompanies this distribution, and is available
at the URL "http://www.eclipse.org/legal/epl-v10.html".

Initial Contributors:
Nokia Corporation - initial contribution.

Contributors:

Description:

============================================================================
-->
<project name="test_bom" xmlns:au="org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
    <description>
        Targets to test Bom creation 
    </description>
    <property environment="env" />
    <property name="helium.dir" location="../../.." />
    <property name="build.drive" location="${env.TEMP}/helium/${env.USERNAME}/testbom"/>
    <property name="publish.dir" value="${build.drive}/output" />
    <property name="build.number" value="1" />
    <import file="../../../helium.ant.xml" />
    
    <target name="test-create-bom">
        <delete dir="${build.drive}"/>
        <mkdir dir="${build.log.dir}"/>    
        
        <unzip src="${helium.dir}/external/helium-antlib/scm/demo/hg_test2.zip" dest="${build.drive}" />
        <unzip src="${helium.dir}/external/helium-antlib/scm/demo/hg_test3.zip" dest="${build.drive}" />
        <hlm:scm scmurl="scm:hg:${build.drive}/test2">
            <hlm:checkout baseDir="${build.drive}/test2a"/>
            <hlm:changelog baseDir="${build.drive}/test2a" xmlbom="${build.log.dir}/${build.id}_bom.xml" />
        </hlm:scm>

        <antcall target="create-bom" />
        
        <antcall target="p2-create-bom">
            <param name="build.id" value="${build.name}_${core.build.version}.2" />
            <param name="build.number" value="2" />
        </antcall>
    </target>
    
    <target name="p2-create-bom">
        <hlm:scm scmurl="scm:hg:${build.drive}/test2">
            <hlm:changelog baseDir="${build.drive}/test2a" xmlbom="${build.log.dir}/${build.id}_bom.xml" />
        </hlm:scm>
        <hlm:scm scmurl="scm:hg:${build.drive}/test3">
            <hlm:checkout baseDir="${build.drive}/test3a"/>
            <hlm:changelog baseDir="${build.drive}/test3a" xmlbom="${build.log.dir}/${build.id}_bom.xml" />
        </hlm:scm>
        <antcall target="create-bom" />
        <au:assertFileExists file="${build.log.dir}/${build.id}_bom.html"/>
        <au:assertFileExists file="${build.log.dir}/${build.id}_bom_delta.html"/>
        <xpathtest xmlfile="${build.log.dir}/${build.id}_bom_delta.xml">
            <namespace uri="" prefix=""/>
            <xpath expression="/bomDelta/content/task[@status='added']"/>
        </xpathtest>
    </target>
</project>