buildframework/helium/tools/preparation/test/test_bom.ant.xml
author lorewang
Wed, 01 Dec 2010 16:05:36 +0800
changeset 715 e0739b8406dd
parent 588 c7c26511138f
permissions -rw-r--r--
Specify extenal tool with path

<?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="../../../build.xml" />
    
    <target name="test-create-bom">
        <delete dir="${build.drive}"/>
        <mkdir dir="${build.log.dir}"/>    
        
        <unzip src="${helium.dir}/tests/data/bom/hg_test2.zip" dest="${build.drive}" />
        <unzip src="${helium.dir}/tests/data/bom/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>