# megatest branch: v2.01-local-mtfiles

# opensrc branch: modularize-debug

# goals:

## enable development of eggs without altering megatest install area

## decouple argument processing, debug messages, config file loading

## modularity

-   compiler checks missing bindings (like perl -w)
-   not all modules loaded at start
-   reuse

# architecture notes:

## installation different.

-   was:
    -   make install -> /bin
-   now:
    -   make install ->

## how?

-   link tree
-   during build, setenv CHICKEN\_REPOSITORY
-   at runtime, (repository-path
    -   mtconfigf.scm
    -   common.scm

## decoupling notes

-   mtdebug

        ;; configure mtdebug  ;; TODO: move to megatest.scm with other command line arg processing
        (if (args:get-arg "-v")     (debug:set-verbose-mode))
        (if (args:get-arg "-q")     (debug:set-quiet-mode))
        (if (args:get-arg "-color")
            (case (string->symbol (args:get-arg "-color"))
              ((y Y yes YES t T)  (debug:force-color))
              ((n N no NO f F)    (debug:suppress-color))))
        debug 0,9 does not work
-   mtconfigf

        (define *default-log-port*  (current-error-port))
        (let* ((normal-fn debug:print)
               (info-fn   debug:print-info)
               (error-fn  debug:print-error)
               (default-port *default-log-port*))
          (configf:set-debug-printers normal-fn info-fn error-fn default-port))
        (configf:add-eval-string "(import (prefix mtargs    args:))
                                  (import mtdebug)
                                  (import (prefix mtconfigf configf:))")

## already: common\_records.scm included by many megatest scm's

## new:

-   include modules.scm from common\_records.scm
-   include modules.scm from scm's and utils that do not include common\_records.scm

## modules.scm:

-   use's new eggs
-   sets up new eggs (to be moved to megatest.scm and other toplevels (sauth, dashboard.scm, etc..)

## modules.scm

# completed:

## get thru ext-tests (almost all green except runconfig-tests)

## moved following from megatest source tree into opensrc/mtutils eggs:

-   margs.scm -> mtargs
-   debug: functions in common -> mtdebug
-   configf.scm -> mtconfigf

## color mode for debug:print-error, debug:print-info

# in progress:


# not started & loose threads:

## common.scm -> mtcommon

## -show-config -debug 9

## Makefile dependency weirdness

## and the rest&#x2026; in phase 2

## csi broken for (use mtdebug)

## move egg config from modules.scm to real toplevels (megatest.scm, sauthorize.scm, etc&#x2026;)