diff options
| author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-06-23 04:17:49 +0200 |
|---|---|---|
| committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-07-15 12:28:52 +0200 |
| commit | a60b8def141f7644d991b8823addd26242954a04 (patch) | |
| tree | 62967faf9339c654f1fb46cbcfe80c882915565e | |
| parent | 2fb1284f1c5ca2f7f497196dfd9e24456f824298 (diff) | |
| download | nbb-a60b8def141f7644d991b8823addd26242954a04.tar.gz nbb-a60b8def141f7644d991b8823addd26242954a04.tar.xz nbb-a60b8def141f7644d991b8823addd26242954a04.zip | |
Test automake build commands
| -rw-r--r-- | src/nbblib/bs.py | 7 | ||||
| -rw-r--r-- | src/nbblib/main.py | 3 | ||||
| -rw-r--r-- | test/Makefile.am | 1 | ||||
| -rw-r--r-- | test/local.at | 32 | ||||
| -rw-r--r-- | test/nbb-automake.at | 42 |
5 files changed, 82 insertions, 3 deletions
diff --git a/src/nbblib/bs.py b/src/nbblib/bs.py index c7a33be..e78cd19 100644 --- a/src/nbblib/bs.py +++ b/src/nbblib/bs.py @@ -97,13 +97,14 @@ class AutomakeSourceTree(BSSourceTree): def configure(self): """'configure --prefix'""" + if not os.path.exists(os.path.join(self.config.srcdir, 'configure')): + self.init() builddir = self.config.builddir if not os.path.exists(builddir): os.makedirs(builddir) - if not os.path.exists(os.path.join(builddir, 'configure')): - self.init os.chdir(builddir) prog_run(["%s/configure" % self.config.srcdir, - "--prefix=%s" % self.config.installdir + "--prefix=%s" % self.config.installdir, + "--enable-maintainer-mode", ], self.context) def build(self): diff --git a/src/nbblib/main.py b/src/nbblib/main.py index 19582ed..b4664f2 100644 --- a/src/nbblib/main.py +++ b/src/nbblib/main.py @@ -28,7 +28,10 @@ TODO: (Large list) gained with git-amb, especially the command interdependencies. * implement *-sh and *-run commands * General removal of redundancy in Python code. + * Make sure the if cmp ... mv .. rm in make rules are correct and useful. * More declarative syntax elements in the Python code. + * Write test cases for init, configure, build, install. + * Write test cases for all nbb commands. * Use declarations for command line parsing, and help text generation. * Add global --nick or similar option to determine the branch name to use for composing the pathes. diff --git a/test/Makefile.am b/test/Makefile.am index c481a46..7905491 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -7,6 +7,7 @@ TESTCASES = TESTCASES += autotest.at TESTCASES += nbb-basic.at TESTCASES += nbb-config.at +TESTCASES += nbb-automake.at # Add more testcases here EXTRA_DIST += $(TESTCASES) diff --git a/test/local.at b/test/local.at index 1f52645..369978f 100644 --- a/test/local.at +++ b/test/local.at @@ -1,3 +1,35 @@ AT_COPYRIGHT([Copyright (C) 2007,2008 Hans Ulrich Niedermann]) AT_TESTED([autom4te autoconf autoheader autoupdate autoreconf]) # Local initialization of the test environment would happen here + + +m4_define([AT_CREATE_GIT_AM], [dnl +AT_CHECK([mkdir test.git && cd test.git]) +AT_CHECK([cd test.git && git init], [0], +[Initialized empty Git repository in .git/ +]) +AT_DATA([test.git/configure.ac], [dnl +AC[_]INIT(nbb git/automake test, 1.2.3, invalid@invalid.invalid, nbb-git-am-test) +AC_CONFIG_SRCDIR([foobar.c]) +AM[_]INIT_AUTOMAKE([-Wall foreign]) +AC_PROG_CC +AC_PROG_INSTALL +AC[_]CONFIG_FILES(@<:@Makefile@:>@) +AC[_]OUTPUT +])dnl +AT_DATA([test.git/Makefile.am], [dnl +bin_PROGRAMS = foobar +foobar_SOURCES = foobar.c +])dnl +AT_DATA([test.git/foobar.c], [dnl +#include <stdio.h> +int main(int argc, char *argv@<:@@:>@) { + printf("FOOBAR!\n"); + return 0; +} +])dnl +])dnl + +m4_define([AT_REMOVE_GIT_AM], [dnl +AT_CHECK([rm -rf test.git]) +])dnl diff --git a/test/nbb-automake.at b/test/nbb-automake.at new file mode 100644 index 0000000..1170b0c --- /dev/null +++ b/test/nbb-automake.at @@ -0,0 +1,42 @@ +dnl =================================================================== + +AT_COPYRIGHT([Copyright (C) 2008 Hans Ulrich Niedermann]) +AT_TESTED([nbb]) + +dnl =================================================================== + +AT_SETUP([nbb: init]) +AT_KEYWORDS([nbb init]) +AT_CREATE_GIT_AM() +AT_CHECK([cd test.git && nbb init], [0], [ignore], [ignore]) +AT_REMOVE_GIT_AM() +AT_CLEANUP() + +dnl =================================================================== + +AT_SETUP([nbb: configure]) +AT_KEYWORDS([nbb configure]) +AT_CREATE_GIT_AM() +AT_CHECK([cd test.git && nbb configure], [0], [ignore], [ignore]) +AT_REMOVE_GIT_AM() +AT_CLEANUP() + +dnl =================================================================== + +AT_SETUP([nbb: build]) +AT_KEYWORDS([nbb build]) +AT_CREATE_GIT_AM() +AT_CHECK([cd test.git && nbb build], [0], [ignore], [ignore]) +AT_REMOVE_GIT_AM() +AT_CLEANUP() + +dnl =================================================================== + +AT_SETUP([nbb: install]) +AT_KEYWORDS([nbb install]) +AT_CREATE_GIT_AM() +AT_CHECK([cd test.git && nbb install], [0], [ignore], [ignore]) +AT_REMOVE_GIT_AM() +AT_CLEANUP() + +dnl =================================================================== |
