Bug 1411462 - Add test for `configure --help`; r?glandium
We add a simple cram test that `configure --help` works.
I added the test to build/tests because I'm not sure where else it should go.
This test uncovers a few interesting things:
1) piping `./configure --help` to `head` directly causes a Python
traceback (presumably due to the pipe disappearing once N lines
have been read)
2) "checking for vcs source checkout" is printed for --help
3) It is printed twice (!!)
These will be addressed later. Establishing test coverage is
more important.
MozReview-Commit-ID: 9zQ5X8ulTkc
--- a/build/moz.build
+++ b/build/moz.build
@@ -10,16 +10,20 @@ with Files('**'):
# This cannot be named "build" because of bug 922191.
SPHINX_TREES['buildsystem'] = 'docs'
if CONFIG['OS_ARCH'] == 'WINNT':
DIRS += ['win32']
else:
DIRS += ['unix']
+CRAMTEST_MANIFESTS += [
+ 'tests/cram/cram.ini',
+]
+
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
DIRS += ['annotationProcessors']
DEFINES['ACCEPTED_MAR_CHANNEL_IDS'] = CONFIG['ACCEPTED_MAR_CHANNEL_IDS']
if CONFIG['MOZ_BUILD_APP'] == 'browser':
PYTHON_UNITTEST_MANIFESTS += [
'compare-mozconfig/python.ini',
new file mode 100644
--- /dev/null
+++ b/build/tests/cram/cram.ini
@@ -0,0 +1,1 @@
+[test_configure_help.t]
new file mode 100644
--- /dev/null
+++ b/build/tests/cram/test_configure_help.t
@@ -0,0 +1,15 @@
+configure --help works
+
+ $ cd $TESTDIR/../../..
+
+ $ touch $TMP/mozconfig
+ $ export MOZCONFIG=$TMP/mozconfig
+ $ ./configure --help > out
+ $ head -n 7 out
+ Adding configure options from */tmp/mozconfig (glob)
+ checking for vcs source checkout... hg
+ checking for vcs source checkout... hg
+ Usage: configure.py [options]
+
+ Options: [defaults in brackets after descriptions]
+ --help print this message