diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2012-04-19 20:59:38 +0200 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2012-04-20 12:22:38 +0200 |
commit | acfbb39f7250b7bb00ad17340e09a3e6b94d1c8a (patch) | |
tree | c1af8fa0cc5aa73889ff14db98f35c9a6ac1bb41 /test/test_packages_common.py | |
parent | 9525d11fabe9cbfc2752acb23ee9bda2460c599c (diff) |
Move tests to the 'test' folder
Diffstat (limited to 'test/test_packages_common.py')
-rw-r--r-- | test/test_packages_common.py | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/test/test_packages_common.py b/test/test_packages_common.py new file mode 100644 index 00000000..4b338c98 --- /dev/null +++ b/test/test_packages_common.py @@ -0,0 +1,113 @@ +# cerbero - a multi-platform build system for Open Source software +# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +from cerbero.config import Platform, Distro, DistroVersion +from cerbero.packages import package +from cerbero.packages.packagesstore import PackagesStore +from test.test_build_common import create_cookbook + + +class Package1(package.Package): + + name = 'gstreamer-test1' + shortdesc = 'GStreamer Test' + version = '1.0' + licences = ['LGPL'] + uuid = '1' + vendor = 'GStreamer Project' + deps = ['gstreamer-test2'] + + files = ['recipe1:misc:libs:bins'] + platform_files = { + Platform.WINDOWS: ['recipe5:libs'] + } + + +class Package2(package.Package): + + name = 'gstreamer-test2' + shortdesc = 'GStreamer Test 2' + version = '1.0' + licences = ['LGPL'] + uuid = '1' + vendor = 'GStreamer Project' + + files = ['recipe2:misc'] + + +class Package3(package.Package): + + name = 'gstreamer-test3' + shortdesc = 'GStreamer Test 3' + version = '1.0' + licences = ['LGPL'] + uuid = '1' + vendor = 'GStreamer Project' + + files = ['recipe3:misc'] + + +class Package4(package.Package): + + name = 'gstreamer-test-bindings' + shortdesc = 'GStreamer Bindings' + version = '1.0' + licences = ['LGPL'] + uuid = '1' + vendor = 'GStreamer Project' + sys_deps = {Distro.DEBIAN: ['python'], + DistroVersion.FEDORA_16: ['python27']} + + files = ['recipe4:misc'] + + +class MetaPackage(package.MetaPackage): + + name = "gstreamer-runtime" + shortdesc = "GStreamer runtime" + longdesc = "GStreamer runtime" + title = "GStreamer runtime" + url = "http://www.gstreamer.net" + version = '1.0' + uuid = '3ffe67b2-4565-411f-8287-e8faa892f853' + vendor = "GStreamer Project" + org = 'net.gstreamer' + packages = [ + ('gstreamer-test1', True, True), + ('gstreamer-test3', False, True), + ('gstreamer-test-bindings', False, False)] + platform_packages = { + Platform.LINUX: [('gstreamer-test2', False, False)]} + icon = "gstreamer.ico" + + +class DummyConfig(object): + pass + + +def create_store(config): + cookbook = create_cookbook(config) + store = PackagesStore(config, False) + + for klass in [Package1, Package2, Package3, Package4]: + package = klass(config, cookbook) + store.add_package(package) + for klass in [MetaPackage]: + package = klass(config, store) + store.add_package(package) + return store |