From 407d6871426fe70f0ca3ae180a714016528780cc Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Tue, 24 Oct 2017 17:10:55 -0700 Subject: [PATCH] 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 --HG-- extra : rebase_source : aaf660152cdfe37580f559976bca13ea9bf14c49 --- build/moz.build | 4 ++++ build/tests/cram/cram.ini | 1 + build/tests/cram/test_configure_help.t | 15 +++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 build/tests/cram/cram.ini create mode 100644 build/tests/cram/test_configure_help.t diff --git a/build/moz.build b/build/moz.build index 0f7230fddc41..df745fd85dc6 100644 --- a/build/moz.build +++ b/build/moz.build @@ -15,6 +15,10 @@ if CONFIG['OS_ARCH'] == 'WINNT': else: DIRS += ['unix'] +CRAMTEST_MANIFESTS += [ + 'tests/cram/cram.ini', +] + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': DIRS += ['annotationProcessors'] diff --git a/build/tests/cram/cram.ini b/build/tests/cram/cram.ini new file mode 100644 index 000000000000..feb296db4495 --- /dev/null +++ b/build/tests/cram/cram.ini @@ -0,0 +1 @@ +[test_configure_help.t] diff --git a/build/tests/cram/test_configure_help.t b/build/tests/cram/test_configure_help.t new file mode 100644 index 000000000000..237c202a9d1b --- /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