ActionsAPI testi, testi çalıştırmadan önce helloworld paketini build etmek gerekiyor

This commit is contained in:
S.Çağlar Onur
2005-08-22 08:51:11 +00:00
parent 620d754e59
commit ec70795374
4 changed files with 177 additions and 12 deletions
+38 -10
View File
@@ -6,18 +6,46 @@
# any later version.
#
# Please read the COPYING file.
#
import unittest
import zipfile
from pisi.actionsapi import shelltools
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
class ActionsAPITestCase(unittest.TestCase):
def setUp(self):
self.f = zipfile.ZipFile("helloworld-0.1-1.pisi", "r")
self.filelist = []
for file in self.f.namelist():
self.filelist.append(file)
"""
Burasi ActionsAPI'yi gercekten test edecek case'ler ile
dolacak.. Ornegin bir paketin acilip derlenip dosed, dosym
doman, dobin, dosbin gibi fonksiyonlarin dogru calisrligi
test edilecek..
"""
def testFileList(self):
fileContent = ["files.xml", \
"install/bin/helloworld", \
"install/opt/PARDUS", \
"install/opt/helloworld/helloworld", \
"install/opt/uludag", \
"install/sbin/helloworld", \
"install/sys/PARDUS", \
"install/sys/uludag", \
"install/usr/bin/goodbye", \
"install/usr/bin/helloworld", \
"install/usr/lib/helloworld.o", \
"install/usr/sbin/goodbye", \
"install/usr/sbin/helloworld", \
"install/usr/share/doc/helloworld-0.1-1/Makefile.am", \
"install/usr/share/doc/helloworld-0.1-1/goodbyeworld.cpp", \
"install/usr/share/info/Makefile.am", \
"install/usr/share/info/Makefile.cvs", \
"install/usr/share/info/Makefile.in", \
"install/var/goodbye", \
"install/var/hello", \
"metadata.xml"]
'''check number of files in package'''
self.assertEqual(fileContent.__len__(), self.filelist.__len__())
'''check file content'''
for file in self.filelist:
self.assert_(fileContent.__contains__(file))
suite = unittest.makeSuite(ActionsAPITestCase)
+102
View File
@@ -0,0 +1,102 @@
#!/usr/bin/python
# -*- 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.
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
from pisi.actionsapi import libtools
from pisi.actionsapi import get
WorkDir = "helloworld"
def setup():
autotools.configure()
def build():
autotools.make()
def install():
autotools.install()
'''/opt/helloworld/'''
pisitools.dodir("/opt/helloworld")
'''/usr/share/doc/helloworld-0.1-1/Makefile.am'''
pisitools.dodoc("Makefile.am")
'''/opt/helloworld/helloworld'''
pisitools.doexe("src/helloworld", "/opt/helloworld")
'''/usr/share/info/Makefile.am'''
'''/usr/share/info/Makefile.cvs'''
'''/usr/share/info/Makefile.in'''
pisitools.doinfo("Makefile.*")
'''/usr/lib/helloworld.o'''
pisitools.dolib("src/helloworld.o")
'''/opt/hello'''
pisitools.insinto("/opt/", "src/helloworld", "hello")
'''/opt/hi'''
pisitools.insinto("/opt/", "src/helloworld", "hi")
'''/opt/hello -> /var/hello'''
pisitools.domove("/opt/hello", "/var/")
'''/opt/hi -> /var/goodbye'''
pisitools.domove("/opt/hi", "/var/", "goodbye")
'''/usr/bin/helloworld'''
pisitools.dobin("src/helloworld")
'''/bin/helloworld'''
pisitools.dobin("src/helloworld", "/bin")
'''/usr/sbin/helloworld'''
pisitools.dosbin("src/helloworld")
'''/sbin/helloworld'''
pisitools.dosbin("src/helloworld", "/sbin")
'''Hello, world! -> Goodbye, world!'''
pisitools.dosed("src/helloworld.cpp", "Hello, world!", "Goodbye, world!")
'''/usr/sbin/goodbye --> helloworld'''
pisitools.dosym("helloworld", "/usr/sbin/goodbye")
'''/usr/bin/goodbye --> helloworld'''
pisitools.dosym("helloworld", "/usr/bin/goodbye")
'''/home/pardus/'''
pisitools.dodir("/home/pardus")
'''delete pardus'''
pisitools.removeDir("/home/pardus")
'''delete home'''
pisitools.removeDir("/home")
'''src/helloworld.cpp --> /usr/share/doc/helloworld-0.1-1/goodbyeworld.cpp'''
pisitools.newdoc("src/helloworld.cpp", "goodbyeworld.cpp")
'''/opt/pardus'''
shelltools.touch("%s/opt/pardus" % get.installDIR())
'''/opt/pardus --> /opt/uludag'''
shelltools.copy("%s/opt/pardus" % get.installDIR(), "%s/opt/uludag" % get.installDIR())
'''/opt/pardus --> /opt/Pardus'''
shelltools.move("%s/opt/pardus" % get.installDIR(), "%s/opt/PARDUS" % get.installDIR())
'''/opt/ --> /sys/'''
shelltools.copytree("%s/opt/" % get.installDIR(), "%s/sys/" % get.installDIR())
'''delete /sys/helloworld/helloworld'''
shelltools.unlink("%s/sys/helloworld/helloworld" % get.installDIR())
'''delete /sys/helloworld'''
shelltools.unlinkDir("%s/sys/helloworld" % get.installDIR())
'''generate /usr/lib/helloworld.o'''
libtools.gen_usr_ldscript("helloworld.o")
+35
View File
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE PISI SYSTEM "http://www.uludag.org.tr/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>helloworld</Name>
<Homepage>http://www.uludag.org.tr</Homepage>
<Packager>
<Name>S.Çağlar Onur</Name>
<Email>caglar@uludag.org.tr</Email>
</Packager>
<License>GPL-2</License>
<IsA>category</IsA>
<PartOf>component</PartOf>
<Summary xml:lang="en">Dummy HelloWorld for testing ActionsAPI</Summary>
<Description xml:lang="en">Dummy HelloWorld for testing ActionsAPI</Description>
<Archive type="targz" sha1sum="6242681ee0bceb820eb6e8544ad1bb3d0ba3ee78">http://cekirdek.uludag.org.tr/~caglar/helloworld.tar.gz</Archive>
<History>
<Update>
<Date>2005-08-21</Date>
<Version>0.1</Version>
<Release>1</Release>
</Update>
</History>
</Source>
<Package>
<Name>helloworld</Name>
<Files>
<Path fileType="binary">/</Path>
</Files>
</Package>
</PISI>
+2 -2
View File
@@ -29,7 +29,7 @@ def run_all():
import installdbtests
import sourcedbtests
import packagedbtests
#import actionsapitests
import actionsapitests
import graphtests
import versiontests
import configfiletests
@@ -46,7 +46,7 @@ def run_all():
installdbtests.suite,
sourcedbtests.suite,
packagedbtests.suite,
#actionsapitests.suite,
actionsapitests.suite,
graphtests.suite,
versiontests.suite,
configfiletests.suite,