# SConstruct for src/test

# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org)             #
#                                                                            #
# Licensed under the Apache License, Version 2.0 (the "License"); you may    #
# not use this file except in compliance with the License. You may obtain    #
# a copy of the License at                                                   #
#                                                                            #
# http://www.apache.org/licenses/LICENSE-2.0                                 #
#                                                                            #
# Unless required by applicable law or agreed to in writing, software        #
# distributed under the License is distributed on an "AS IS" BASIS,          #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
# See the License for the specific language governing permissions and        #
# limitations under the License.                                             #
#--------------------------------------------------------------------------- #

Import('env')

# Build a modified Nebula lib
lib_name='nebula_core_test'

if env['parsers']=='yes':
    # LEX
    parser=env.Lex(
        source='../template/template_parser.l'
    )
    env.NoClean(parser)

    # BISON
    parser=env.Bison(
        source='../template/template_syntax.y'
    )
    env.NoClean(parser)

# Sources to generate the library
source_files=[
    'Nebula.cc',
    'NebulaTest.cc',


	'../acl/AclManager.cc',
	'../acl/AclRule.cc',
	'../authm/AuthManager.cc',
	'../authm/AuthManagerDriver.cc',
	'../cluster/Cluster.cc',
	'../cluster/ClusterPool.cc',
	'../common/mem_collector.c',
	'../common/ActionManager.cc',
	'../common/Attribute.cc',
	'../common/SSLTools.cc',
	'../datastore/Datastore.cc',
	'../datastore/DatastorePool.cc',
	'../dm/DispatchManager.cc',
	'../dm/DispatchManagerActions.cc',
	'../dm/DispatchManagerStates.cc',
	'../document/Document.cc',
	'../group/Group.cc',
	'../group/GroupPool.cc',
	'../hm/HookManager.cc',
	'../hm/HookManagerDriver.cc',
	'../host/Host.cc',
	'../host/HostHook.cc',
	'../host/HostPool.cc',
	'../host/HostShare.cc',
	'../im/InformationManager.cc',
	'../im/InformationManagerDriver.cc',
	'../image/Image.cc',
	'../image/ImageManager.cc',
	'../image/ImageManagerActions.cc',
	'../image/ImageManagerDriver.cc',
	'../image/ImagePool.cc',
	'../image/ImageTemplate.cc',
	'../lcm/LifeCycleActions.cc',
	'../lcm/LifeCycleManager.cc',
	'../lcm/LifeCycleStates.cc',
	'../log/Log.cc',
	'../log/NebulaLog.cc',
	'../mad/Mad.cc',
	'../mad/MadManager.cc',
#	'../nebula/Nebula.cc',
	'../nebula/NebulaTemplate.cc',
	'../nebula/oned.cc',
	'../pool/ObjectCollection.cc',
	'../pool/PoolObjectAuth.cc',
	'../pool/PoolObjectSQL.cc',
	'../pool/PoolSQL.cc',
	'../rm/Request.cc',
	'../rm/RequestManager.cc',
	'../rm/RequestManagerAcl.cc',
	'../rm/RequestManagerAllocate.cc',
	'../rm/RequestManagerChmod.cc',
	'../rm/RequestManagerChown.cc',
	'../rm/RequestManagerClone.cc',
	'../rm/RequestManagerCluster.cc',
	'../rm/RequestManagerDelete.cc',
	'../rm/RequestManagerGroup.cc',
	'../rm/RequestManagerHost.cc',
	'../rm/RequestManagerImage.cc',
	'../rm/RequestManagerInfo.cc',
	'../rm/RequestManagerPoolInfoFilter.cc',
	'../rm/RequestManagerUpdateTemplate.cc',
	'../rm/RequestManagerUser.cc',
	'../rm/RequestManagerVirtualMachine.cc',
	'../rm/RequestManagerVirtualNetwork.cc',
	'../rm/RequestManagerVMTemplate.cc',
#	'../scheduler/src/client/Client.cc',
#	'../scheduler/src/pool/AclXML.cc',
#	'../scheduler/src/pool/HostPoolXML.cc',
#	'../scheduler/src/pool/HostXML.cc',
#	'../scheduler/src/pool/VirtualMachinePoolXML.cc',
#	'../scheduler/src/pool/VirtualMachineXML.cc',
#	'../scheduler/src/sched/mm_sched.cc',
#	'../scheduler/src/sched/Scheduler.cc',
#	'../scheduler/src/sched/SchedulerTemplate.cc',
	'../sql/MySqlDB.cc',
	'../sql/SqliteDB.cc',
	'../template/Template.cc',
	'../template/template_parser.c',
	'../template/template_syntax.cc',
	'../tm/TransferManager.cc',
	'../tm/TransferManagerDriver.cc',
	'../um/Quota.cc',
	'../um/QuotaDatastore.cc',
	'../um/QuotaImage.cc',
	'../um/QuotaNetwork.cc',
	'../um/Quotas.cc',
	'../um/QuotaVirtualMachine.cc',
	'../um/User.cc',
	'../um/UserPool.cc',
	'../vm/vm_var_parser.c',
	'../vm/History.cc',
	'../vm/VirtualMachine.cc',
	'../vm/VirtualMachineHook.cc',
	'../vm/VirtualMachinePool.cc',
	'../vm/VirtualMachineTemplate.cc',
	'../vm/vm_var_syntax.cc',
	'../vm_template/VMTemplate.cc',
	'../vm_template/VMTemplatePool.cc',
	'../vmm/LibVirtDriverKVM.cc',
	'../vmm/LibVirtDriverVMware.cc',
	'../vmm/VirtualMachineManager.cc',
	'../vmm/VirtualMachineManagerDriver.cc',
	'../vmm/XenDriver.cc',
	'../vmm/XMLDriver.cc',
	'../vnm/FixedLeases.cc',
	'../vnm/Leases.cc',
	'../vnm/RangedLeases.cc',
	'../vnm/VirtualNetwork.cc',
	'../vnm/VirtualNetworkPool.cc',
	'../xml/expr_parser.c',
	'../xml/expr_arith.cc',
	'../xml/expr_bool.cc',
	'../xml/ObjectXML.cc'
]

# Build library
env.StaticLibrary(lib_name, source_files)

# Build a modified Nebula lib
lib_name='nebula_test_common'

# Sources to generate the library
source_files=[
    'OneUnitTest.cc',
]

# Build library
env.StaticLibrary(lib_name, source_files)
