diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-04-23 11:20:25 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-04-23 11:20:25 +0000 |
commit | b87bd4aba33be03a5b973f5940b1b5f36617f7d1 (patch) | |
tree | 05dadd5ca4c4cd8024694e0cd802f67b579d3f43 | |
parent | c620b71480d9d05b99b5c22a010dadb2948ea2bf (diff) | |
download | morph-b87bd4aba33be03a5b973f5940b1b5f36617f7d1.tar.gz |
tests: add test for python distutils
-rwxr-xr-x | tests/build-system-python-distutils.script | 61 | ||||
-rw-r--r-- | tests/build-system-python-distutils.stdout | 11 |
2 files changed, 72 insertions, 0 deletions
diff --git a/tests/build-system-python-distutils.script b/tests/build-system-python-distutils.script new file mode 100755 index 00000000..2c7c7df6 --- /dev/null +++ b/tests/build-system-python-distutils.script @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Convert the hello-chunk project to python with distutils +# +# Copyright (C) 2011, 2012 Codethink Limited +# +# 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; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +set -eu + +chunkrepo="$DATADIR/chunk-repo" +cd "$chunkrepo" + +git checkout --quiet farrokh + +git rm --quiet hello.c +cat <<EOF >hello +#!/usr/bin/python +print "hello, world" +EOF +git add hello + +cat <<EOF >setup.py +#!/usr/bin/python +from distutils.core import setup +setup(name='hello', + scripts=['hello']) +EOF +git add setup.py + +cat <<EOF >hello.morph +{ + "name": "hello", + "kind": "chunk", + "build-system": "python-distutils" +} +EOF +git add hello.morph + +git commit --quiet -m 'convert hello into a python project' + +"$SRCDIR/scripts/test-morph" build --prefix= chunk-repo farrokh hello.morph + +for chunk in "$DATADIR/cache/"*.chunk.* +do + echo "$chunk:" | sed 's/[^.]*//' + tar -tf "$chunk" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' + echo +done diff --git a/tests/build-system-python-distutils.stdout b/tests/build-system-python-distutils.stdout new file mode 100644 index 00000000..b78b608f --- /dev/null +++ b/tests/build-system-python-distutils.stdout @@ -0,0 +1,11 @@ +.chunk.hello: +./ +baserock/ +baserock/hello.meta +bin/ +bin/hello +lib/ +lib/python2.7/ +lib/python2.7/site-packages/ +lib/python2.7/site-packages/hello-0.0.0-py2.7.egg-info + |