"t/TEST -start-httpd" can be used to start the httpd. Later on one can use "t/TEST -run-tests t/*.t" to perform the actual test run. Unfortunately, this  2nd call overwrites the configuration. Normally, this should not be a problem  because the same configuration should be generated. But it the server already  runs and has port-based VHosts enabled those ports are already in use. So, the  new config contains other ports. In my case '-start-httpd' has created a  config that used ports 8529, 8530 and 8531. Then the '-run-tests' recreates  the config but now it contains the ports 8529, 8532 and 8533. In my tests I  then use for example
"t/TEST -start-httpd" can be used to start the httpd. Later on one can use
"t/TEST -run-tests t/*.t" to perform the actual test run. Unfortunately, this 
2nd call overwrites the configuration. Normally, this should not be a problem 
because the same configuration should be generated. But it the server already 
runs and has port-based VHosts enabled those ports are already in use. So, the 
new config contains other ports. In my case '-start-httpd' has created a 
config that used ports 8529, 8530 and 8531. Then the '-run-tests' recreates 
the config but now it contains the ports 8529, 8532 and 8533. In my tests I 
then use for example

  Apache::TestRequest::module 'ssl';
  $sslhostport=Apache::TestRequest::hostport;

That reads the new/wrong config and the tests fail.

The patch mainly shifts the time when the config is saved a few steps further
in the program. split_test_args and die_on_invalid_args finish processing of
the command line and die if something is wrong. This is a good thing to do
before anything is saved (IMO).

default_run_opts then makes sure that at least one of -start-httpd,
-stop-httpd or -run-tests is specified. If nothing is given all 3 are set.

After that the new code checks if either -start-httpd or -configure is given. 
Only in these cases the config is written. Strictly speaking, the -configure 
check is not necessary because if only -configure is set -start-httpd is set 
by default_run_opts.


git-svn-id: 3dc0fc3abbf50a5e6a6ee12468d17f12049fffa4@1004278 13f79535-47bb-0310-9956-ffa450edef68

tksst/perl-Apache-Test,tksst/perl-Apache-Test