3
;;; Copyright (c) 2005-2006 uim Project http://uim.freedesktop.org/
5
;;; All rights reserved.
7
;;; Redistribution and use in source and binary forms, with or without
8
;;; modification, are permitted provided that the following conditions
10
;;; 1. Redistributions of source code must retain the above copyright
11
;;; notice, this list of conditions and the following disclaimer.
12
;;; 2. Redistributions in binary form must reproduce the above copyright
13
;;; notice, this list of conditions and the following disclaimer in the
14
;;; documentation and/or other materials provided with the distribution.
15
;;; 3. Neither the name of authors nor the names of its contributors
16
;;; may be used to endorse or promote products derived from this software
17
;;; without specific prior written permission.
19
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
20
;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
;;; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
23
;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25
;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26
;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27
;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28
;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34
; Tests for uim-db requires debugging information, so we have to let
35
; libuim load this file and give it a toplevel procedure.
46
(+ 1 (dbg-get-line code)))))))
48
(let name ((code (q (place-holder
50
(uim-db-set-break! (dbg-get-file check)
55
; Certain functions in uim-db.scm are not allowed to call scheme
56
; functions in other files. Otherwise setting a breakpoint to the
57
; function being used may cause an infinite recursion.
61
'(dbg-closures)) ; don't follow these symbols
66
(or (if (or (null? (dbg-get-info datum))
67
(string=? (dbg-get-file datum)
68
(dbg-expand-file-name "uim-db.scm")))
70
; gosh doesn't recognize "#<CLOSURE arg...>"
71
(%%closure-code datum))
72
(dependent? (cddr (%%closure-code datum)))))
74
(and (symbol-bound? datum)
75
(not (memq datum exclude))
77
(set! exclude (cons datum exclude))
78
(dependent? (eval datum)))))
80
(or (dependent? (car datum))
81
(dependent? (cdr datum))))
85
(cdr (srfi-assoc (dbg-expand-file-name "uim-db.scm")
90
; shadow this part from libuim
91
(if (not (symbol-bound? 'feature?))
95
(require "test/uim-test-utils")
97
(define-uim-test-case "testcase debugger"
100
(uim '(begin (load "test/test-db.scm")
101
(load "uim-db.scm")))))
103
(assert-true (uim-bool '(test-db-find))))
104
("test for external dependency"
105
(assert-false (uim-bool '(test-db-dep)))))))