Merge lp:~lifeless/subunit/autoconf into lp:~subunit/subunit/trunk
- autoconf
- Merge into trunk
Proposed by
Robert Collins
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~lifeless/subunit/autoconf |
Merge into: | lp:~subunit/subunit/trunk |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~lifeless/subunit/autoconf |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Subunit Developers | Pending | ||
Review via email: mp+6328@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote : | # |
Revision history for this message
Robert Collins (lifeless) wrote : | # |
Oh, and I will note; I'm getting subunit packaged, so I will be landing this one way or another in the next 24 hours. Its mainly a mechanical change so I don't expect peer review of the code to be particularly interesting. I would /prefer/ a review in case I missed something, and if anyone has a conceptual objection to this, please say so asap.
lp:~lifeless/subunit/autoconf
updated
- 66. By Robert Collins
-
Add missing string.h include.
- 67. By Robert Collins
-
Clean .pyc files
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2007-01-28 12:39:52 +0000 |
3 | +++ .bzrignore 2009-05-08 03:53:52 +0000 |
4 | @@ -2,3 +2,30 @@ |
5 | ./c/tests/test_child |
6 | .sconsign |
7 | .sconsign.dblite |
8 | +./m4/** |
9 | +aclocal.m4 |
10 | +compile |
11 | +config.guess |
12 | +config.h.in |
13 | +config.sub |
14 | +configure |
15 | +depcomp |
16 | +install-sh |
17 | +ltmain.sh |
18 | +missing |
19 | +autom4te.cache |
20 | +Makefile.in |
21 | +py-compile |
22 | +.deps |
23 | +.dirstamp |
24 | +.libs |
25 | +*.lo |
26 | +libsubunit.la |
27 | +subunit-0.0.1.tar.gz |
28 | +libtool |
29 | +stamp-h1 |
30 | +libsubunit.pc |
31 | +config.log |
32 | +config.status |
33 | +Makefile |
34 | +config.h |
35 | |
36 | === added file 'INSTALL' |
37 | --- INSTALL 1970-01-01 00:00:00 +0000 |
38 | +++ INSTALL 2009-05-08 03:53:52 +0000 |
39 | @@ -0,0 +1,9 @@ |
40 | +To install subunit |
41 | +------------------ |
42 | + |
43 | +Bootstrap:: |
44 | + autoreconf -vi |
45 | +Configure:: |
46 | + ./configure |
47 | +Install:: |
48 | + make install |
49 | |
50 | === removed file 'Makefile' |
51 | --- Makefile 2006-04-17 04:13:35 +0000 |
52 | +++ Makefile 1970-01-01 00:00:00 +0000 |
53 | @@ -1,13 +0,0 @@ |
54 | -check: |
55 | - scons -Q check |
56 | - |
57 | -all: |
58 | - scons -Q |
59 | - |
60 | -clean: |
61 | - scons -Q -c |
62 | - |
63 | -install: |
64 | - scons -Q install |
65 | - |
66 | -.PHONY: all check clean install |
67 | |
68 | === added file 'Makefile.am' |
69 | --- Makefile.am 1970-01-01 00:00:00 +0000 |
70 | +++ Makefile.am 2009-05-08 03:53:52 +0000 |
71 | @@ -0,0 +1,71 @@ |
72 | +EXTRA_DIST = \ |
73 | + INSTALL \ |
74 | + Makefile.am \ |
75 | + README \ |
76 | + c/README \ |
77 | + c/check-subunit-0.9.3.patch \ |
78 | + c/check-subunit-0.9.5.patch \ |
79 | + c/check-subunit-0.9.6.patch \ |
80 | + c++/README \ |
81 | + c++/cppunit-subunit-1.10.2.patch \ |
82 | + python/subunit/__init__.py \ |
83 | + python/subunit/tests/TestUtil.py \ |
84 | + python/subunit/tests/__init__.py \ |
85 | + python/subunit/tests/sample-script.py \ |
86 | + python/subunit/tests/sample-two-script.py \ |
87 | + python/subunit/tests/test_subunit_filter.py \ |
88 | + python/subunit/tests/test_subunit_stats.py \ |
89 | + python/subunit/tests/test_subunit_tags.py \ |
90 | + python/subunit/tests/test_tap2subunit.py \ |
91 | + python/subunit/tests/test_test_protocol.py \ |
92 | + runtests.py \ |
93 | + shell/README \ |
94 | + shell/share/subunit.sh \ |
95 | + shell/subunit-ui.patch \ |
96 | + shell/tests/test_function_output.sh \ |
97 | + shell/tests/test_source_library.sh |
98 | + |
99 | +ACLOCAL_AMFLAGS = -I m4 |
100 | + |
101 | +SUBUNIT_CFLAGS = -Wall -Werror -Wextra -Wstrict-prototypes -Wmissing-prototypes \ |
102 | + -Wwrite-strings -Wno-variadic-macros -I$(top_srcdir)/c/include |
103 | +AM_CFLAGS = $(SUBUNIT_CFLAGS) |
104 | + |
105 | +include_subunitdir = $(includedir)/subunit |
106 | + |
107 | +dist_bin_SCRIPTS = \ |
108 | + filters/subunit-filter \ |
109 | + filters/subunit-ls \ |
110 | + filters/subunit-stats \ |
111 | + filters/subunit-tags \ |
112 | + filters/subunit2pyunit \ |
113 | + filters/tap2subunit |
114 | + |
115 | +TESTS_ENVIRONMENT = SHELL_SHARE='$(top_srcdir)/shell/share/' PYTHONPATH='$(abs_top_srcdir)/python':${PYTHONPATH} |
116 | +TESTS = runtests.py $(check_PROGRAMS) |
117 | + |
118 | +## install libsubunit.pc |
119 | +pcdatadir = $(libdir)/pkgconfig |
120 | +pcdata_DATA = libsubunit.pc |
121 | + |
122 | +pkgpython_PYTHON = \ |
123 | + python/subunit/__init__.py |
124 | + |
125 | +lib_LTLIBRARIES = libsubunit.la |
126 | + |
127 | +include_subunit_HEADERS = \ |
128 | + c/include/subunit/child.h |
129 | + |
130 | +check_PROGRAMS = \ |
131 | + c/tests/test_child |
132 | + |
133 | +check_SCRIPTS = \ |
134 | + runtests.py |
135 | + |
136 | +libsubunit_la_SOURCES = \ |
137 | + c/lib/child.c \ |
138 | + c/include/subunit/child.h |
139 | + |
140 | +tests_LDADD = @CHECK_LIBS@ $(top_builddir)/libsubunit.la |
141 | +c_tests_test_child_CFLAGS = $(SUBUNIT_CFLAGS) @CHECK_CFLAGS@ |
142 | +c_tests_test_child_LDADD = $(tests_LDADD) |
143 | |
144 | === removed file 'SConstruct' |
145 | --- SConstruct 2009-03-27 05:46:43 +0000 |
146 | +++ SConstruct 1970-01-01 00:00:00 +0000 |
147 | @@ -1,43 +0,0 @@ |
148 | -# setup our tools |
149 | -import os.path |
150 | -import sys |
151 | - |
152 | -# we want the subunit source in the path so we can use it to run |
153 | -# the tests. Yes this does make everything fall over in a screaming |
154 | -# heap when you break it - so dont break it |
155 | -# the system subunit does not have tests installed. So ensure we |
156 | -# use the devel copy. |
157 | -sys.path.insert(0, os.path.abspath('python')) |
158 | -import subunit |
159 | - |
160 | -default_root = os.path.expanduser('~/local/') |
161 | -DESTDIR=ARGUMENTS.get('DESTDIR', default_root) |
162 | -if DESTDIR[-1] != '/': |
163 | - DESTDIR += '/' |
164 | -include = os.path.join(DESTDIR, "include", "subunit") |
165 | -lib = os.path.join(DESTDIR, "lib") |
166 | -bin = os.path.join(DESTDIR, "bin") |
167 | -env = Environment() |
168 | -tests = [] |
169 | -Export('bin', 'env', 'lib', 'include', 'DESTDIR', 'tests') |
170 | - |
171 | -# support tools |
172 | -def run_test_scripts(source, target, env, for_signature): |
173 | - """Run all the sources as executable scripts which return 0 on success.""" |
174 | - # TODO: make this cross platform compatible. |
175 | - return ["LD_LIBRARY_PATH=%s %s" % (os.path.join(str(target[0].dir), |
176 | - env['LIBPATH']), a_source) for a_source in source] |
177 | -test_script_runner = Builder(generator=run_test_scripts) |
178 | -def run_python_scripts(source, target, env, for_signature): |
179 | - """Run all the sources as executable scripts which return 0 on success.""" |
180 | - return ["PYTHONPATH=%s python %s" % (env['PYTHONPATH'], a_source) for a_source in source] |
181 | -python_test_runner = Builder(generator=run_python_scripts) |
182 | -env.Append(BUILDERS = {'TestRC' : test_script_runner, |
183 | - 'TestPython' : python_test_runner}) |
184 | - |
185 | -# tests |
186 | -tests.append(env.TestPython('check_python', 'runtests.py', PYTHONPATH='python')) |
187 | - |
188 | -SConscript(dirs=['c', 'c++', 'filters', 'python', 'shell']) |
189 | - |
190 | -env.Alias('check', tests) |
191 | |
192 | === removed file 'c++/SConscript' |
193 | --- c++/SConscript 2006-04-17 04:13:35 +0000 |
194 | +++ c++/SConscript 1970-01-01 00:00:00 +0000 |
195 | @@ -1,2 +0,0 @@ |
196 | -Import('*') |
197 | -# describe what we need for C++ |
198 | |
199 | === removed file 'c/SConscript' |
200 | --- c/SConscript 2006-04-17 04:48:50 +0000 |
201 | +++ c/SConscript 1970-01-01 00:00:00 +0000 |
202 | @@ -1,14 +0,0 @@ |
203 | -Import('*') |
204 | -# describe what we need for C |
205 | -subunit = SharedLibrary('lib/subunit', ['lib/child.c']) |
206 | -test_child = Program('tests/test_child.c', |
207 | - LIBS=['check', 'subunit'], |
208 | - CPPPATH='include', |
209 | - LIBPATH='lib') |
210 | -tests.append(env.TestRC('check', test_child, LIBPATH='lib')) |
211 | -installs=[] |
212 | -installs.append(env.Install(lib, subunit)) |
213 | -installs.append(env.Install(include, 'include/subunit/child.h')) |
214 | -env.Alias('install', installs) |
215 | -Default(subunit) |
216 | - |
217 | |
218 | === modified file 'c/lib/child.c' |
219 | --- c/lib/child.c 2006-04-15 05:19:59 +0000 |
220 | +++ c/lib/child.c 2009-05-08 03:53:52 +0000 |
221 | @@ -20,6 +20,7 @@ |
222 | |
223 | #include <stdio.h> |
224 | #include <string.h> |
225 | +#include "subunit/child.h" |
226 | |
227 | /* these functions all flush to ensure that the test runner knows the action |
228 | * that has been taken even if the subsequent test etc takes a long time or |
229 | |
230 | === modified file 'c/tests/test_child.c' |
231 | --- c/tests/test_child.c 2006-04-15 05:19:59 +0000 |
232 | +++ c/tests/test_child.c 2009-05-08 03:53:52 +0000 |
233 | @@ -138,9 +138,9 @@ |
234 | } |
235 | |
236 | |
237 | -START_TEST (error) |
238 | +START_TEST (test_error) |
239 | { |
240 | - test_stdout_function("failure: test case [\n" |
241 | + test_stdout_function("error: test case [\n" |
242 | "Multiple lines\n" |
243 | " of output\n" |
244 | "]\n", |
245 | @@ -148,9 +148,7 @@ |
246 | } |
247 | END_TEST |
248 | |
249 | - |
250 | - |
251 | -Suite * |
252 | +static Suite * |
253 | child_suite(void) |
254 | { |
255 | Suite *s = suite_create("subunit_child"); |
256 | @@ -159,6 +157,7 @@ |
257 | tcase_add_test (tc_core, test_start); |
258 | tcase_add_test (tc_core, test_pass); |
259 | tcase_add_test (tc_core, test_fail); |
260 | + tcase_add_test (tc_core, test_error); |
261 | return s; |
262 | } |
263 | |
264 | |
265 | === added file 'configure.ac' |
266 | --- configure.ac 1970-01-01 00:00:00 +0000 |
267 | +++ configure.ac 2009-05-08 03:53:52 +0000 |
268 | @@ -0,0 +1,56 @@ |
269 | +AC_DEFUN([SUBUNIT_MAJOR_VERSION], [0]) |
270 | +AC_DEFUN([SUBUNIT_MINOR_VERSION], [0]) |
271 | +AC_DEFUN([SUBUNIT_MICRO_VERSION], [1]) |
272 | +AC_DEFUN([SUBUNIT_VERSION], |
273 | +[SUBUNIT_MAJOR_VERSION.SUBUNIT_MINOR_VERSION.SUBUNIT_MICRO_VERSION]) |
274 | +AC_PREREQ([2.59]) |
275 | +AC_INIT([subunit], [SUBUNIT_VERSION], [subunit-dev@lists.launchpad.net]) |
276 | +AC_CONFIG_SRCDIR([c/lib/child.c]) |
277 | +AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) |
278 | +AC_CONFIG_MACRO_DIR([m4]) |
279 | +[SUBUNIT_MAJOR_VERSION]=SUBUNIT_MAJOR_VERSION |
280 | +[SUBUNIT_MINOR_VERSION]=SUBUNIT_MINOR_VERSION |
281 | +[SUBUNIT_MICRO_VERSION]=SUBUNIT_MICRO_VERSION |
282 | +[SUBUNIT_VERSION]=SUBUNIT_VERSION |
283 | +AC_SUBST([SUBUNIT_MAJOR_VERSION]) |
284 | +AC_SUBST([SUBUNIT_MINOR_VERSION]) |
285 | +AC_SUBST([SUBUNIT_MICRO_VERSION]) |
286 | +AC_SUBST([SUBUNIT_VERSION]) |
287 | +AC_USE_SYSTEM_EXTENSIONS |
288 | +AC_PROG_CC |
289 | +AM_PROG_CC_C_O |
290 | +AC_PROG_INSTALL |
291 | +AC_PROG_LN_S |
292 | +AC_PROG_LIBTOOL |
293 | +AM_PATH_PYTHON |
294 | +# Checks for libraries. |
295 | + |
296 | +# Checks for header files. |
297 | +AC_CHECK_HEADERS([stdlib.h]) |
298 | + |
299 | +# Checks for typedefs, structures, and compiler characteristics. |
300 | +AC_C_CONST |
301 | +AC_TYPE_PID_T |
302 | +AC_TYPE_SIZE_T |
303 | +AC_HEADER_TIME |
304 | +AC_STRUCT_TM |
305 | + |
306 | +AC_CHECK_SIZEOF(int, 4) |
307 | +AC_CHECK_SIZEOF(short, 2) |
308 | +AC_CHECK_SIZEOF(long, 4) |
309 | + |
310 | +# Checks for library functions. |
311 | +AC_FUNC_MALLOC |
312 | +AC_FUNC_REALLOC |
313 | + |
314 | +# Easier memory management. |
315 | +# C unit testing. |
316 | +PKG_CHECK_MODULES([CHECK], [check >= 0.9.4]) |
317 | + |
318 | +# Output files |
319 | +AC_CONFIG_HEADERS([config.h]) |
320 | + |
321 | +AC_CONFIG_FILES([libsubunit.pc |
322 | + Makefile |
323 | + ]) |
324 | +AC_OUTPUT |
325 | |
326 | === removed file 'filters/SConscript' |
327 | --- filters/SConscript 2009-03-27 05:46:43 +0000 |
328 | +++ filters/SConscript 1970-01-01 00:00:00 +0000 |
329 | @@ -1,14 +0,0 @@ |
330 | -Import('*') |
331 | -# describe what we need for filters |
332 | -filters = [ |
333 | - 'subunit-filter', |
334 | - 'subunit-ls', |
335 | - 'subunit-stats', |
336 | - 'subunit-tags', |
337 | - 'subunit2pyunit', |
338 | - 'tap2subunit', |
339 | - ] |
340 | -installs = [] |
341 | -for filter in filters: |
342 | - installs.append(env.Install(bin, filter)) |
343 | -env.Alias('install', installs) |
344 | |
345 | === added file 'libsubunit.pc.in' |
346 | --- libsubunit.pc.in 1970-01-01 00:00:00 +0000 |
347 | +++ libsubunit.pc.in 2009-05-08 03:53:52 +0000 |
348 | @@ -0,0 +1,11 @@ |
349 | +prefix=@prefix@ |
350 | +exec_prefix=@exec_prefix@ |
351 | +libdir=@libdir@ |
352 | +includedir=@includedir@ |
353 | + |
354 | +Name: subunit |
355 | +Description: Subunit test protocol library. |
356 | +URL: http://launchpad.net/subunit |
357 | +Version: @VERSION@ |
358 | +Libs: -L${libdir} -lsubunit |
359 | +Cflags: -I${includedir} |
360 | |
361 | === added directory 'm4' |
362 | === removed file 'python/SConscript' |
363 | --- python/SConscript 2007-01-17 11:39:01 +0000 |
364 | +++ python/SConscript 1970-01-01 00:00:00 +0000 |
365 | @@ -1,20 +0,0 @@ |
366 | -Import('*') |
367 | -# describe what we need for Python |
368 | - |
369 | -EnsurePythonVersion(2, 4) |
370 | - |
371 | -import distutils.sysconfig |
372 | -import os.path |
373 | - |
374 | -# distutils default prefix is the common path between |
375 | -# distutils.sysconfig.get_python_lib and distutils.sysconfig.get_python_inc |
376 | -prefix = os.path.commonprefix([ |
377 | - distutils.sysconfig.get_python_lib(), |
378 | - distutils.sysconfig.get_python_inc(), |
379 | - ]) |
380 | -# suffix to install .py files to is distutils.sysconfig.get_python_lib() |
381 | -# after the common prefix |
382 | -python_suffix = distutils.sysconfig.get_python_lib()[len(prefix):] |
383 | -# install path for python is then in DESTDIR + python_suffix |
384 | -python_installdir = DESTDIR + python_suffix + '/subunit' |
385 | -env.Alias('install', [Install(python_installdir, 'subunit/__init__.py')]) |
386 | |
387 | === removed file 'shell/SConscript' |
388 | --- shell/SConscript 2006-05-02 23:03:38 +0000 |
389 | +++ shell/SConscript 1970-01-01 00:00:00 +0000 |
390 | @@ -1,5 +0,0 @@ |
391 | -Import('*') |
392 | -# describe what we need for Shell |
393 | - |
394 | -shell_lib_installdir = DESTDIR + '/share/subunit' |
395 | -env.Alias('install', [Install(shell_lib_installdir, 'share/subunit.sh')]) |
396 | |
397 | === modified file 'shell/tests/test_function_output.sh' |
398 | --- shell/tests/test_function_output.sh 2007-01-28 12:43:59 +0000 |
399 | +++ shell/tests/test_function_output.sh 2009-05-08 03:53:52 +0000 |
400 | @@ -27,7 +27,7 @@ |
401 | # have not, this test script may well fail strangely. |
402 | |
403 | # import the library. |
404 | -. shell/share/subunit.sh |
405 | +. ${SHELL_SHARE}subunit.sh |
406 | |
407 | echo 'test: subunit_start_test output' |
408 | func_output=$(subunit_start_test "foo bar") |
409 | |
410 | === modified file 'shell/tests/test_source_library.sh' |
411 | --- shell/tests/test_source_library.sh 2007-01-28 12:43:59 +0000 |
412 | +++ shell/tests/test_source_library.sh 2009-05-08 03:53:52 +0000 |
413 | @@ -26,7 +26,7 @@ |
414 | |
415 | echo 'test: shell bindings can be sourced' |
416 | # if any output occurs, this has failed to source cleanly |
417 | -source_output=$(. shell/share/subunit.sh 2>&1) |
418 | +source_output=$(. ${SHELL_SHARE}subunit.sh 2>&1) |
419 | if [ $? == 0 -a "x$source_output" = "x" ]; then |
420 | echo 'success: shell bindings can be sourced' |
421 | else |
422 | @@ -37,7 +37,7 @@ |
423 | fi |
424 | |
425 | # now source it for real |
426 | -. shell/share/subunit.sh |
427 | +. ${SHELL_SHARE}subunit.sh |
428 | |
429 | # we should have a start_test function |
430 | echo 'test: subunit_start_test exists' |
Switch to using autotools as a build system; this means more people will understand how its built, and it gets a good soname for libsubunit.