basic build tests..
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2005, TUBITAK/UEKAE
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# Please read the COPYING file.
|
||||||
|
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
import testcase
|
||||||
|
from pisi.build import *
|
||||||
|
|
||||||
|
class BuildTestCase(testcase.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
testcase.TestCase.setUp(self)
|
||||||
|
|
||||||
|
def testBasicBuild(self):
|
||||||
|
shutil.copy('tests/buildtests/a/actions.py-1', 'tests/buildtests/a/actions.py')
|
||||||
|
pspec = 'tests/buildtests/a/pspec.xml'
|
||||||
|
pb = Builder(pspec, None)
|
||||||
|
pb.build()
|
||||||
|
self.assertEqual(os.path.exists('a-1.0-1-1.pisi'), True)
|
||||||
|
shutil.move('a-1.0-1-1.pisi', 'tests/buildtests/a/a-1.0-1-1.pisi')
|
||||||
|
|
||||||
|
def testBuildNumber(self):
|
||||||
|
pspec = 'tests/buildtests/a/pspec.xml'
|
||||||
|
pb = Builder(pspec, None)
|
||||||
|
|
||||||
|
shutil.copy('tests/buildtests/a/actions.py-2', 'tests/buildtests/a/actions.py')
|
||||||
|
pb.build()
|
||||||
|
self.assertEqual(os.path.exists('a-1.0-1-2.pisi'), True)
|
||||||
|
|
||||||
|
shutil.copy('tests/buildtests/a/actions.py-3', 'tests/buildtests/a/actions.py')
|
||||||
|
pb.build()
|
||||||
|
self.assertEqual(os.path.exists('a-1.0-1-3.pisi'), False)
|
||||||
|
|
||||||
|
os.remove('tests/buildtests/a/actions.py')
|
||||||
|
os.remove('a-1.0-1-2.pisi')
|
||||||
|
os.remove('tests/buildtests/a/a-1.0-1-1.pisi')
|
||||||
|
|
||||||
|
suite = unittest.makeSuite(BuildTestCase)
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright 2005 TUBITAK/UEKAE
|
||||||
|
# Licensed under the GNU General Public License, version 2.
|
||||||
|
# See the file http://www.gnu.org/copyleft/gpl.txt.
|
||||||
|
#
|
||||||
|
# A. Murat Eren <meren at uludag.org.tr>
|
||||||
|
|
||||||
|
from pisi.actionsapi import pisitools
|
||||||
|
|
||||||
|
WorkDir = "merhaba-pisi-1.0"
|
||||||
|
|
||||||
|
def install():
|
||||||
|
pisitools.dobin("merhaba-pisi.py")
|
||||||
|
|
||||||
|
pisitools.rename("/usr/bin/merhaba-pisi.py", "merhaba-pisi")
|
||||||
|
|
||||||
|
pisitools.dosym("./merhaba-pisi", "/usr/bin/justasysmlink")
|
||||||
|
pisitools.dosym("/thre/is/no/such/place", "/usr/bin/justabrokensymlink")
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright 2005 TUBITAK/UEKAE
|
||||||
|
# Licensed under the GNU General Public License, version 2.
|
||||||
|
# See the file http://www.gnu.org/copyleft/gpl.txt.
|
||||||
|
#
|
||||||
|
# A. Murat Eren <meren at uludag.org.tr>
|
||||||
|
|
||||||
|
from pisi.actionsapi import pisitools
|
||||||
|
|
||||||
|
WorkDir = "merhaba-pisi-1.0"
|
||||||
|
|
||||||
|
def install():
|
||||||
|
pisitools.dobin("merhaba-pisi.py")
|
||||||
|
|
||||||
|
pisitools.rename("/usr/bin/merhaba-pisi.py", "merhaba-pisi")
|
||||||
|
|
||||||
|
pisitools.dosym("./merhaba-pisi", "/usr/bin/justasysmlink")
|
||||||
|
pisitools.dosym("/thre/is/no/such", "/usr/bin/justabrokensymlink")
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright 2005 TUBITAK/UEKAE
|
||||||
|
# Licensed under the GNU General Public License, version 2.
|
||||||
|
# See the file http://www.gnu.org/copyleft/gpl.txt.
|
||||||
|
#
|
||||||
|
# A. Murat Eren <meren at uludag.org.tr>
|
||||||
|
|
||||||
|
from pisi.actionsapi import pisitools
|
||||||
|
|
||||||
|
WorkDir = "merhaba-pisi-1.0"
|
||||||
|
|
||||||
|
def install():
|
||||||
|
pisitools.dobin("merhaba-pisi.py")
|
||||||
|
|
||||||
|
pisitools.rename("/usr/bin/merhaba-pisi.py", "merhaba-pisi")
|
||||||
|
|
||||||
|
pisitools.dosym("./merhaba-pisi", "/usr/bin/justasysmlink")
|
||||||
|
pisitools.dosym("/thre/is/no/such", "/usr/bin/justabrokensymlink")
|
||||||
|
|
||||||
|
pisitools.dodir("/usr/lib")
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<!DOCTYPE PISI SYSTEM "http://www.uludag.org.tr/projeler/pisi/pisi-spec.dtd">
|
||||||
|
|
||||||
|
<PISI>
|
||||||
|
<Source>
|
||||||
|
<Name>a</Name>
|
||||||
|
<Homepage>http://cekirdek.uludag.org.tr/~meren/merhaba-pisi.php</Homepage>
|
||||||
|
<Packager>
|
||||||
|
<Name>A. Murat Eren</Name>
|
||||||
|
<Email>meren@uludag.org.tr</Email>
|
||||||
|
</Packager>
|
||||||
|
<License>As-Is</License>
|
||||||
|
<PartOf>None</PartOf>
|
||||||
|
<IsA>app:console</IsA>
|
||||||
|
<Summary>PiSi Hello World Application..</Summary>
|
||||||
|
<Summary xml:lang="tr">PiSi için merhaba dünya uygulaması, süper bir konsol uygulaması</Summary>
|
||||||
|
<Description>Just a basic application. Nothing to describe.</Description>
|
||||||
|
<Description xml:lang="tr">Sadece basit bir uygulama, açıklayacak bir şey yok</Description>
|
||||||
|
<Archive sha1sum="fc917dec7b9729de935698f273f8007b2223653d" type="targz">http://cekirdek.uludag.org.tr/~meren/merhaba-pisi-1.0.tar.gz</Archive>
|
||||||
|
</Source>
|
||||||
|
|
||||||
|
<Package>
|
||||||
|
<Name>a</Name>
|
||||||
|
<Files>
|
||||||
|
<Path fileType="executable">/usr/bin/</Path>
|
||||||
|
</Files>
|
||||||
|
</Package>
|
||||||
|
|
||||||
|
|
||||||
|
<History>
|
||||||
|
<Update release="1">
|
||||||
|
<Date>2006-02-01</Date>
|
||||||
|
<Version>1.0</Version>
|
||||||
|
<Comment>First release.</Comment>
|
||||||
|
<Name>A. Murat Eren</Name>
|
||||||
|
<Email>meren@uludag.org.tr</Email>
|
||||||
|
</Update>
|
||||||
|
</History>
|
||||||
|
</PISI>
|
||||||
Reference in New Issue
Block a user