From 718cc39205f44743427bce53c647ed6e7bef1de9 Mon Sep 17 00:00:00 2001 From: "A. Murat Eren" Date: Mon, 20 Mar 2006 10:17:37 +0000 Subject: [PATCH] basic build tests.. --- tests/buildtests.py | 46 +++++++++++++++++++++++++++++++++ tests/buildtests/a/actions.py-1 | 20 ++++++++++++++ tests/buildtests/a/actions.py-2 | 20 ++++++++++++++ tests/buildtests/a/actions.py-3 | 22 ++++++++++++++++ tests/buildtests/a/pspec.xml | 39 ++++++++++++++++++++++++++++ 5 files changed, 147 insertions(+) create mode 100644 tests/buildtests.py create mode 100644 tests/buildtests/a/actions.py-1 create mode 100644 tests/buildtests/a/actions.py-2 create mode 100644 tests/buildtests/a/actions.py-3 create mode 100644 tests/buildtests/a/pspec.xml diff --git a/tests/buildtests.py b/tests/buildtests.py new file mode 100644 index 00000000..6657539b --- /dev/null +++ b/tests/buildtests.py @@ -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) diff --git a/tests/buildtests/a/actions.py-1 b/tests/buildtests/a/actions.py-1 new file mode 100644 index 00000000..5a87e4b4 --- /dev/null +++ b/tests/buildtests/a/actions.py-1 @@ -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 + +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") diff --git a/tests/buildtests/a/actions.py-2 b/tests/buildtests/a/actions.py-2 new file mode 100644 index 00000000..c8575662 --- /dev/null +++ b/tests/buildtests/a/actions.py-2 @@ -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 + +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") diff --git a/tests/buildtests/a/actions.py-3 b/tests/buildtests/a/actions.py-3 new file mode 100644 index 00000000..3635190f --- /dev/null +++ b/tests/buildtests/a/actions.py-3 @@ -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 + +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") diff --git a/tests/buildtests/a/pspec.xml b/tests/buildtests/a/pspec.xml new file mode 100644 index 00000000..cb49b179 --- /dev/null +++ b/tests/buildtests/a/pspec.xml @@ -0,0 +1,39 @@ + + + + + + a + http://cekirdek.uludag.org.tr/~meren/merhaba-pisi.php + + A. Murat Eren + meren@uludag.org.tr + + As-Is + None + app:console + PiSi Hello World Application.. + PiSi için merhaba dünya uygulaması, süper bir konsol uygulaması + Just a basic application. Nothing to describe. + Sadece basit bir uygulama, açıklayacak bir şey yok + http://cekirdek.uludag.org.tr/~meren/merhaba-pisi-1.0.tar.gz + + + + a + + /usr/bin/ + + + + + + + 2006-02-01 + 1.0 + First release. + A. Murat Eren + meren@uludag.org.tr + + +