Megatest

Check-in [76caa12684]
Login
Overview
Comment:added test case for configf + modules
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.65-try3
Files: files | file ages | folders
SHA1: 76caa1268409ae81c086266f91a1904711e90cc1
User & Date: matt on 2019-11-09 21:34:21
Other Links: branch diff | manifest | tags
Context
2019-11-10
19:42
Add getenv to megatest.scm check-in: 740d248cf8 user: matt tags: v1.65-try3
2019-11-09
21:34
added test case for configf + modules check-in: 76caa12684 user: matt tags: v1.65-try3
2019-11-05
04:54
switch to using mtconfigf check-in: b7a9734bdf user: matt tags: v1.65-try3
Changes

Added configf-testing/c.scm version [f12a485793].



















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
;; pretend to be a config file processor
(use posix srfi-69)

(define getenv get-environment-variable)
(define (print-hash-table ht)
  (print "ht=" (hash-table->alist ht)))

(define cfgdata  (conc "(use simple-md5)"
		       "(hash-table-set! ht \"PATH\" (getenv \"PATH\"))"
		       "(hash-table-set! ht \"currdir\" (current-directory))"
		       "(hash-table-set! ht \"md5sum\" (string->md5sum \"Hello\"))"))

(define (faux-cfg-processor ht cfgdata)
  (let* ((proc-str (conc "(lambda (ht)" cfgdata ")")))
    (with-input-from-string proc-str
      (lambda ()
	((eval (read)) ht)))))

(module cfgprocessor
	*

(import ports data-structures chicken scheme files srfi-69 posix srfi-1)
	
(define (faux-cfg-processor-modularized ht cfgdata)
  (let* ((proc-str (conc "(lambda (ht)" cfgdata ")")))
    (with-input-from-string proc-str
      (lambda ()
	((eval (read)) ht)))))
)

(import cfgprocessor)

(print "\nRun the non-modularized version")
(let ((ht (make-hash-table)))
  (faux-cfg-processor ht cfgdata)
  (print-hash-table ht))

(print "\nRun the modularized version")
(let ((ht (make-hash-table)))
  (faux-cfg-processor-modularized ht cfgdata)
  (print-hash-table ht))