[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.2-20090328-104-g0be6e3a)
The branch, master has been updated
via 0be6e3a9612de6b36ab5e3a734af2b9fbb042efd (commit)
via 6d935086d2997cbb2877a0107e3481e7033fdf99 (commit)
from 374018276325d7d9efa42fb060ccb3cfc58be397 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
gnetlist/scheme/gnet-gsch2pcb.scm.in | 104 +++++++++++++++++++++------
gnetlist/tests/common/inputs/gafrc | 4 +
gnetlist/tests/common/run_backend_tests.sh | 10 ++-
3 files changed, 93 insertions(+), 25 deletions(-)
=================
Commit Messages
=================
commit 0be6e3a9612de6b36ab5e3a734af2b9fbb042efd
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>
Add a -d | --debug option that preserves the run directory.
This helps with testing/debugging because it allows an easy creation
of a scratch directory for running gnetlist.
:100755 100755 40b6592... 042b201... M gnetlist/tests/common/run_backend_tests.sh
commit 6d935086d2997cbb2877a0107e3481e7033fdf99
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>
Allow user configuration of the pcb m4 program and directories via gafrc.
Allow user configuration of the pcb m4 program and directories via gafrc.
Besides allowing for additional runtime control by users, this provides
a mechanism that the testsuite can use to focus on testing gnetlist and
not testing changes in pcb's footprint library. The testsuite now uses
cat - >> outputfile
Instead of feeding the gnetlist output through m4 before comparing to our
reference. This lets us test only the part gnetlist controls.
:100644 100644 0e071c8... 93e9588... M gnetlist/scheme/gnet-gsch2pcb.scm.in
:100644 100644 bff7fbb... b198d79... M gnetlist/tests/common/inputs/gafrc
=========
Changes
=========
commit 0be6e3a9612de6b36ab5e3a734af2b9fbb042efd
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>
Add a -d | --debug option that preserves the run directory.
This helps with testing/debugging because it allows an easy creation
of a scratch directory for running gnetlist.
diff --git a/gnetlist/tests/common/run_backend_tests.sh b/gnetlist/tests/common/run_backend_tests.sh
index 40b6592..042b201 100755
--- a/gnetlist/tests/common/run_backend_tests.sh
+++ b/gnetlist/tests/common/run_backend_tests.sh
@@ -13,7 +13,7 @@ $0 -- Testsuite program for various backends
Usage
$0 [-h | --help]
- $0 [-r | --regen] <backend> [test1 [test2 [....]]]
+ $0 [-d | --debug] [-r | --regen] <backend> [test1 [test2 [....]]]
Options
@@ -36,11 +36,17 @@ $0 --regen new_test spice-sdb
EOF
}
+debug=no
while test -n "$1"
do
case "$1"
in
+ -d|--debug)
+ debug=yes
+ shift
+ ;;
+
-h|--help)
usage
exit 0
@@ -260,7 +266,7 @@ for t in $all_tests ; do
cd $here
# Delete the run directory in prep for the next test
- rm -fr ${rundir}
+ test "$debug" = "no" && rm -fr ${rundir}
done
commit 6d935086d2997cbb2877a0107e3481e7033fdf99
Author: Dan McMahill <dan@xxxxxxxxxxxx>
Commit: Dan McMahill <dan@xxxxxxxxxxxx>
Allow user configuration of the pcb m4 program and directories via gafrc.
Allow user configuration of the pcb m4 program and directories via gafrc.
Besides allowing for additional runtime control by users, this provides
a mechanism that the testsuite can use to focus on testing gnetlist and
not testing changes in pcb's footprint library. The testsuite now uses
cat - >> outputfile
Instead of feeding the gnetlist output through m4 before comparing to our
reference. This lets us test only the part gnetlist controls.
diff --git a/gnetlist/scheme/gnet-gsch2pcb.scm.in b/gnetlist/scheme/gnet-gsch2pcb.scm.in
index 0e071c8..93e9588 100644
--- a/gnetlist/scheme/gnet-gsch2pcb.scm.in
+++ b/gnetlist/scheme/gnet-gsch2pcb.scm.in
@@ -69,7 +69,7 @@
;; Split string at current split-char and returns
;; a pair with substrings. If string is not splitable
;; it returns #f.
-(define (string-split the-string split-char)
+(define (gsch2pcb:string-split the-string split-char)
;;string-index is Guile specific
(let ((split-index (string-index the-string split-char))
(last-index (- (string-length the-string) 1)))
@@ -77,7 +77,7 @@
(cond ((not split-index)
#f)
((= split-index 0)
- (string-split
+ (gsch2pcb:string-split
(substring the-string 1 (string-length the-string))
split-char))
((= split-index last-index)
@@ -91,19 +91,19 @@
;; Splits a string with space separated words and returns a list
;; of the words (still as strings).
-(define (split-to-list the-string)
- (let ((the-list (string-split the-string #\space)))
+(define (gsch2pcb:split-to-list the-string)
+ (let ((the-list (gsch2pcb:string-split the-string #\space)))
(if the-list
- (cons (car the-list) (split-to-list (cdr the-list)))
+ (cons (car the-list) (gsch2pcb:split-to-list (cdr the-list)))
(list the-string))))
;; Joins the elements of a list of strings into a single string,
;; with each element prefixed by a given prefix string.
-(define (list-join-with-prefixes the-list prefix)
+(define (gsch2pcb:list-join-with-prefixes the-list prefix)
(if (null? the-list)
""
(string-append prefix (car the-list)
- (list-join-with-prefixes (cdr the-list) prefix))))
+ (gsch2pcb:list-join-with-prefixes (cdr the-list) prefix))))
(define gsch2pcb:write-value-footprint
@@ -112,7 +112,7 @@
;; refdes contains the first element of ls
(let* ((refdes (car ls))
(value (gnetlist:get-package-attribute refdes "value"))
- (footprint (split-to-list
+ (footprint (gsch2pcb:split-to-list
(gnetlist:get-package-attribute refdes "footprint") ) )
(lquote (if gsch2pcb:use-m4 "`" ""))
(rquote (if gsch2pcb:use-m4 "'" ""))
@@ -121,11 +121,11 @@
(display (string-append "PKG_" (car footprint)) pipe)
(display (string-append "(" lquote (car footprint)) pipe)
- (display (list-join-with-prefixes (cdr footprint) "-") pipe)
+ (display (gsch2pcb:list-join-with-prefixes (cdr footprint) "-") pipe)
(display (string-append rquote "," lquote refdes rquote "," lquote ) pipe)
(display value pipe)
- (display (list-join-with-prefixes (cdr footprint) (string-append rquote "," lquote)) pipe)
+ (display (gsch2pcb:list-join-with-prefixes (cdr footprint) (string-append rquote "," lquote)) pipe)
(display (string-append rquote ")") pipe)
(newline pipe)
(gsch2pcb:write-value-footprint pipe (cdr ls))) )))
@@ -133,15 +133,52 @@
;;
;;
-(define m4-command "@m4@")
-(define m4-pcbdir "@pcbm4dir@")
-(define m4-pcbconfdir "@pcbconfdir@")
-(define m4-files "")
(define gsch2pcb:use-m4 #f)
-;; To emulate popen. Guileish again.
-; Needed after guile ver. 1.3.2. To save 1.3a users, wrap it in.
-; Doesn't work in guile 1.6 (false-if-exception (use-modules (ice-9 popen)))
+
+;; Let the user override the m4 command, the directory
+;; where pcb stores its m4 files and the pcb config directory.
+(if (not (defined? 'gsch2pcb:pcb-m4-command)) (define gsch2pcb:pcb-m4-command "@m4@"))
+(if (not (defined? 'gsch2pcb:pcb-m4-dir)) (define gsch2pcb:pcb-m4-dir "@pcbm4dir@"))
+(if (not (defined? 'gsch2pcb:pcb-m4-confdir)) (define gsch2pcb:pcb-m4-confdir "@pcbconfdir@"))
+
+;; Let the user override the m4 search path
+(if (not (defined? 'gsch2pcb:pcb-m4-path))
+ (define gsch2pcb:pcb-m4-path (list gsch2pcb:pcb-m4-dir gsch2pcb:pcb-m4-confdir "$HOME/.pcb" "."))
+)
+
+;; Build up the m4 command line
+
+(define gsch2pcb:m4-command-line-tmp (string-append
+ gsch2pcb:pcb-m4-command " -d ") )
+(define gsch2pcb:pcb-m4-path-str #f)
+(for-each (lambda (d)
+ (set! gsch2pcb:m4-command-line-tmp (string-append
+ gsch2pcb:m4-command-line-tmp
+ " -I" d))
+ (if gsch2pcb:pcb-m4-path-str
+ (set! gsch2pcb:pcb-m4-path-str (string-append
+ gsch2pcb:pcb-m4-path-str
+ " " d) )
+ (set! gsch2pcb:pcb-m4-path-str d)
+ )
+ )
+ gsch2pcb:pcb-m4-path
+ )
+
+
+
+(set! gsch2pcb:m4-command-line-tmp
+ ( string-append gsch2pcb:m4-command-line-tmp
+ " " gsch2pcb:pcb-m4-dir "/common.m4 - >> "
+ )
+ )
+
+(if (not (defined? 'gsch2pcb:pcb-m4-command-line))
+ (define gsch2pcb:pcb-m4-command-line
+ gsch2pcb:m4-command-line-tmp)
+ )
+
(use-modules (ice-9 popen))
(define (gsch2pcb output-filename)
@@ -150,15 +187,36 @@
(close-port port)
)
+ (set! gsch2pcb:pcb-m4-command-line (string-append
+ gsch2pcb:pcb-m4-command-line
+ output-filename))
+ (display (string-append
+ "=====================================================\n"
+ "gsch2pcb backend configuration:\n"
+ "\n"
+ " ----------------------------------------\n"
+ " Variables which may be changed in gafrc:\n"
+ " ----------------------------------------\n"
+ " gsch2pcb:pcb-m4-command: " gsch2pcb:pcb-m4-command "\n"
+ " gsch2pcb:pcb-m4-dir: " gsch2pcb:pcb-m4-dir "\n"
+ " gsch2pcb:pcb-m4-confdir: " gsch2pcb:pcb-m4-confdir "\n"
+ " gsch2pcb:pcb-m4-path: " gsch2pcb:pcb-m4-path-str "\n"
+ " gsch2pcb:m4-command-line: " gsch2pcb:pcb-m4-command-line "\n"
+ "\n"
+ " ---------------------------------------------------\n"
+ " Variables which may be changed in the project file:\n"
+ " ---------------------------------------------------\n"
+ " gsch2pcb:use-m4: " (if gsch2pcb:use-m4 "yes" "no") "\n"
+ "\n"
+ "=====================================================\n"
+ )
+ )
+
;; If we have defined gsch2pcb:use-m4 then run the footprints
;; through the pcb m4 setup. Otherwise skip m4 entirely
- (if gsch2pcb:use-m4
+ (if gsch2pcb:use-m4
;; pipe with the macro define in pcb program
- (let ((pipe (open-output-pipe (string-append
- m4-command " -d -I. -I" m4-pcbdir " "
- " -I " m4-pcbconfdir " -I$HOME/.pcb -I. "
- m4-pcbdir "/common.m4 " m4-files " - >> "
- output-filename)))
+ (let ((pipe (open-output-pipe gsch2pcb:pcb-m4-command-line))
)
(display "Using the m4 processor for pcb footprints\n")
diff --git a/gnetlist/tests/common/inputs/gafrc b/gnetlist/tests/common/inputs/gafrc
index bff7fbb..b198d79 100644
--- a/gnetlist/tests/common/inputs/gafrc
+++ b/gnetlist/tests/common/inputs/gafrc
@@ -3,3 +3,7 @@
(scheme-directory "${SCMDIR}")
(component-library "./sym")
+
+;; Rather than checking what m4 and pcb's m4 files do with
+;; the output we produce, just see what output gnetlist produces.
+(define gsch2pcb:pcb-m4-command-line "cat - >>")
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs