[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: make check

From: Greg Stein <gstein_at_lyra.org>
Date: 2001-06-01 21:18:43 CEST

On Fri, Jun 01, 2001 at 11:35:07AM -0500, Ben Collins-Sussman wrote:
> gstein: I have to confess that I don't fully understand how tests are
> run by 'make check'. It seems that there are two ways to register
> them with 'make check' in build.conf:
>
> 1. add a script to the [test-scripts] section
> 2. add a build target with "install = test" as an attribute.
>
> Is this correct?

Yes.

Also note that we skip a number of tests (adding "testing = skip"). Don't
ask me why; I just translated the old makefiles. Some other build targets
are skipped on purpose because they are invoked by a test script. Comments
are in build.conf to describe why a test is skipped.

>...
> But now I've run into a problem: I'm trying to get a python script to
> run, and it's not happy receiving a random string as an argument --
> it's expecting a test-number too. Do I now need to change our python
> test-system to catch an exception in the case of
>
> testnum = int(sys.argv[1])
>
> ...and just run all the tests when this exception happens? Is that
> the best strategy, to make it deliberately ignore non-integer args?

I'd recommend to use the same strategy as in libsvn_test: run each test
provided on the cmdline (i.e. possibly more than one). Ignore non-integer
arguments. If none were run, then run them all:

    ran_a_test = 0
    for arg in sys.argv[1:]:
      try:
        testnum = int(arg)
      except ValueError:
        print 'notice: ignoring argument:', arg
        continue

      invoke_test(testnum)
      ran_a_test = 1

    if not ran_a_test:
      invoke_all_tests()

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:31 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.