Loading ...
Sorry, an error occurred while loading the content.
 

TIP #101: Export Tcltest Configuration

Expand Messages
  • Don Porter
    TIP #101: EXPORT TCLTEST CONFIGURATION ======================================== Version: $Revision: 1.1 $ Author: Don Porter
    Message 1 of 1 , Jun 11, 2002
      TIP #101: EXPORT TCLTEST CONFIGURATION
      ========================================
      Version: $Revision: 1.1 $
      Author: Don Porter <dgp_at_users.sf.net>
      State: Draft
      Type: Project
      Tcl-Version: 8.4
      Vote: Pending
      Created: Tuesday, 11 June 2002
      URL: http://purl.org/tcl/tip/101.html
      WebEdit: http://purl.org/tcl/tip/edit/101
      Post-History:

      -------------------------------------------------------------------------

      ABSTRACT
      ==========

      Proposes public command _tcltest::configure_ to give programmatic
      control to processing configuration options of the tcltest package.

      RATIONALE
      ===========

      During _package require tcltest_, the internal command
      _ProcessCmdLineArgs_ is evaluated. This command uses the contents of
      _$::argv_ as option-value pairs to configure several aspects of the
      tcltest package.

      This approach leaves two aspect of package configuration hardwired, and
      outside of the control of users of _tcltest_. First, the timing of
      configuration is fixed to package load time. Second, the source of
      configuration data is fixed to be the global variable _argv_.

      It would improve flexible use of tcltest to export a public command,
      _tcltest::configure_, that will allow configuration of _tcltest_ by its
      users at any time and from any source.

      PROPOSAL
      ==========

      Add and export the command _tcltest::configure_, with the syntax:

      tcltest::configure ?option? ?value option value ...?

      With no options, _configure_ returns a list of the available
      configurable options. With a single _option_ argument, _configure_
      returns the corresponding value of that option, or an error if no such
      option exists. In the most general form, _configure_ accepts an even
      number of arguments that are alternating options and values, and sets
      each option to each value.

      The list of options and acceptable values are to be the same as those
      currently recognized by _tcltest_ as its command line options. The
      difference is that this configuration can now be performed
      programmatically, not only on the command line.

      With complete programmatic access to _tcltest_ configuration made
      available, the special customization hooks _processCmdLineArgsHook_ and
      _processCmdLineArgsAddFlagsHook_ will be deprecated and removed from
      the documentation. Compatibility support for their existing use will be
      provided as described below.

      COMPATIBILITY
      ===============

      Many existing test suites have been written depending on the
      auto-configuration from _$::argv_ at package load time. Some of them
      may also be using the special customization hooks that allow the
      addition of more command line options. For compatibility, if the
      presence of any of these hooks is detected, _tcltest_ will fall back to
      performing its load-time configuration. Also, if any command that can
      be influenced by configured values is called prior to any call to
      _configure_, then automatic configuration from _::argv_ will be
      performed.

      COPYRIGHT
      ===========

      This document has been placed in the public domain.

      -------------------------------------------------------------------------

      TIP AutoGenerator - written by Donal K. Fellows

      [[Send Tcl/Tk announcements to tcl-announce@...
      Send administrivia to tcl-announce-request@...
      Announcements archived at http://groups.yahoo.com/group/tcl_announce/
      The primary Tcl/Tk archive is ftp://ftp.neosoft.com/pub/tcl/ ]]
    Your message has been successfully submitted and would be delivered to recipients shortly.