Merge autoconf transition and jaunty build updates.
authorRobert Collins <robertc@robertcollins.net>
Fri, 8 May 2009 09:53:16 +0000 (19:53 +1000)
committerRobert Collins <robertc@robertcollins.net>
Fri, 8 May 2009 09:53:16 +0000 (19:53 +1000)
16 files changed:
.bzrignore
INSTALL [new file with mode: 0644]
Makefile [deleted file]
Makefile.am [new file with mode: 0644]
SConstruct [deleted file]
c++/SConscript [deleted file]
c/SConscript [deleted file]
c/lib/child.c
c/tests/test_child.c
configure.ac [new file with mode: 0644]
filters/SConscript [deleted file]
libsubunit.pc.in [new file with mode: 0644]
python/SConscript [deleted file]
shell/SConscript [deleted file]
shell/tests/test_function_output.sh
shell/tests/test_source_library.sh

index 2abfefea474bed3c44e98ae25eebd596c9ad5ae1..23e54cbeeb380d4e06a629f4e6552f0000dab357 100644 (file)
@@ -2,3 +2,30 @@
 ./c/tests/test_child
 .sconsign
 .sconsign.dblite
+./m4/**
+aclocal.m4
+compile
+config.guess
+config.h.in
+config.sub
+configure
+depcomp
+install-sh
+ltmain.sh
+missing
+autom4te.cache
+Makefile.in
+py-compile
+.deps
+.dirstamp
+.libs
+*.lo
+libsubunit.la
+subunit-0.0.1.tar.gz
+libtool
+stamp-h1
+libsubunit.pc
+config.log
+config.status
+Makefile
+config.h
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..655c3df
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,9 @@
+To install subunit
+------------------
+
+Bootstrap::
+  autoreconf -vi
+Configure::
+  ./configure
+Install::
+  make install
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 02d2b16..0000000
--- a/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-check:
-       scons -Q check
-
-all:
-       scons -Q
-
-clean:
-       scons -Q -c
-
-install:
-       scons -Q install
-
-.PHONY: all check clean install
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..4a46018
--- /dev/null
@@ -0,0 +1,74 @@
+EXTRA_DIST =  \
+       INSTALL \
+       Makefile.am \
+       README \
+       c/README \
+       c/check-subunit-0.9.3.patch \
+       c/check-subunit-0.9.5.patch \
+       c/check-subunit-0.9.6.patch \
+       c++/README \
+       c++/cppunit-subunit-1.10.2.patch \
+       python/subunit/__init__.py \
+       python/subunit/tests/TestUtil.py \
+       python/subunit/tests/__init__.py \
+       python/subunit/tests/sample-script.py \
+       python/subunit/tests/sample-two-script.py \
+       python/subunit/tests/test_subunit_filter.py \
+       python/subunit/tests/test_subunit_stats.py \
+       python/subunit/tests/test_subunit_tags.py \
+       python/subunit/tests/test_tap2subunit.py \
+       python/subunit/tests/test_test_protocol.py \
+       runtests.py \
+       shell/README \
+       shell/share/subunit.sh \
+       shell/subunit-ui.patch \
+       shell/tests/test_function_output.sh \
+       shell/tests/test_source_library.sh
+
+ACLOCAL_AMFLAGS = -I m4
+
+SUBUNIT_CFLAGS = -Wall -Werror -Wextra -Wstrict-prototypes -Wmissing-prototypes \
+       -Wwrite-strings -Wno-variadic-macros -I$(top_srcdir)/c/include
+AM_CFLAGS = $(SUBUNIT_CFLAGS)
+
+include_subunitdir = $(includedir)/subunit
+
+dist_bin_SCRIPTS = \
+       filters/subunit-filter \
+       filters/subunit-ls \
+       filters/subunit-stats \
+       filters/subunit-tags \
+       filters/subunit2pyunit \
+       filters/tap2subunit
+
+TESTS_ENVIRONMENT = SHELL_SHARE='$(top_srcdir)/shell/share/' PYTHONPATH='$(abs_top_srcdir)/python':${PYTHONPATH} 
+TESTS = runtests.py $(check_PROGRAMS)
+
+## install libsubunit.pc
+pcdatadir = $(libdir)/pkgconfig
+pcdata_DATA = libsubunit.pc
+
+pkgpython_PYTHON = \
+       python/subunit/__init__.py
+
+lib_LTLIBRARIES = libsubunit.la
+
+include_subunit_HEADERS = \
+       c/include/subunit/child.h
+
+check_PROGRAMS = \
+       c/tests/test_child
+
+check_SCRIPTS = \
+       runtests.py
+
+clean-local:
+       find . -name "*.pyc" | xargs -r rm
+
+libsubunit_la_SOURCES = \
+       c/lib/child.c \
+       c/include/subunit/child.h
+
+tests_LDADD = @CHECK_LIBS@ $(top_builddir)/libsubunit.la
+c_tests_test_child_CFLAGS = $(SUBUNIT_CFLAGS) @CHECK_CFLAGS@
+c_tests_test_child_LDADD = $(tests_LDADD)
diff --git a/SConstruct b/SConstruct
deleted file mode 100644 (file)
index 4ea16e9..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# setup our tools
-import os.path
-import sys
-
-# we want the subunit source in the path so we can use it to run
-# the tests. Yes this does make everything fall over in a screaming
-# heap when you break it - so dont break it
-# the system subunit does not have tests installed. So ensure we
-# use the devel copy.
-sys.path.insert(0, os.path.abspath('python'))
-import subunit
-
-default_root = os.path.expanduser('~/local/')
-DESTDIR=ARGUMENTS.get('DESTDIR', default_root)
-if DESTDIR[-1] != '/':
-  DESTDIR += '/'
-include = os.path.join(DESTDIR, "include", "subunit")
-lib = os.path.join(DESTDIR, "lib")
-bin = os.path.join(DESTDIR, "bin")
-env = Environment()
-tests = []
-Export('bin', 'env', 'lib', 'include', 'DESTDIR', 'tests')
-
-# support tools
-def run_test_scripts(source, target, env, for_signature):
-    """Run all the sources as executable scripts which return 0 on success."""
-    # TODO: make this cross platform compatible.
-    return ["LD_LIBRARY_PATH=%s %s" % (os.path.join(str(target[0].dir), 
-                                env['LIBPATH']), a_source) for a_source in source]
-test_script_runner = Builder(generator=run_test_scripts)
-def run_python_scripts(source, target, env, for_signature):
-    """Run all the sources as executable scripts which return 0 on success."""
-    return ["PYTHONPATH=%s python %s" % (env['PYTHONPATH'], a_source) for a_source in source]
-python_test_runner = Builder(generator=run_python_scripts)
-env.Append(BUILDERS = {'TestRC' : test_script_runner,
-                       'TestPython' : python_test_runner})
-
-# tests
-tests.append(env.TestPython('check_python', 'runtests.py', PYTHONPATH='python'))
-
-SConscript(dirs=['c', 'c++', 'filters', 'python', 'shell'])
-
-env.Alias('check', tests)
diff --git a/c++/SConscript b/c++/SConscript
deleted file mode 100644 (file)
index b36cae9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Import('*')
-# describe what we need for C++
diff --git a/c/SConscript b/c/SConscript
deleted file mode 100644 (file)
index c1dc767..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Import('*')
-# describe what we need for C
-subunit = SharedLibrary('lib/subunit', ['lib/child.c'])
-test_child = Program('tests/test_child.c',
-    LIBS=['check', 'subunit'],
-    CPPPATH='include',
-    LIBPATH='lib')
-tests.append(env.TestRC('check', test_child, LIBPATH='lib'))
-installs=[]
-installs.append(env.Install(lib, subunit))
-installs.append(env.Install(include, 'include/subunit/child.h'))
-env.Alias('install', installs)
-Default(subunit)
-
index 302c50f9ccffc395671f355bca331dc36ac98f99..a733bc2d79e46709aa55a454c3d3a0524edc6a49 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include "subunit/child.h"
 
 /* these functions all flush to ensure that the test runner knows the action
  * that has been taken even if the subsequent test etc takes a long time or
index 3dcd10d380ce321a3ba8f9392a07a25ab20f6c10..32fb857ddd7fbf02de9e7cf8b80fec8a96f60f63 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <stdlib.h>
 #include <unistd.h>
+#include <string.h>
 #include <check.h>
 
 #include "subunit/child.h"
@@ -138,9 +139,9 @@ call_test_error(void)
 }
 
 
-START_TEST (error)
+START_TEST (test_error)
 {
-    test_stdout_function("failure: test case [\n"
+    test_stdout_function("error: test case [\n"
                          "Multiple lines\n"
                         " of output\n"
                         "]\n",
@@ -148,9 +149,7 @@ START_TEST (error)
 }
 END_TEST
 
-
-
-Suite *
+static Suite *
 child_suite(void)
 {
     Suite *s = suite_create("subunit_child");
@@ -159,6 +158,7 @@ child_suite(void)
     tcase_add_test (tc_core, test_start);
     tcase_add_test (tc_core, test_pass);
     tcase_add_test (tc_core, test_fail);
+    tcase_add_test (tc_core, test_error);
     return s;
 }
 
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..88b01c2
--- /dev/null
@@ -0,0 +1,56 @@
+AC_DEFUN([SUBUNIT_MAJOR_VERSION], [0])
+AC_DEFUN([SUBUNIT_MINOR_VERSION], [0])
+AC_DEFUN([SUBUNIT_MICRO_VERSION], [1])
+AC_DEFUN([SUBUNIT_VERSION],
+[SUBUNIT_MAJOR_VERSION.SUBUNIT_MINOR_VERSION.SUBUNIT_MICRO_VERSION])
+AC_PREREQ([2.59])
+AC_INIT([subunit], [SUBUNIT_VERSION], [subunit-dev@lists.launchpad.net])
+AC_CONFIG_SRCDIR([c/lib/child.c])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
+AC_CONFIG_MACRO_DIR([m4])
+[SUBUNIT_MAJOR_VERSION]=SUBUNIT_MAJOR_VERSION
+[SUBUNIT_MINOR_VERSION]=SUBUNIT_MINOR_VERSION
+[SUBUNIT_MICRO_VERSION]=SUBUNIT_MICRO_VERSION
+[SUBUNIT_VERSION]=SUBUNIT_VERSION
+AC_SUBST([SUBUNIT_MAJOR_VERSION])
+AC_SUBST([SUBUNIT_MINOR_VERSION])
+AC_SUBST([SUBUNIT_MICRO_VERSION])
+AC_SUBST([SUBUNIT_VERSION])
+AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_LIBTOOL
+AM_PATH_PYTHON
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([stdlib.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
+
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(short, 2)
+AC_CHECK_SIZEOF(long, 4)
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+
+# Easier memory management.
+# C unit testing.
+PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
+
+# Output files
+AC_CONFIG_HEADERS([config.h])
+
+AC_CONFIG_FILES([libsubunit.pc
+                 Makefile
+                 ])
+AC_OUTPUT
diff --git a/filters/SConscript b/filters/SConscript
deleted file mode 100644 (file)
index 9f58123..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Import('*')
-# describe what we need for filters
-filters = [
-    'subunit-filter',
-    'subunit-ls',
-    'subunit-stats',
-    'subunit-tags',
-    'subunit2pyunit',
-    'tap2subunit',
-    ]
-installs = []
-for filter in filters:
-    installs.append(env.Install(bin, filter))
-env.Alias('install', installs)
diff --git a/libsubunit.pc.in b/libsubunit.pc.in
new file mode 100644 (file)
index 0000000..6756414
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: subunit
+Description: Subunit test protocol library.
+URL: http://launchpad.net/subunit
+Version: @VERSION@
+Libs: -L${libdir} -lsubunit
+Cflags: -I${includedir}
diff --git a/python/SConscript b/python/SConscript
deleted file mode 100644 (file)
index 8eb1136..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-Import('*')
-# describe what we need for Python
-
-EnsurePythonVersion(2, 4)
-
-import distutils.sysconfig
-import os.path
-
-# distutils default prefix is the common path between
-# distutils.sysconfig.get_python_lib and distutils.sysconfig.get_python_inc
-prefix = os.path.commonprefix([
-    distutils.sysconfig.get_python_lib(),
-    distutils.sysconfig.get_python_inc(),
-    ])
-# suffix to install .py files to is distutils.sysconfig.get_python_lib()
-# after the common prefix
-python_suffix = distutils.sysconfig.get_python_lib()[len(prefix):]
-# install path for python is then in DESTDIR + python_suffix
-python_installdir = DESTDIR + python_suffix + '/subunit'
-env.Alias('install', [Install(python_installdir, 'subunit/__init__.py')])
diff --git a/shell/SConscript b/shell/SConscript
deleted file mode 100644 (file)
index bf585eb..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Import('*')
-# describe what we need for Shell
-
-shell_lib_installdir = DESTDIR + '/share/subunit'
-env.Alias('install', [Install(shell_lib_installdir, 'share/subunit.sh')])
index 787281a0f737a28142ed7ee70fec94a6c55ef9b6..068abf7b5da1c839f6629cef5d53134a6352ec3c 100755 (executable)
@@ -27,7 +27,7 @@
 # have not, this test script may well fail strangely.
 
 # import the library.
-. shell/share/subunit.sh
+. ${SHELL_SHARE}subunit.sh
 
 echo 'test: subunit_start_test output'
 func_output=$(subunit_start_test "foo bar")
index 264d5d299c878f6987a47e3df4adf3e1d1cf4ffc..81eef8358f299f6f85f5a1b209b76cabde74556e 100755 (executable)
@@ -26,7 +26,7 @@
 
 echo 'test: shell bindings can be sourced'
 # if any output occurs, this has failed to source cleanly
-source_output=$(. shell/share/subunit.sh 2>&1)
+source_output=$(. ${SHELL_SHARE}subunit.sh 2>&1)
 if [ $? == 0 -a "x$source_output" = "x" ]; then
   echo 'success: shell bindings can be sourced'
 else
@@ -37,7 +37,7 @@ else
 fi
 
 # now source it for real
-. shell/share/subunit.sh
+. ${SHELL_SHARE}subunit.sh
 
 # we should have a start_test function
 echo 'test: subunit_start_test exists'