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
=== added file 'Makefile'
--- Makefile 1970-01-01 00:00:00 +0000
+++ Makefile 2009-03-05 02:22:12 +0000
@@ -0,0 +1,8 @@
1TESTFLAGS=
2test:
3 trial $(TESTFLAGS) tarmac
4
5test-fail:
6 trial this-will-fail
7
8.PHONY: test test-fail
09
=== modified file 'tarmac/bin.py'
--- tarmac/bin.py 2009-03-05 01:21:01 +0000
+++ tarmac/bin.py 2009-03-05 03:00:22 +0000
@@ -27,7 +27,9 @@
27 help='Print out the branches that would be merged and their '27 help='Print out the branches that would be merged and their '
28 'commit messages, but don\'t actually merge the branches.')28 'commit messages, but don\'t actually merge the branches.')
29 parser.add_option('--test-command', type='string', default='make test',29 parser.add_option('--test-command', type='string', default='make test',
30 help='The test command to run after merging a branch.')30 metavar='TEST',
31 help='The test command to run after merging a branch [default: '
32 '%default].')
31 options, args = parser.parse_args()33 options, args = parser.parse_args()
32 self.dry_run = options.dry_run34 self.dry_run = options.dry_run
33 self.test_command = options.test_command35 self.test_command = options.test_command
@@ -103,6 +105,8 @@
103 if retcode == 0:105 if retcode == 0:
104 # TODO: It would be very nice if the commit message included106 # TODO: It would be very nice if the commit message included
105 # some reference to the people who voted approve.107 # some reference to the people who voted approve.
108 print '%s succeeded, committing.' % self.test_command
106 target_tree.commit(commit_message)109 target_tree.commit(commit_message)
107 else:110 else:
111 print '%s failed, reverting.' % self.test_command
108 target_tree.revert()112 target_tree.revert()

Subscribers

People subscribed via source and target branches