Merge lp:~statik/tarmac/makefile into lp:tarmac

Proposed by Elliot Murphy
Status: Merged
Approved by: Paul Hummer
Approved revision: 53
Merged at revision: not available
Proposed branch: lp:~statik/tarmac/makefile
Merge into: lp:tarmac
Diff against target: None lines
To merge this branch: bzr merge lp:~statik/tarmac/makefile
Reviewer Review Type Date Requested Status
Paul Hummer Approve
Review via email: mp+4181@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Elliot Murphy (statik) wrote :

This branch adds a makefile with two targets:
 make test

and

 make test-fail

useful for testing ;)

also fixes up the help for the --test-command option to show what the default test command is.

Revision history for this message
Paul Hummer (rockstar) wrote :

Thanks for the branch!

 vote approve
 status approve

> === added file 'Makefile'
> --- Makefile 1970-01-01 00:00:00 +0000
> +++ Makefile 2009-03-05 02:22:12 +0000
> @@ -0,0 +1,8 @@
> +TESTFLAGS=
> +test:
> + trial $(TESTFLAGS) tarmac
> +
> +test-fail:
> + trial this-will-fail
> +
> +.PHONY: test test-fail
>

This is a clever way of dealing with the difficulty with testing. I like it.

--
Paul Hummer
http://theironlion.net
1024/862FF08F C921 E962 58F8 5547 6723 0E8C 1C4D 8AC5 862F F08F

review: Approve
Revision history for this message
Paul Hummer (rockstar) wrote :

Commit message: Makefile added for easily testing the --test-command (Elliot Murphy)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Makefile'
2--- Makefile 1970-01-01 00:00:00 +0000
3+++ Makefile 2009-03-05 02:22:12 +0000
4@@ -0,0 +1,8 @@
5+TESTFLAGS=
6+test:
7+ trial $(TESTFLAGS) tarmac
8+
9+test-fail:
10+ trial this-will-fail
11+
12+.PHONY: test test-fail
13
14=== modified file 'tarmac/bin.py'
15--- tarmac/bin.py 2009-03-05 01:21:01 +0000
16+++ tarmac/bin.py 2009-03-05 03:00:22 +0000
17@@ -27,7 +27,9 @@
18 help='Print out the branches that would be merged and their '
19 'commit messages, but don\'t actually merge the branches.')
20 parser.add_option('--test-command', type='string', default='make test',
21- help='The test command to run after merging a branch.')
22+ metavar='TEST',
23+ help='The test command to run after merging a branch [default: '
24+ '%default].')
25 options, args = parser.parse_args()
26 self.dry_run = options.dry_run
27 self.test_command = options.test_command
28@@ -103,6 +105,8 @@
29 if retcode == 0:
30 # TODO: It would be very nice if the commit message included
31 # some reference to the people who voted approve.
32+ print '%s succeeded, committing.' % self.test_command
33 target_tree.commit(commit_message)
34 else:
35+ print '%s failed, reverting.' % self.test_command
36 target_tree.revert()

Subscribers

People subscribed via source and target branches