Bug 1411462 - Add test for `configure --help`; r?glandium draft
authorGregory Szorc <gps@mozilla.com>
Tue, 24 Oct 2017 17:10:55 -0700
changeset 696035 461c9b31684c4cf935c339cb7ccb95872d4fe343
parent 696034 5923f383ba014d75db1fa70aa76073465b03f68e
child 696036 5dead291436ff211037507e96fe71e091279aed1
push id88618
push userbmo:gps@mozilla.com
push dateFri, 10 Nov 2017 04:44:25 +0000
reviewersglandium
bugs1411462
milestone58.0a1
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
build/moz.build
build/tests/cram/cram.ini
build/tests/cram/test_configure_help.t
--- 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