Remove explicit old versions from cloned repo (#392)
it took a long time to figure out how to restore old versions, using the './scripts/restore-versions file'. Now that it's there and tested it should be ok to remove them from new 'git clone' of medley
This commit is contained in:
@@ -1,137 +0,0 @@
|
||||
;; Function To Be Tested: BROWSER-2 (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 10, 1987
|
||||
;;
|
||||
;; Last Update: March 11, 1987
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>browser-part2.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (BROWSER T/NIL)
|
||||
;;
|
||||
;; Function Description: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it.
|
||||
;;
|
||||
;; Argument(s): T or NIL (SEE Browser documentation)
|
||||
;;
|
||||
;; Returns: IL:MSPATHS
|
||||
;;
|
||||
;; Constraints/Limitations: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it. Part 1 of this test is
|
||||
;; to determine if masterscope is unaffected when the BROWSER is not enabled or
|
||||
;; (IL:BROWSER NIL). Part I also tests to see if grapher is automatically loaded
|
||||
;; by browser. Make sure that Part 1 is run before Part 2. Part 2 of BROWSER test
|
||||
;; determines if BROWSER modified masterscope in such a way that paths are displayed
|
||||
;; grahically in a display window.
|
||||
;;
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-GFuntion
|
||||
;; |
|
||||
;; GFun-A------------------------GFun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; GFun-A1 GFun-A2 GFun-A3 GFun-B1 GFun-B2 GFun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; GFun-C1 GFun-A1
|
||||
;;
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "BROWSER2-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ BROWSERW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>BROWSER.REPORT")
|
||||
(DEFUN BROWSER-FAILED NIL (PROGN
|
||||
(SETQ *OUTPUT* (OPEN TEST-RESULT :DIRECTION :OUTPUT
|
||||
:IF-EXISTS :APPEND))
|
||||
(PASS-FAIL 'BROWSER-DISPLAY NIL)
|
||||
(CLOSE *OUTPUT*)
|
||||
(IL:CLOSEW BROWSERW)
|
||||
(IL:CLRPROMPT)))
|
||||
(DEFUN BROWSER-SUCCEEDED NIL (PROGN
|
||||
(SETQ *OUTPUT* (OPEN TEST-RESULT :DIRECTION :OUTPUT
|
||||
:IF-EXISTS :APPEND))
|
||||
(PASS-FAIL 'BROWSER-DISPLAY T)
|
||||
(CLOSE *OUTPUT*)
|
||||
(IL:CLOSEW BROWSERW)
|
||||
(IL:CLRPROMPT)))
|
||||
(SETQ MESSAGE " Please enter (BROWSER-SUCCEEDED) if test has succeeded
|
||||
or (BROWSER-FAILED) if test has failed.")
|
||||
(SETQ BROWSER2-COMMAND-STRING
|
||||
"; Reinitialize and Define functions to be analyzed....
|
||||
(PAUSE)
|
||||
. ERASE
|
||||
(DEFUN TOP-GFUNTION NIL (AND (GFUN-A) (GFUN-B)))
|
||||
(DEFUN GFUN-A NIL (OR (GFUN-A1) (GFUN-A2) (GFUN-A3)))
|
||||
(DEFUN GFUN-B NIL (OR (GFUN-B1) (GFUN-B2) (GFUN-B3)))
|
||||
(DEFUN GFUN-A1 NIL T)
|
||||
(DEFUN GFUN-A2 NIL NIL)
|
||||
(DEFUN GFUN-A3 NIL T)
|
||||
(DEFUN GFUN-B1 NIL (AND (GFUN-C1)(GFUN-A1)))
|
||||
(DEFUN GFUN-B2 NIL NIL)
|
||||
(DEFUN GFUN-B3 NIL T)
|
||||
(DEFUN GFUN-C1 NIL NIL)
|
||||
|
||||
; Start analyzing functions in gtop-function and others...
|
||||
(PAUSE)
|
||||
. ANALYZE TOP-GFUNTION
|
||||
. ANALYZE GFUN-A
|
||||
. ANALYZE GFUN-B
|
||||
. ANALYZE GFUN-A1
|
||||
. ANALYZE GFUN-A2
|
||||
. ANALYZE GFUN-A3
|
||||
. ANALYZE GFUN-B1
|
||||
. ANALYZE GFUN-B2
|
||||
. ANALYZE GFUN-B3
|
||||
. ANALYZE GFUN-C1
|
||||
; Browser is now loaded and activated by Part 1 test of browser
|
||||
; Part 2 of this test is to determine if masterscope is modified by enabling
|
||||
; the BROWSER or (IL:BROWSER T)
|
||||
(IL:BROWSER T)
|
||||
(PAUSE)
|
||||
; show paths should display the following path graphically in a display window
|
||||
; 1.gfun-a1 gfun-a top-gfuntion
|
||||
; 2. gfun-b1 gfun-b top-gfuntion
|
||||
; show paths should display the above path graphically in a display window
|
||||
; as being shown on the lower left from
|
||||
; {eris}<lispcore>test>program-analysis>browser.graph.
|
||||
; Loading the graph.......
|
||||
(PAUSE)
|
||||
(IL:TEDIT '{eris}<lispcore>test>program-analysis>browser.graph BROWSERW)
|
||||
(IL:TTY.PROCESS 'EXEC)
|
||||
;
|
||||
; The graph returned from BROWSER should look like the one that is being
|
||||
; displayed on the lower right. If they are identical, please enter
|
||||
; (BROWSER-SUCCEEDED) else enter (BROWSER-FAILED)
|
||||
; at the end of the test. If it breaks, enter ^ in the break
|
||||
; window to return to exec. The result will automatically be logged
|
||||
; in {eris}<lispcore>test>program-analysis>browser.report.
|
||||
(PAUSE)
|
||||
(IL:PROMPTPRINT MESSAGE)
|
||||
. SHOW PATHS TO GFUN-A1 FROM TOP-GFUNTION
|
||||
")
|
||||
(IL:BKSYSBUF BROWSER2-COMMAND-STRING)
|
||||
)
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
;; Function To Be Tested: BROWSER-2 (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 10, 1987
|
||||
;;
|
||||
;; Last Update: March 11, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>browser-part2.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (BROWSER T/NIL)
|
||||
;;
|
||||
;; Function Description: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it.
|
||||
;;
|
||||
;; Argument(s): T or NIL (SEE Browser documentation)
|
||||
;;
|
||||
;; Returns: IL:MSPATHS
|
||||
;;
|
||||
;; Constraints/Limitations: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it. Part 1 of this test is
|
||||
;; to determine if masterscope is unaffected when the BROWSER is not enabled or
|
||||
;; (IL:BROWSER NIL). Part I also tests to see if grapher is automatically loaded
|
||||
;; by browser. Make sure that Part 1 is run before Part 2. Part 2 of BROWSER test
|
||||
;; determines if BROWSER modified masterscope in such a way that paths are displayed
|
||||
;; grahically in a display window.
|
||||
;;
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-GFuntion
|
||||
;; |
|
||||
;; GFun-A------------------------GFun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; GFun-A1 GFun-A2 GFun-A3 GFun-B1 GFun-B2 GFun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; GFun-C1 GFun-A1
|
||||
;;
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "BROWSER2-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ BROWSERW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>BROWSER.REPORT")
|
||||
(DEFUN BROWSER-FAILED NIL (PROGN
|
||||
(PASS-FAIL 'BROWSER-DISPLAY NIL)
|
||||
(IL:CLOSEW BROWSERW)
|
||||
(IL:CLRPROMPT)))
|
||||
(DEFUN BROWSER-SUCCEEDED NIL (PROGN
|
||||
(PASS-FAIL 'BROWSER-DISPLAY T)
|
||||
(IL:CLOSEW BROWSERW)
|
||||
(IL:CLRPROMPT)))
|
||||
(SETQ MESSAGE " Please enter (BROWSER-SUCCEEDED) if test has succeeded
|
||||
or (BROWSER-FAILED) if test has failed.")
|
||||
; Reinitialize and Define functions to be analyzed....
|
||||
(PAUSE)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-GFUNTION NIL (AND (GFUN-A) (GFUN-B)))
|
||||
(DEFUN GFUN-A NIL (OR (GFUN-A1) (GFUN-A2) (GFUN-A3)))
|
||||
(DEFUN GFUN-B NIL (OR (GFUN-B1) (GFUN-B2) (GFUN-B3)))
|
||||
(DEFUN GFUN-A1 NIL T)
|
||||
(DEFUN GFUN-A2 NIL NIL)
|
||||
(DEFUN GFUN-A3 NIL T)
|
||||
(DEFUN GFUN-B1 NIL (AND (GFUN-C1)(GFUN-A1)))
|
||||
(DEFUN GFUN-B2 NIL NIL)
|
||||
(DEFUN GFUN-B3 NIL T)
|
||||
(DEFUN GFUN-C1 NIL NIL)
|
||||
|
||||
; Start analyzing functions in gtop-function and others...
|
||||
(PAUSE)
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-GFUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A1))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A2))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A3))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B1))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B2))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B3))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-C1))
|
||||
|
||||
; Browser is now loaded and activated by Part 1 test of browser
|
||||
; Part 2 of this test is to determine if masterscope is modified by enabling
|
||||
; the BROWSER or (IL:BROWSER T)
|
||||
(IL:BROWSER T)
|
||||
(PAUSE)
|
||||
; show paths should display the following path graphically in a display window
|
||||
; 1.gfun-a1 gfun-a top-gfuntion
|
||||
; 2. gfun-b1 gfun-b top-gfuntion
|
||||
; show paths should display the above path graphically in a display window
|
||||
; as being shown on the lower left from
|
||||
; {eris}<lispcore>test>program-analysis>browser.graph.
|
||||
; Loading the graph.......
|
||||
(PAUSE)
|
||||
;
|
||||
; The graph returned from BROWSER should look like the one that is being
|
||||
; displayed on the lower right. If they are identical, please enter
|
||||
; (BROWSER-SUCCEEDED) else enter (BROWSER-FAILED)
|
||||
; at the end of the test. If it breaks, enter ^ in the break
|
||||
; window to return to exec. The result will automatically be logged
|
||||
; in {eris}<lispcore>test>program-analysis>browser.report.
|
||||
(PAUSE)
|
||||
(IL:PROMPTPRINT MESSAGE)
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO GFUN-A1 FROM TOP-GFUNTION))
|
||||
(PASS-FAIL 'BROWSER-DISPLAY (Y-OR-N-P "Did the browser work? "))
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
;; Function To Be Tested: BROWSER-2 (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 10, 1987
|
||||
;;
|
||||
;; Last Update: March 11, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>browser-part2.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (BROWSER T/NIL)
|
||||
;;
|
||||
;; Function Description: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it.
|
||||
;;
|
||||
;; Argument(s): T or NIL (SEE Browser documentation)
|
||||
;;
|
||||
;; Returns: IL:MSPATHS
|
||||
;;
|
||||
;; Constraints/Limitations: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it. Part 1 of this test is
|
||||
;; to determine if masterscope is unaffected when the BROWSER is not enabled or
|
||||
;; (IL:BROWSER NIL). Part I also tests to see if grapher is automatically loaded
|
||||
;; by browser. Make sure that Part 1 is run before Part 2. Part 2 of BROWSER test
|
||||
;; determines if BROWSER modified masterscope in such a way that paths are displayed
|
||||
;; grahically in a display window.
|
||||
;;
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-GFuntion
|
||||
;; |
|
||||
;; GFun-A------------------------GFun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; GFun-A1 GFun-A2 GFun-A3 GFun-B1 GFun-B2 GFun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; GFun-C1 GFun-A1
|
||||
;;
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "BROWSER2-TEST-SETUP"
|
||||
|
||||
(IL:FILESLOAD (IL:SYSLOAD) MASTERSCOPE BROWSER GRAPHER)
|
||||
(SETQ BROWSERW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
|
||||
; Reinitialize and Define functions to be analyzed....
|
||||
(PAUSE)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-GFUNTION NIL (AND (GFUN-A) (GFUN-B)))
|
||||
(DEFUN GFUN-A NIL (OR (GFUN-A1) (GFUN-A2) (GFUN-A3)))
|
||||
(DEFUN GFUN-B NIL (OR (GFUN-B1) (GFUN-B2) (GFUN-B3)))
|
||||
(DEFUN GFUN-A1 NIL T)
|
||||
(DEFUN GFUN-A2 NIL NIL)
|
||||
(DEFUN GFUN-A3 NIL T)
|
||||
(DEFUN GFUN-B1 NIL (AND (GFUN-C1)(GFUN-A1)))
|
||||
(DEFUN GFUN-B2 NIL NIL)
|
||||
(DEFUN GFUN-B3 NIL T)
|
||||
(DEFUN GFUN-C1 NIL NIL)
|
||||
|
||||
; Start analyzing functions in gtop-function and others...
|
||||
(PAUSE)
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-GFUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A1))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A2))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A3))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B1))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B2))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B3))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-C1))
|
||||
|
||||
; Browser is now loaded and activated by Part 1 test of browser
|
||||
; Part 2 of this test is to determine if masterscope is modified by enabling
|
||||
; the BROWSER or (IL:BROWSER T)
|
||||
(IL:BROWSER T)
|
||||
; show paths should display the following path graphically in a display window
|
||||
; 1.gfun-a1 gfun-a top-gfuntion
|
||||
; 2. gfun-b1 gfun-b top-gfuntion
|
||||
; show paths should display the above path graphically in a display window
|
||||
; as being shown on the lower left from
|
||||
; {eris}<lispcore>test>program-analysis>browser.graph.
|
||||
; Loading the graph.......
|
||||
;
|
||||
; The graph returned from BROWSER should look like the one that is being
|
||||
; displayed on the lower right. If they are identical, please enter
|
||||
; (BROWSER-SUCCEEDED) else enter (BROWSER-FAILED)
|
||||
; at the end of the test. If it breaks, enter ^ in the break
|
||||
; window to return to exec. The result will automatically be logged
|
||||
; in {eris}<lispcore>test>program-analysis>browser.report.
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO GFUN-A1 FROM TOP-GFUNTION))
|
||||
(PASS-FAIL 'BROWSER-DISPLAY (Y-OR-N-P "Did the browser work? "))
|
||||
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
;; Function To Be Tested: BROWSER-2 (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 10, 1987
|
||||
;;
|
||||
;; Last Update: March 11, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>browser-part2.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (BROWSER T/NIL)
|
||||
;;
|
||||
;; Function Description: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it.
|
||||
;;
|
||||
;; Argument(s): T or NIL (SEE Browser documentation)
|
||||
;;
|
||||
;; Returns: IL:MSPATHS
|
||||
;;
|
||||
;; Constraints/Limitations: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it. Part 1 of this test is
|
||||
;; to determine if masterscope is unaffected when the BROWSER is not enabled or
|
||||
;; (IL:BROWSER NIL). Part I also tests to see if grapher is automatically loaded
|
||||
;; by browser. Make sure that Part 1 is run before Part 2. Part 2 of BROWSER test
|
||||
;; determines if BROWSER modified masterscope in such a way that paths are displayed
|
||||
;; grahically in a display window.
|
||||
;;
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-GFuntion
|
||||
;; |
|
||||
;; GFun-A------------------------GFun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; GFun-A1 GFun-A2 GFun-A3 GFun-B1 GFun-B2 GFun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; GFun-C1 GFun-A1
|
||||
;;
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "BROWSER2-TEST-SETUP"
|
||||
|
||||
(IL:FILESLOAD (IL:SYSLOAD) MASTERSCOPE BROWSER GRAPHER)
|
||||
(SETQ BROWSERW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
|
||||
; Reinitialize and Define functions to be analyzed....
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-GFUNTION NIL (AND (GFUN-A) (GFUN-B)))
|
||||
(DEFUN GFUN-A NIL (OR (GFUN-A1) (GFUN-A2) (GFUN-A3)))
|
||||
(DEFUN GFUN-B NIL (OR (GFUN-B1) (GFUN-B2) (GFUN-B3)))
|
||||
(DEFUN GFUN-A1 NIL T)
|
||||
(DEFUN GFUN-A2 NIL NIL)
|
||||
(DEFUN GFUN-A3 NIL T)
|
||||
(DEFUN GFUN-B1 NIL (AND (GFUN-C1)(GFUN-A1)))
|
||||
(DEFUN GFUN-B2 NIL NIL)
|
||||
(DEFUN GFUN-B3 NIL T)
|
||||
(DEFUN GFUN-C1 NIL NIL)
|
||||
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-GFUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A1))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A2))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A3))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B1))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B2))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B3))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-C1))
|
||||
|
||||
; Browser is now loaded and activated by Part 1 test of browser
|
||||
; Part 2 of this test is to determine if masterscope is modified by enabling
|
||||
; the BROWSER or (IL:BROWSER T)
|
||||
(IL:BROWSER T)
|
||||
; show paths should display the following path graphically in a display window
|
||||
; 1.gfun-a1 gfun-a top-gfuntion
|
||||
; 2. gfun-b1 gfun-b top-gfuntion
|
||||
; show paths should display the above path graphically in a display window
|
||||
; as being shown on the lower left from
|
||||
; {eris}<lispcore>test>program-analysis>browser.graph.
|
||||
; Loading the graph.......
|
||||
;
|
||||
; The graph returned from BROWSER should look like the one that is being
|
||||
; displayed on the lower right. If they are identical, please enter
|
||||
; (BROWSER-SUCCEEDED) else enter (BROWSER-FAILED)
|
||||
; at the end of the test. If it breaks, enter ^ in the break
|
||||
; window to return to exec. The result will automatically be logged
|
||||
; in {eris}<lispcore>test>program-analysis>browser.report.
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO GFUN-A1 FROM TOP-GFUNTION))
|
||||
(PASS-FAIL 'BROWSER-DISPLAY (Y-OR-N-P "Did the browser work? "))
|
||||
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
;; Function To Be Tested: DATABASEFNS (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 18, 1987
|
||||
;;
|
||||
;; Last Update: March 20, 1987
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>databasefns.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (DUMPDB FILE) & (LOADDB FILE)
|
||||
;;
|
||||
;; Function Description: DATABASEFNS is a very small package whose purpose is to make
|
||||
;; the construction and maintenance of masterscope data bases an essentially automatic
|
||||
;; process. It modifies MAKEFILE, LOAD, and LOADFROM to update database for masterscope.
|
||||
;; For more info, refer to Lisp Library Modules Manual, Lyric beta release.
|
||||
;; The user can dump and restore data bases explicitly via the following functions:
|
||||
;; (DUMPDB file) - Dumps a data base for FILE then sets the DATABASE property to YES,
|
||||
;; so that data base maintenance for FILE will subsequently be automatic.
|
||||
;; (LOADDB file) - Loads the file FILE.DATABASE if one exists. After the data base is
|
||||
;; loaded, the DATABASE property for FILE is set to YES, so that maintenance will be
|
||||
;; thereafter automatic.
|
||||
;;
|
||||
;; Argument(s): (SEE Databasefns documentation)
|
||||
;;
|
||||
;; Returns: (SEE Databasefns documentation)
|
||||
;;
|
||||
;; Constraints/Limitations: The primary emphasis of this testing is the explicit
|
||||
;; dumpting and restoration of data bases. Instructions will be given in the prompt
|
||||
;; window for the user action to be taken during testing and appropriate messages
|
||||
;; will be displayed to explain each test process. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>databasefns.report. This test requires
|
||||
;; DATABASEFNS, TEDIT, and MASTERSCOPE.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
(DO-TEST "DATABASEFNS-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ TEST-START (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>DATABASEFNS.REPORT")
|
||||
(DEFUN T-FORMAT (TIME)
|
||||
(FORMAT *OUTPUT* "~2%TOTAL TEST RUN TIME FOR DATABASEFNS: ~F MINUTES ~%"
|
||||
TIME))
|
||||
|
||||
(DEFUN ITEM-FORMAT-S (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: DATABASEFNS TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'SUCCESS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-F (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: DATABASEFNS TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'FAIL (IL:DATE) IL:USERNAME))
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IF (EQ TEST-ITEM T) (ITEM-FORMAT-S COMMAND-LANGUAGE)
|
||||
(ITEM-FORMAT-F COMMAND-LANGUAGE)))
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ DATABASEFNSW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
(SETQ DATABASEFNS-COMMAND-STRING
|
||||
"; Loading databasefns and other required files from {erinyes}<lyric>library>....
|
||||
(PAUSE)
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(IL:LOAD? '{ERINYES}<LYRIC>LIBRARY>TEDIT.LCOM 'IL:SYSLOAD)
|
||||
(IL:LOAD? '{ERINYES}<LYRIC>LIBRARY>MASTERSCOPE.LCOM 'IL:SYSLOAD)
|
||||
(IL:LOAD '{ERINYES}<LYRIC>LIBRARY>DATABASEFNS.LCOM 'IL:SYSLOAD)
|
||||
|
||||
; Copy the necessary source file (data) to {core}
|
||||
(IL:COPYFILE '{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>DATABASEFNS.DATA
|
||||
'{CORE}NEW-FUNCTION)
|
||||
CONN {CORE}
|
||||
(PAUSE)
|
||||
; This tests to see if the global variable LOADDBFLG and SAVEDBFLG are initially
|
||||
; set to ASK
|
||||
(IF (AND (EQ IL:LOADDBFLG 'IL:ASK) (EQ IL:SAVEDBFLG 'IL:ASK))
|
||||
(SETQ DB-VARIABLES-FLG T)
|
||||
(SETQ DB-VARIABLES-FLG NIL))
|
||||
|
||||
|
||||
|
||||
; This part of the test loads the initial data file for masterscope analysis
|
||||
(IL:PROMPTPRINT '(Please enter Y when masterscope asks for loading))
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(LOAD '{CORE}NEW-FUNCTION)
|
||||
. ANALYZE FUNCTIONS ON {CORE}NEW-FUNCTION
|
||||
. WHO IS CALLED BY IL:NEW-FUNCTION
|
||||
(SETQ OLD-CALL-LIST *)
|
||||
(IL:CLRPROMPT)
|
||||
|
||||
; New-function is redefined; it also utilized times function ...
|
||||
(IL:DEFINEQ (IL:NEW-FUNCTION (X Y) (IL:PLUS (IL:PLUS X Y) (IL:TIMES X Y))))
|
||||
. WHO IS CALLED BY IL:NEW-FUNCTION
|
||||
(SETQ NEW-CALL-LIST *)
|
||||
(IF (EQUAL (SET-DIFFERENCE NEW-CALL-LIST OLD-CALL-LIST) '(IL:TIMES))
|
||||
(SETQ DB-UPDATE-FLG T)
|
||||
(SETQ DB-UPDATE-FLG NIL))
|
||||
(IL:DUMPDB '{CORE}NEW-FUNCTION)
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NO)
|
||||
(IF (PROBE-FILE '{CORE}NEW-FUNCTION.DATABASE)
|
||||
(SETQ DB-CREATED-FLG T)
|
||||
(SETQ DB-CREATED-FLG NIL))
|
||||
(IL:REMPROP 'IL:NEW-FUNCTION 'IL:DATABASE)
|
||||
(IL:LOADDB '{CORE}NEW-FUNCTION)
|
||||
(IF (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(SETQ DB-FLG-RESET T)
|
||||
(SETQ DB-FLG-RESET NIL))
|
||||
|
||||
; Loading the database file will reset the property database with 'YES values
|
||||
; and make masterscope database maintenance automatic..
|
||||
; Cleanup will do recompilation and generate the updated database
|
||||
(PAUSE)
|
||||
(IL:PROMPTPRINT '(enter n it the system asks you to save any variables:
|
||||
enter y if the system asks you if you want a masterscope database))
|
||||
(IL:CLEANUP)
|
||||
|
||||
; Now new souce and compiles files and corresponding database should have been
|
||||
; created
|
||||
(IF (AND (PROBE-FILE '{CORE}NEW-FUNCTION)
|
||||
(PROBE-FILE '{CORE}NEW-FUNCTION.DFASL)
|
||||
(PROBE-FILE '{CORE}NEW-FUNCTION.DATABASE))
|
||||
(SETQ DB-CREATED-MAKEFILE T)
|
||||
(SETQ DB-CREATED-MAKEFILE NIL))
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NO)
|
||||
|
||||
; Displaying the database that has been created in a tedit window...
|
||||
(IL:PROMPTPRINT '(Displaying the database in a tedit window...))
|
||||
(PAUSE)
|
||||
(SETQ DATA-WINDOW (IL:CREATEW '(750 50 400 500) 'DATABASE-WINDOW))
|
||||
(SETQ DATA-STREAM (IL:OPENTEXTSTREAM '{CORE}NEW-FUNCTION.DATABASE
|
||||
DATA-WINDOW ))
|
||||
(SLEEP 4)
|
||||
(CLOSE DATA-STREAM)
|
||||
(IL:CLOSEW DATA-WINDOW)
|
||||
|
||||
; Erasing masterscope record for NEW-FUNCTION....
|
||||
. ERASE IL:NEW-FUNCTION
|
||||
(IL:PROMPTPRINT '(. who calls who should now return nil))
|
||||
(PAUSE)
|
||||
. WHO IS CALLED BY IL:NEW-FUNCTION
|
||||
|
||||
; Setting the variable LOADDBFLG to NO will not load the database file...
|
||||
(IL:REMPROP 'IL:NEW-FUNCTION 'IL:DATABASE)
|
||||
(SETQ IL:LOADDBFLG 'IL:NO)
|
||||
(IL:LOAD '{CORE}NEW-FUNCTION)
|
||||
(IF (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NONE)
|
||||
(SETQ DB-NOT-LOADED T) (SETQ DB-NOT-LOADED NIL))
|
||||
|
||||
; Setting the variable LOADDBFLG to YES will load the database file...
|
||||
(SETQ IL:LOADDBFLG 'IL:YES)
|
||||
(IL:LOAD '{CORE}NEW-FUNCTION)
|
||||
(IF (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(SETQ DB-LOADED T) (SETQ DB-LOADED NIL))
|
||||
|
||||
|
||||
; Now delete all the files except for the original file for new-function
|
||||
(MAPCAR #'DELETE-FILE (IL:DIRECTORY '{CORE}))
|
||||
|
||||
CONN {DSK}
|
||||
(IL:CLRPROMPT)
|
||||
(SETQ IL:LOADDBFLG 'IL:ASK)
|
||||
(SETQ TEST-END (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TOTAL-TEST-TIME (FLOAT (/ (- TEST-END TEST-START) 60000)))
|
||||
|
||||
(DO-TEST 'DATABASEFNS-TEST-RESULT
|
||||
(PROGN (SETQ *OUTPUT* (OPEN TEST-RESULT :DIRECTION :OUTPUT
|
||||
:IF-EXISTS :APPEND))
|
||||
(PASS-FAIL 'DABASEFNS-VARIABLES DB-VARIABLES-FLG)
|
||||
(PASS-FAIL 'DATABASE-UPDATE DB-UPDATE-FLG)
|
||||
(PASS-FAIL 'DATABASE-CREATED DB-CREATED-FLG)
|
||||
(PASS-FAIL 'DATABASE-PROP-RESET DB-FLG-RESET)
|
||||
(PASS-FAIL 'DATABASE-CREATED-BY-MAKEFILE DB-CREATED-MAKEFILE)
|
||||
(PASS-FAIL 'LOADDB-FLG-NO DB-NOT-LOADED)
|
||||
(PASS-FAIL 'LOADDB-FLG-YES DB-LOADED)
|
||||
(T-FORMAT TOTAL-TEST-TIME)
|
||||
(CLOSE *OUTPUT*)
|
||||
(IDENTITY T)
|
||||
)
|
||||
)
|
||||
|
||||
")
|
||||
(IL:BKSYSBUF DATABASEFNS-COMMAND-STRING)
|
||||
)
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,187 +0,0 @@
|
||||
;; Function To Be Tested: DATABASEFNS (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 18, 1987
|
||||
;;
|
||||
;; Last Update: March 20, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>databasefns.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (DUMPDB FILE) & (LOADDB FILE)
|
||||
;;
|
||||
;; Function Description: DATABASEFNS is a very small package whose purpose is to make
|
||||
;; the construction and maintenance of masterscope data bases an essentially automatic
|
||||
;; process. It modifies MAKEFILE, LOAD, and LOADFROM to update database for masterscope.
|
||||
;; For more info, refer to Lisp Library Modules Manual, Lyric beta release.
|
||||
;; The user can dump and restore data bases explicitly via the following functions:
|
||||
;; (DUMPDB file) - Dumps a data base for FILE then sets the DATABASE property to YES,
|
||||
;; so that data base maintenance for FILE will subsequently be automatic.
|
||||
;; (LOADDB file) - Loads the file FILE.DATABASE if one exists. After the data base is
|
||||
;; loaded, the DATABASE property for FILE is set to YES, so that maintenance will be
|
||||
;; thereafter automatic.
|
||||
;;
|
||||
;; Argument(s): (SEE Databasefns documentation)
|
||||
;;
|
||||
;; Returns: (SEE Databasefns documentation)
|
||||
;;
|
||||
;; Constraints/Limitations: The primary emphasis of this testing is the explicit
|
||||
;; dumpting and restoration of data bases. Instructions will be given in the prompt
|
||||
;; window for the user action to be taken during testing and appropriate messages
|
||||
;; will be displayed to explain each test process. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>databasefns.report. This test requires
|
||||
;; DATABASEFNS, TEDIT, and MASTERSCOPE.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
(DO-TEST "DATABASEFNS-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ TEST-START (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>DATABASEFNS.REPORT")
|
||||
(DEFUN T-FORMAT (TIME)
|
||||
(FORMAT *OUTPUT* "~2%TOTAL TEST RUN TIME FOR DATABASEFNS: ~F MINUTES ~%"
|
||||
TIME))
|
||||
|
||||
(DEFUN ITEM-FORMAT-S (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: DATABASEFNS TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'SUCCESS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-F (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: DATABASEFNS TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'FAIL (IL:DATE) IL:USERNAME))
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IF (NOT TEST-ITEM) (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
))
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ DATABASEFNSW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
; Loading databasefns and other required files from {erinyes}<lyric>library>....
|
||||
(PAUSE)
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(IL:FILESLOAD (IL:SYSLOAD) TEDIT MASTERSCOPE DATABASEFNS)
|
||||
|
||||
; Copy the necessary source file (data) to {core}
|
||||
(IL:COPYFILE '{ERIS}<TEST>ENV>PROGRAM-ANALYSIS>HAND>DATABASEFNS.DATA
|
||||
'{CORE}NEW-FUNCTION)
|
||||
(IL:CNDIR '{CORE})
|
||||
(PAUSE)
|
||||
; This tests to see if the global variable LOADDBFLG and SAVEDBFLG are initially
|
||||
; set to ASK
|
||||
(IF (AND (EQ IL:LOADDBFLG 'IL:ASK) (EQ IL:SAVEDBFLG 'IL:ASK))
|
||||
(SETQ DB-VARIABLES-FLG T)
|
||||
(SETQ DB-VARIABLES-FLG NIL))
|
||||
|
||||
|
||||
|
||||
; This part of the test loads the initial data file for masterscope analysis
|
||||
(IL:PROMPTPRINT "Please enter Y when masterscope asks for loading")
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(LOAD '{CORE}NEW-FUNCTION)
|
||||
(IL:MASTERSCOPE '(ANALYZE FUNCTIONS ON {CORE}NEW-FUNCTION))
|
||||
(IL:MASTERSCOPE '(WHO IS CALLED BY IL:NEW-FUNCTION))
|
||||
|
||||
(SETQ OLD-CALL-LIST *)
|
||||
(IL:CLRPROMPT)
|
||||
|
||||
; New-function is redefined; it also utilized times function ...
|
||||
(IL:DEFINEQ (IL:NEW-FUNCTION (X Y) (IL:PLUS (IL:PLUS X Y) (IL:TIMES X Y))))
|
||||
(IL:MASTERSCOPE '(WHO IS CALLED BY IL:NEW-FUNCTION))
|
||||
|
||||
(SETQ NEW-CALL-LIST *)
|
||||
(IF (EQUAL (SET-DIFFERENCE NEW-CALL-LIST OLD-CALL-LIST) '(IL:TIMES))
|
||||
(SETQ DB-UPDATE-FLG T)
|
||||
(SETQ DB-UPDATE-FLG NIL))
|
||||
(IL:DUMPDB '{CORE}NEW-FUNCTION)
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NO)
|
||||
(IF (PROBE-FILE '{CORE}NEW-FUNCTION.DATABASE)
|
||||
(SETQ DB-CREATED-FLG T)
|
||||
(SETQ DB-CREATED-FLG NIL))
|
||||
(IL:REMPROP 'IL:NEW-FUNCTION 'IL:DATABASE)
|
||||
(IL:LOADDB '{CORE}NEW-FUNCTION)
|
||||
(IF (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(SETQ DB-FLG-RESET T)
|
||||
(SETQ DB-FLG-RESET NIL))
|
||||
|
||||
; Loading the database file will reset the property database with 'YES values
|
||||
; and make masterscope database maintenance automatic..
|
||||
; Cleanup will do recompilation and generate the updated database
|
||||
(PAUSE)
|
||||
(IL:PROMPTPRINT "enter n it the system asks you to save any variables:
|
||||
enter y if the system asks you if you want a masterscope database")
|
||||
(IL:CLEANUP)
|
||||
|
||||
; Now new souce and compiles files and corresponding database should have been
|
||||
; created
|
||||
(IF (AND (PROBE-FILE '{CORE}NEW-FUNCTION)
|
||||
(PROBE-FILE '{CORE}NEW-FUNCTION.DFASL)
|
||||
(PROBE-FILE '{CORE}NEW-FUNCTION.DATABASE))
|
||||
(SETQ DB-CREATED-MAKEFILE T)
|
||||
(SETQ DB-CREATED-MAKEFILE NIL))
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NO)
|
||||
|
||||
; Displaying the database that has been created in a tedit window...
|
||||
(IL:PROMPTPRINT "Displaying the database in a tedit window...")
|
||||
(PAUSE)
|
||||
(SETQ DATA-WINDOW (IL:CREATEW '(750 50 400 500) 'DATABASE-WINDOW))
|
||||
(SETQ DATA-STREAM (IL:OPENTEXTSTREAM '{CORE}NEW-FUNCTION.DATABASE
|
||||
DATA-WINDOW ))
|
||||
(SLEEP 4)
|
||||
(CLOSE DATA-STREAM)
|
||||
(IL:CLOSEW DATA-WINDOW)
|
||||
|
||||
; Erasing masterscope record for NEW-FUNCTION....
|
||||
(IL:MASTERSCOPE '(ERASE IL:NEW-FUNCTION))
|
||||
(IL:PROMPTPRINT ". who calls who should now return nil")
|
||||
(PAUSE)
|
||||
(IL:MASTERSCOPE '(WHO IS CALLED BY IL:NEW-FUNCTION))
|
||||
|
||||
; Setting the variable LOADDBFLG to NO will not load the database file...
|
||||
(IL:REMPROP 'IL:NEW-FUNCTION 'IL:DATABASE)
|
||||
(SETQ IL:LOADDBFLG 'IL:NO)
|
||||
(IL:LOAD '{CORE}NEW-FUNCTION)
|
||||
(IF (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NONE)
|
||||
(SETQ DB-NOT-LOADED T) (SETQ DB-NOT-LOADED NIL))
|
||||
|
||||
; Setting the variable LOADDBFLG to YES will load the database file...
|
||||
(SETQ IL:LOADDBFLG 'IL:YES)
|
||||
(IL:LOAD '{CORE}NEW-FUNCTION)
|
||||
(IF (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(SETQ DB-LOADED T) (SETQ DB-LOADED NIL))
|
||||
|
||||
|
||||
; Now delete all the files except for the original file for new-function
|
||||
(MAPCAR #'DELETE-FILE (IL:DIRECTORY '{CORE}))
|
||||
|
||||
(IL:CNDIR '{DSK})
|
||||
(IL:CLRPROMPT)
|
||||
(SETQ IL:LOADDBFLG 'IL:ASK)
|
||||
(SETQ TEST-END (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TOTAL-TEST-TIME (FLOAT (/ (- TEST-END TEST-START) 60000)))
|
||||
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
(DO-TEST 'DATABASEFNS-TEST-RESULT
|
||||
(PROGN
|
||||
(PASS-FAIL 'DABASEFNS-VARIABLES DB-VARIABLES-FLG)
|
||||
(PASS-FAIL 'DATABASE-UPDATE DB-UPDATE-FLG)
|
||||
(PASS-FAIL 'DATABASE-CREATED DB-CREATED-FLG)
|
||||
(PASS-FAIL 'DATABASE-PROP-RESET DB-FLG-RESET)
|
||||
(PASS-FAIL 'DATABASE-CREATED-BY-MAKEFILE DB-CREATED-MAKEFILE)
|
||||
(PASS-FAIL 'LOADDB-FLG-NO DB-NOT-LOADED)
|
||||
(PASS-FAIL 'LOADDB-FLG-YES DB-LOADED)
|
||||
(T-FORMAT TOTAL-TEST-TIME)
|
||||
(IDENTITY T)
|
||||
)
|
||||
)
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
;; Function To Be Tested: DATABASEFNS (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 18, 1987
|
||||
;;
|
||||
;; Last Update: March 20, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>databasefns.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (DUMPDB FILE) & (LOADDB FILE)
|
||||
;;
|
||||
;; Function Description: DATABASEFNS is a very small package whose purpose is to make
|
||||
;; the construction and maintenance of masterscope data bases an essentially automatic
|
||||
;; process. It modifies MAKEFILE, LOAD, and LOADFROM to update database for masterscope.
|
||||
;; For more info, refer to Lisp Library Modules Manual, Lyric beta release.
|
||||
;; The user can dump and restore data bases explicitly via the following functions:
|
||||
;; (DUMPDB file) - Dumps a data base for FILE then sets the DATABASE property to YES,
|
||||
;; so that data base maintenance for FILE will subsequently be automatic.
|
||||
;; (LOADDB file) - Loads the file FILE.DATABASE if one exists. After the data base is
|
||||
;; loaded, the DATABASE property for FILE is set to YES, so that maintenance will be
|
||||
;; thereafter automatic.
|
||||
;;
|
||||
;; Argument(s): (SEE Databasefns documentation)
|
||||
;;
|
||||
;; Returns: (SEE Databasefns documentation)
|
||||
;;
|
||||
;; Constraints/Limitations: The primary emphasis of this testing is the explicit
|
||||
;; dumpting and restoration of data bases. Instructions will be given in the prompt
|
||||
;; window for the user action to be taken during testing and appropriate messages
|
||||
;; will be displayed to explain each test process. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>databasefns.report. This test requires
|
||||
;; DATABASEFNS, TEDIT, and MASTERSCOPE.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
(DO-TEST "DATABASEFNS-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ TEST-START (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>DATABASEFNS.REPORT")
|
||||
(DEFUN T-FORMAT (TIME)
|
||||
(FORMAT *OUTPUT* "~2%TOTAL TEST RUN TIME FOR DATABASEFNS: ~F MINUTES ~%"
|
||||
TIME))
|
||||
|
||||
(DEFUN ITEM-FORMAT-S (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: DATABASEFNS TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'SUCCESS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-F (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: DATABASEFNS TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'FAIL (IL:DATE) IL:USERNAME))
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IF (NOT TEST-ITEM) (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
))
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ DATABASEFNSW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
; Loading databasefns and other required files from {erinyes}<lyric>library>....
|
||||
(PAUSE)
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(IL:FILESLOAD (IL:SYSLOAD) TEDIT MASTERSCOPE DATABASEFNS)
|
||||
|
||||
; Copy the necessary source file (data) to {core}
|
||||
(IL:COPYFILE '{ERIS}<TEST>ENV>PROGRAM-ANALYSIS>HAND>DATABASEFNS.DATA
|
||||
'{CORE}NEW-FUNCTION)
|
||||
(IL:CNDIR '{CORE})
|
||||
(PAUSE)
|
||||
; This tests to see if the global variable LOADDBFLG and SAVEDBFLG are initially
|
||||
; set to ASK
|
||||
(IF (AND (EQ IL:LOADDBFLG 'IL:ASK) (EQ IL:SAVEDBFLG 'IL:ASK))
|
||||
(SETQ DB-VARIABLES-FLG T)
|
||||
(SETQ DB-VARIABLES-FLG NIL))
|
||||
|
||||
|
||||
|
||||
; This part of the test loads the initial data file for masterscope analysis
|
||||
(IL:PROMPTPRINT "Please enter Y when masterscope asks for loading")
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(LOAD '{CORE}NEW-FUNCTION)
|
||||
(IL:MASTERSCOPE '(ANALYZE FUNCTIONS ON {CORE}NEW-FUNCTION))
|
||||
(SETQ OLD-CALL-LIST (IL:MASTERSCOPE '(WHO IS CALLED BY IL:NEW-FUNCTION)))
|
||||
|
||||
(IL:CLRPROMPT)
|
||||
|
||||
; New-function is redefined; it also utilized times function ...
|
||||
(IL:DEFINEQ (IL:NEW-FUNCTION (X Y) (IL:PLUS (IL:PLUS X Y) (IL:TIMES X Y))))
|
||||
(SETQ NEW-CALL-LIST (IL:MASTERSCOPE '(WHO IS CALLED BY IL:NEW-FUNCTION)))
|
||||
|
||||
(IF (EQUAL (SET-DIFFERENCE NEW-CALL-LIST OLD-CALL-LIST) '(IL:TIMES))
|
||||
(SETQ DB-UPDATE-FLG T)
|
||||
(SETQ DB-UPDATE-FLG NIL))
|
||||
(IL:DUMPDB '{CORE}NEW-FUNCTION)
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NO)
|
||||
(IF (PROBE-FILE '{CORE}NEW-FUNCTION.DATABASE)
|
||||
(SETQ DB-CREATED-FLG T)
|
||||
(SETQ DB-CREATED-FLG NIL))
|
||||
(IL:REMPROP 'IL:NEW-FUNCTION 'IL:DATABASE)
|
||||
(IL:LOADDB '{CORE}NEW-FUNCTION)
|
||||
(IF (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(SETQ DB-FLG-RESET T)
|
||||
(SETQ DB-FLG-RESET NIL))
|
||||
|
||||
; Loading the database file will reset the property database with 'YES values
|
||||
; and make masterscope database maintenance automatic..
|
||||
; Cleanup will do recompilation and generate the updated database
|
||||
(PAUSE)
|
||||
(IL:PROMPTPRINT "enter n it the system asks you to save any variables:
|
||||
enter y if the system asks you if you want a masterscope database")
|
||||
(IL:CLEANUP)
|
||||
|
||||
; Now new souce and compiles files and corresponding database should have been
|
||||
; created
|
||||
(IF (AND (PROBE-FILE '{CORE}NEW-FUNCTION)
|
||||
(PROBE-FILE '{CORE}NEW-FUNCTION.DFASL)
|
||||
(PROBE-FILE '{CORE}NEW-FUNCTION.DATABASE))
|
||||
(SETQ DB-CREATED-MAKEFILE T)
|
||||
(SETQ DB-CREATED-MAKEFILE NIL))
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NO)
|
||||
|
||||
; Displaying the database that has been created in a tedit window...
|
||||
(IL:PROMPTPRINT "Displaying the database in a tedit window...")
|
||||
(PAUSE)
|
||||
(SETQ DATA-WINDOW (IL:CREATEW '(750 50 400 500) 'DATABASE-WINDOW))
|
||||
(SETQ DATA-STREAM (IL:OPENTEXTSTREAM '{CORE}NEW-FUNCTION.DATABASE
|
||||
DATA-WINDOW ))
|
||||
(SLEEP 4)
|
||||
(CLOSE DATA-STREAM)
|
||||
(IL:CLOSEW DATA-WINDOW)
|
||||
|
||||
; Erasing masterscope record for NEW-FUNCTION....
|
||||
(IL:MASTERSCOPE '(ERASE IL:NEW-FUNCTION))
|
||||
(IL:PROMPTPRINT ". who calls who should now return nil")
|
||||
(PAUSE)
|
||||
(IL:MASTERSCOPE '(WHO IS CALLED BY IL:NEW-FUNCTION))
|
||||
|
||||
; Setting the variable LOADDBFLG to NO will not load the database file...
|
||||
(IL:REMPROP 'IL:NEW-FUNCTION 'IL:DATABASE)
|
||||
(SETQ IL:LOADDBFLG 'IL:NO)
|
||||
(IL:LOAD '{CORE}NEW-FUNCTION)
|
||||
(IF (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NONE)
|
||||
(SETQ DB-NOT-LOADED T) (SETQ DB-NOT-LOADED NIL))
|
||||
|
||||
; Setting the variable LOADDBFLG to YES will load the database file...
|
||||
(SETQ IL:LOADDBFLG 'IL:YES)
|
||||
(IL:LOAD '{CORE}NEW-FUNCTION)
|
||||
(IF (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(SETQ DB-LOADED T) (SETQ DB-LOADED NIL))
|
||||
|
||||
|
||||
; Now delete all the files except for the original file for new-function
|
||||
(MAPCAR #'DELETE-FILE (IL:DIRECTORY '{CORE}))
|
||||
|
||||
(IL:CNDIR '{DSK})
|
||||
(IL:CLRPROMPT)
|
||||
(SETQ IL:LOADDBFLG 'IL:ASK)
|
||||
(SETQ TEST-END (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TOTAL-TEST-TIME (FLOAT (/ (- TEST-END TEST-START) 60000)))
|
||||
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
(DO-TEST 'DATABASEFNS-TEST-RESULT
|
||||
(PROGN
|
||||
(PASS-FAIL 'DABASEFNS-VARIABLES DB-VARIABLES-FLG)
|
||||
(PASS-FAIL 'DATABASE-UPDATE DB-UPDATE-FLG)
|
||||
(PASS-FAIL 'DATABASE-CREATED DB-CREATED-FLG)
|
||||
(PASS-FAIL 'DATABASE-PROP-RESET DB-FLG-RESET)
|
||||
(PASS-FAIL 'DATABASE-CREATED-BY-MAKEFILE DB-CREATED-MAKEFILE)
|
||||
(PASS-FAIL 'LOADDB-FLG-NO DB-NOT-LOADED)
|
||||
(PASS-FAIL 'LOADDB-FLG-YES DB-LOADED)
|
||||
(T-FORMAT TOTAL-TEST-TIME)
|
||||
(IDENTITY T)
|
||||
)
|
||||
)
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
;; Function To Be Tested: DATABASEFNS (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 18, 1987
|
||||
;;
|
||||
;; Last Update: March 20, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>databasefns.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (DUMPDB FILE) & (LOADDB FILE)
|
||||
;;
|
||||
;; Function Description: DATABASEFNS is a very small package whose purpose is to make
|
||||
;; the construction and maintenance of masterscope data bases an essentially automatic
|
||||
;; process. It modifies MAKEFILE, LOAD, and LOADFROM to update database for masterscope.
|
||||
;; For more info, refer to Lisp Library Modules Manual, Lyric beta release.
|
||||
;; The user can dump and restore data bases explicitly via the following functions:
|
||||
;; (DUMPDB file) - Dumps a data base for FILE then sets the DATABASE property to YES,
|
||||
;; so that data base maintenance for FILE will subsequently be automatic.
|
||||
;; (LOADDB file) - Loads the file FILE.DATABASE if one exists. After the data base is
|
||||
;; loaded, the DATABASE property for FILE is set to YES, so that maintenance will be
|
||||
;; thereafter automatic.
|
||||
;;
|
||||
;; Argument(s): (SEE Databasefns documentation)
|
||||
;;
|
||||
;; Returns: (SEE Databasefns documentation)
|
||||
;;
|
||||
;; Constraints/Limitations: The primary emphasis of this testing is the explicit
|
||||
;; dumpting and restoration of data bases. Instructions will be given in the prompt
|
||||
;; window for the user action to be taken during testing and appropriate messages
|
||||
;; will be displayed to explain each test process. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>databasefns.report. This test requires
|
||||
;; DATABASEFNS, TEDIT, and MASTERSCOPE.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
(DO-TEST "DATABASEFNS-TEST-SETUP"
|
||||
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL)
|
||||
IL:ELSE "Good one!"
|
||||
))
|
||||
|
||||
(SETQ DATABASEFNSW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
; Loading databasefns and other required files from {erinyes}<lyric>library>....
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(IL:FILESLOAD (IL:SYSLOAD) TEDIT MASTERSCOPE DATABASEFNS)
|
||||
|
||||
; Copy the necessary source file (data) to {core}
|
||||
(IL:COPYFILE '{ERIS}<TEST>ENV>PROGRAM-ANALYSIS>HAND>DATABASEFNS.DATA
|
||||
'{CORE}NEW-FUNCTION)
|
||||
(IL:CNDIR '{CORE})
|
||||
; This tests to see if the global variable LOADDBFLG and SAVEDBFLG are initially
|
||||
; set to ASK
|
||||
(PASS-FAIL "DATABASEFNS VARIABLES" (AND (EQ IL:LOADDBFLG 'IL:ASK) (EQ IL:SAVEDBFLG 'IL:ASK)))
|
||||
|
||||
|
||||
; This part of the test loads the initial data file for masterscope analysis
|
||||
(IL:PROMPTPRINT "Please enter Y when masterscope asks for loading")
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES)
|
||||
(LOAD '{CORE}NEW-FUNCTION)
|
||||
(IL:MASTERSCOPE '(ANALYZE FUNCTIONS ON {CORE}NEW-FUNCTION))
|
||||
(SETQ OLD-CALL-LIST (IL:MASTERSCOPE '(WHO IS CALLED BY IL:NEW-FUNCTION)))
|
||||
|
||||
(IL:CLRPROMPT)
|
||||
|
||||
; New-function is redefined; it also utilized times function ...
|
||||
(IL:DEFINEQ (IL:NEW-FUNCTION (X Y) (IL:PLUS (IL:PLUS X Y) (IL:TIMES X Y))))
|
||||
(SETQ NEW-CALL-LIST (IL:MASTERSCOPE '(WHO IS CALLED BY IL:NEW-FUNCTION)))
|
||||
|
||||
(PASS-FAIL "DATABASE UPDATE" (EQUAL (SET-DIFFERENCE NEW-CALL-LIST OLD-CALL-LIST) '(IL:TIMES)))
|
||||
|
||||
(IL:DUMPDB '{CORE}NEW-FUNCTION)
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NO)
|
||||
(PASS-FAIL "DATABASE CREATED" (PROBE-FILE '{CORE}NEW-FUNCTION.DATABASE))
|
||||
|
||||
(IL:REMPROP 'IL:NEW-FUNCTION 'IL:DATABASE)
|
||||
(IL:LOADDB '{CORE}NEW-FUNCTION)
|
||||
(PASS-FAIL "DATABASE PROP RESET" (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES))
|
||||
|
||||
; Loading the database file will reset the property database with 'YES values
|
||||
; and make masterscope database maintenance automatic..
|
||||
(IL:PROMPTPRINT "enter n it the system asks you to save any variables:
|
||||
enter y if the system asks you if you want a masterscope database")
|
||||
(IL:CLEANUP)
|
||||
|
||||
; Now new souce and compiles files and corresponding database should have been
|
||||
; created
|
||||
(PASS-FAIL "DATABASE CREATED BY MAKEFILE" (AND (PROBE-FILE '{CORE}NEW-FUNCTION)
|
||||
(PROBE-FILE '{CORE}NEW-FUNCTION.DFASL)
|
||||
(PROBE-FILE '{CORE}NEW-FUNCTION.DATABASE)))
|
||||
(SETF (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NO)
|
||||
|
||||
; Displaying the database that has been created in a tedit window...
|
||||
(IL:PROMPTPRINT "Displaying the database in a tedit window...")
|
||||
(SETQ DATA-WINDOW (IL:CREATEW '(750 50 400 500) 'DATABASE-WINDOW))
|
||||
(SETQ DATA-STREAM (IL:OPENTEXTSTREAM '{CORE}NEW-FUNCTION.DATABASE
|
||||
DATA-WINDOW ))
|
||||
(SLEEP 4)
|
||||
(CLOSE DATA-STREAM)
|
||||
(IL:CLOSEW DATA-WINDOW)
|
||||
|
||||
; Erasing masterscope record for NEW-FUNCTION....
|
||||
(IL:MASTERSCOPE '(ERASE IL:NEW-FUNCTION))
|
||||
(IL:PROMPTPRINT ". who calls who should now return nil")
|
||||
(IL:MASTERSCOPE '(WHO IS CALLED BY IL:NEW-FUNCTION))
|
||||
|
||||
; Setting the variable LOADDBFLG to NO will not load the database file...
|
||||
(IL:REMPROP 'IL:NEW-FUNCTION 'IL:DATABASE)
|
||||
(SETQ IL:LOADDBFLG 'IL:NO)
|
||||
(IL:LOAD '{CORE}NEW-FUNCTION)
|
||||
(PASS-FAIL "LOADDBFLG SET TO NO" (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:NONE) )
|
||||
|
||||
; Setting the variable LOADDBFLG to YES will load the database file...
|
||||
(SETQ IL:LOADDBFLG 'IL:YES)
|
||||
(IL:LOAD '{CORE}NEW-FUNCTION)
|
||||
(PASS-FAIL "LOADDBFLG SET TO YES" (EQ (GET 'IL:NEW-FUNCTION 'IL:DATABASE) 'IL:YES))
|
||||
|
||||
|
||||
; Now delete all the files except for the original file for new-function
|
||||
(MAPCAR #'DELETE-FILE (IL:DIRECTORY '{CORE}))
|
||||
|
||||
(IL:CNDIR '{DSK})
|
||||
(IL:CLRPROMPT)
|
||||
(SETQ IL:LOADDBFLG 'IL:ASK)
|
||||
|
||||
TEST-SUCCEEDED
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,265 +0,0 @@
|
||||
;; Function To Be Tested: INSPECTOR (Program Analysis)
|
||||
;;
|
||||
;; Source: IRM VOLUME 3 (Lyric Beta Release 2)
|
||||
;; Section 26. User Input/Output Packages
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 21, 1987
|
||||
;;
|
||||
;; Last Update: March 30, 1987
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>inspector.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (INSPECT OBJECT ASTYPE WHERE) - primary inspector function
|
||||
;;
|
||||
;; Function Description: The inspector provides a display-oriented and window-based
|
||||
;; facility for looking at and changing arbitrary Interlisp-D data structures.
|
||||
;; The inspector can be used to inspect all ser datatypes and many sysem datatypes.
|
||||
;; The inspector displays the field names and values of an arbitrary object in
|
||||
;; a window that allows setting of the properties and further inpection of the values.
|
||||
;; This latter feature makes it possible to "walk" around all of the data structures
|
||||
;; in the system at the touch of a buttton. For more information, refer to IRM, vol 2
|
||||
;; pages 26.1 through 26.9
|
||||
;;
|
||||
;; Argument(s): The primary function for inspector is INSPECT whose arguments are
|
||||
;; described here.
|
||||
;; OBJECT: object to be inspected
|
||||
;; ASTYPE: Record type of OBJECT. If ASTYPE is NIL, the data type of OJECT will be
|
||||
;; used to determine its property names in the inspect window.
|
||||
;; WHERE: speccifies the location of the inspect window. If NIL, the user will be
|
||||
;; prompted for location
|
||||
;;
|
||||
;; Returns: Inspection Window
|
||||
;;
|
||||
;; Constraints/Limitations: The primary emphasis of this testing will be focused
|
||||
;; on the function INSPECT. Instructions will be given in the prompt
|
||||
;; window for the user action to be taken during testing and appropriate messages
|
||||
;; will be displayed to explain each test process. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>inspect.report. This test requires
|
||||
;; TEDIT package.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
(DO-TEST "INSPECTOR-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ TEST-START (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>INSPECT.REPORT")
|
||||
(DEFUN T-FORMAT (TIME)
|
||||
(FORMAT *OUTPUT* "~2%TOTAL TEST RUN TIME FOR INSPECTOR: ~F MINUTES ~%"
|
||||
TIME))
|
||||
|
||||
(DEFUN ITEM-FORMAT-S (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: INSPECTOR TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'SUCCESS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-F (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: INSPECTOR TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'FAIL (IL:DATE) IL:USERNAME))
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IF (EQ TEST-ITEM T) (ITEM-FORMAT-S COMMAND-LANGUAGE)
|
||||
(ITEM-FORMAT-F COMMAND-LANGUAGE)))
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ INSPECTORW (IL:CREATEW '(100 100 325 90) "TEST WINDOW FOR INSPECTION" NIL T))
|
||||
(SETQ INSPECTOR "INSPECTOR")
|
||||
(SETQ INSPECTCODE-TITLE "CODE FOR COS")
|
||||
; Creating various objects to be inspected....
|
||||
(PAUSE)
|
||||
(SETQ INSPECT-ITEM-LIST
|
||||
(LIST (make-array '(3 3) :displaced-to (make-array '(4 3))) ; array
|
||||
(gentemp) ; atom
|
||||
(1- most-negative-fixnum) ; bignum
|
||||
0 ; bit
|
||||
'#*1001 ; bit-vector
|
||||
#\backspace ; character
|
||||
'common ; common
|
||||
#'cons ; compiled-function
|
||||
#c( 6/7 3.00) ; complex
|
||||
'( a b c . d) ; cons
|
||||
5.00 ; double-float
|
||||
(random most-positive-fixnum) ; fixnum
|
||||
(coerce most-negative-fixnum 'float) ; float
|
||||
#'(lambda nil nil) ; function
|
||||
(setq hash
|
||||
(make-hash-table 7)) ; hash-table
|
||||
4761 ; integer
|
||||
:mot-de-clef ; keyword
|
||||
'(a b c d) ; list
|
||||
37e5 ; long-float
|
||||
(= 1 2) ; null
|
||||
3.1415926535897932384d0 ; number
|
||||
(car(list-all-packages)) ; package
|
||||
(pathname) ; pathname
|
||||
;*random-state* ; random state - inspecting this hangs
|
||||
27/60 ; ratio
|
||||
5 ; rational
|
||||
(copy-readtable) ; readtable
|
||||
'(A 'B "C") ; sequence
|
||||
;; Breaks; see AR 6494
|
||||
(coerce 6 'short-float) ; short-float
|
||||
(make-array '(2 2)) ; simple-array
|
||||
'#*1001 ; simple-bit-vector
|
||||
"twine" ; simple-string
|
||||
(make-array 50 :initial-element 0) ; simple-vector
|
||||
.001 ; single-float
|
||||
#\* ; standard-char
|
||||
(make-synonym-stream) ; stream
|
||||
(make-array 20 :element-type 'string-char :initial-element #\0) ; string
|
||||
#\. ; string-char
|
||||
(gentemp) ; symbol
|
||||
(not (equal 2 3)) ; t
|
||||
'#( 5 4 3 2 1) ; vector
|
||||
IL:promptwindow ; window
|
||||
))
|
||||
(SETF (GETHASH 'COLOR HASH) 'BROWN
|
||||
(GETHASH 'NAME HASH) 'FRED
|
||||
(GETHASH 'AGE HASH) 29
|
||||
(GETHASH 'PHONE HASH) '777-6551
|
||||
(GETHASH 'HEIGHT HASH) '6-FEET
|
||||
(GETHASH 'WEIGHT HASH) '170)
|
||||
(SETQ SPACE ": ")
|
||||
(SETQ MESS0 "In this part of test, various lisp objects will be inspected.
|
||||
Numbers except for complex and fraction types, and characters
|
||||
are not inspectable and an appropriate message will be printed.
|
||||
If a inspect menu pops up, select the item INSPECT
|
||||
To create an inspector window, simply click the left mouse button
|
||||
Please respond with y or n after an inspector window is created. ")
|
||||
(SETQ MESS1 "Is an inspector window created for ~A? ~%or a message displayed if ~A is not inspectable?")
|
||||
(SETQ MESS2 "Please indicate a position for inspecting
|
||||
the compiled function COS with left mouse button")
|
||||
(SETQ MESS3 "Is the inspector window displayed for
|
||||
the compiled function COS (Yes or NO?)")
|
||||
(SETQ MESS4 "Is the inspection information displayed
|
||||
in the specified inspector window?")
|
||||
(SETQ MESS5 "The inspector window should have been created
|
||||
for inspecting the compiled function COS")
|
||||
(SETQ MESS6 "Inspecting *random-state* never returns (AR 8203)
|
||||
Please run this test after this test is completed by entering
|
||||
(INSPECT *RANDOM-STATE*) and return Cont-E if it never returns.
|
||||
If it still fails the test, please update the log file accordingly:
|
||||
{eris}<lispcore>test>program-analysis>inspect.report.")
|
||||
(SETQ MESS7 "Are you ready to start testing(y or n)? ")
|
||||
(SETQ PROMPT-MESS "Item being inspected: ")
|
||||
(SETQ PROMPT-MESS1 "Item just inspected: ~A: ~A~2%")
|
||||
|
||||
; Inspector test string...
|
||||
(SETQ INSPECTOR-COMMAND-STRING
|
||||
"; Load TEDIT if not already loaded....
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(IL:LOAD? '{ERINYES}<LYRIC>LIBRARY>TEDIT.LCOM 'IL:SYSLOAD)
|
||||
|
||||
; Check the intial value of inspector variables...
|
||||
(IF (AND (= IL:MAXINSPECTCDRLEVEL 50)
|
||||
(= IL:MAXINSPECTARRAYLEVEL 300)
|
||||
(EQUAL IL:INSPECTPRINTLEVEL '(2 . 5))
|
||||
(EQ IL:INSPECTALLFIELDSFLG T))
|
||||
(SETQ VARIABLES-SET-CORRECT T)
|
||||
(SETQ VARIABLES-SET-CORRECT NIL))
|
||||
|
||||
; Create various objects to be inspected...
|
||||
; Trying to inspect random state object will hang the system (never returns)
|
||||
; A number or character cannot be inspected and an appropriate message should be
|
||||
; generated for these objects...
|
||||
(SETQ INSPECT-ITEM-NAMES
|
||||
'(ARRAY ATOM BIGNUM BIT BIT-VECTOR CHARACTER
|
||||
COMMON COMPILED-FUNCTION COMPLEX CONS
|
||||
DOUBLE-FLOAT FIXNUM FLOAT FUNCTION
|
||||
HASH-TABLE INTEGER KEYWORD LIST LONG-FLOAT
|
||||
NULL NUMBER PACKAGE PATHNAME
|
||||
RATIO RATIONAL READTABLE SEQUENCE
|
||||
SHORT-FLOAT SIMPLE-ARRAY SIMPLE-BIT-VECTOR
|
||||
SIMPLE-STRING SIMPLE-VECTOR SINGLE-FLOAT
|
||||
STANDARD-CHAR STREAM STRING STRING-CHAR
|
||||
SYMBOL T VECTOR WINDOW) ITEM-NAMES INSPECT-ITEM-NAMES))
|
||||
|
||||
(IL:PROMPTPRINT MESS0)
|
||||
(PAUSE)
|
||||
(IL:ASKUSER 15 'IL:Y MESS7)
|
||||
(SETQ INSPECT-WINDOWS NIL)
|
||||
(IL:FOR ITEM IL:IN INSPECT-ITEM-LIST IL:DO
|
||||
(PROGN (SETQ POP-ITEM (POP INSPECT-ITEM-NAMES))
|
||||
(SETQ ITEM-VALUE (POP INSPECT-ITEM-LIST))
|
||||
(IL:PROMPTPRINT PROMPT-MESS POP-ITEM SPACE ITEM-VALUE)
|
||||
(PAUSE)
|
||||
(INSPECT ITEM)
|
||||
(FORMAT T PROMPT-MESS1 POP-ITEM ITEM-VALUE)
|
||||
(IF (EQ 'IL:Y (IL:ASKUSER IL:DWIMWAIT 'IL:Y
|
||||
(FORMAT T MESS1 POP-ITEM POP-ITEM)))
|
||||
(IL:SET (PACK* POP-ITEM '-INSPECTED-FLG) T)
|
||||
(IL:SET (PACK* POP-ITEM '-INSPECTED-FLG) NIL))
|
||||
(IL:CLEARW)
|
||||
(SLEEP 1)))
|
||||
|
||||
|
||||
; Inspecting the compiled code of the function...
|
||||
(PAUSE)
|
||||
(IL:PROMPTPRINT MESS5)
|
||||
(IL:INSPECTCODE 'COS)
|
||||
(IF (EQ 'IL:Y (IL:ASKUSER IL:DWIMWAIT 'IL:Y MESS3))
|
||||
(SETQ INSPECTCODE-FLG T)
|
||||
(SETQ INSPECTCODE-FLG NIL))
|
||||
|
||||
(SLEEP 2)
|
||||
; Closing the inspector window...
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE) INSPECTCODE-TITLE))
|
||||
|
||||
; Testing to see if an object could be displayed in a specified window...
|
||||
(PAUSE)
|
||||
(SETQ INSPECT-ARRAY (MAKE-ARRAY '(2 2) :INITIAL-CONTENTS '((1 2) (3 4))))
|
||||
(IL:OPENW INSPECTORW)
|
||||
(INSPECT INSPECT-ARRAY NIL INSPECTORW)
|
||||
(IF (EQ 'IL:Y (IL:ASKUSER IL:DWIMWAIT 'IL:Y MESS4))
|
||||
(SETQ INSPECT-WHERE-FLG T)
|
||||
(SETQ INSPECT-WHERE-FLG NIL))
|
||||
|
||||
; Delete all inspect windows that have been created...
|
||||
(PAUSE)
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN
|
||||
(AND (NOT (EQ (IL:WINDOWPROP WINDOW 'IL:TITLE) NIL))
|
||||
(OR (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR :start1 0 :end1 9)
|
||||
(STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR
|
||||
:start1 (- (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE)) 9)
|
||||
:end1 (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE))))
|
||||
)
|
||||
)
|
||||
|
||||
; Test for AR8203
|
||||
(IL:PROMPTPRINT MESS6)
|
||||
(PAUSE)
|
||||
|
||||
(SETQ TEST-END (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TOTAL-TEST-TIME (FLOAT (/ (- TEST-END TEST-START) 60000)))
|
||||
|
||||
(DO-TEST 'INSPECTOR-TEST-RESULT
|
||||
(PROGN (SETQ *OUTPUT* (OPEN TEST-RESULT :DIRECTION :OUTPUT
|
||||
:IF-EXISTS :APPEND))
|
||||
(PASS-FAIL 'INITIAL-VALUES-OF-VARIABLES VARIABLES-SET-CORRECT)
|
||||
(IL:FOR X IL:IN ITEM-NAMES IL:DO
|
||||
(PROGN
|
||||
(SETQ PF-ITEM (POP ITEM-NAMES))
|
||||
(PASS-FAIL X (EVAL (PACK* PF-ITEM '-INSPECTED-FLG)))))
|
||||
(PASS-FAIL 'INSPECTCODE INSPECTCODE-FLG)
|
||||
(PASS-FAIL 'INSPECT-WHERE INSPECT-WHERE-FLG)
|
||||
(T-FORMAT TOTAL-TEST-TIME)
|
||||
(CLOSE *OUTPUT*)
|
||||
(IDENTITY T)
|
||||
)
|
||||
)
|
||||
|
||||
")
|
||||
(IL:BKSYSBUF INSPECTOR-COMMAND-STRING)
|
||||
)
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,263 +0,0 @@
|
||||
;; Function To Be Tested: INSPECTOR (Program Analysis)
|
||||
;;
|
||||
;; Source: IRM VOLUME 3 (Lyric Beta Release 2)
|
||||
;; Section 26. User Input/Output Packages
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 21, 1987
|
||||
;;
|
||||
;; Last Update: March 30, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>inspector.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (INSPECT OBJECT ASTYPE WHERE) - primary inspector function
|
||||
;;
|
||||
;; Function Description: The inspector provides a display-oriented and window-based
|
||||
;; facility for looking at and changing arbitrary Interlisp-D data structures.
|
||||
;; The inspector can be used to inspect all ser datatypes and many sysem datatypes.
|
||||
;; The inspector displays the field names and values of an arbitrary object in
|
||||
;; a window that allows setting of the properties and further inpection of the values.
|
||||
;; This latter feature makes it possible to "walk" around all of the data structures
|
||||
;; in the system at the touch of a buttton. For more information, refer to IRM, vol 2
|
||||
;; pages 26.1 through 26.9
|
||||
;;
|
||||
;; Argument(s): The primary function for inspector is INSPECT whose arguments are
|
||||
;; described here.
|
||||
;; OBJECT: object to be inspected
|
||||
;; ASTYPE: Record type of OBJECT. If ASTYPE is NIL, the data type of OJECT will be
|
||||
;; used to determine its property names in the inspect window.
|
||||
;; WHERE: speccifies the location of the inspect window. If NIL, the user will be
|
||||
;; prompted for location
|
||||
;;
|
||||
;; Returns: Inspection Window
|
||||
;;
|
||||
;; Constraints/Limitations: The primary emphasis of this testing will be focused
|
||||
;; on the function INSPECT. Instructions will be given in the prompt
|
||||
;; window for the user action to be taken during testing and appropriate messages
|
||||
;; will be displayed to explain each test process. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>inspect.report. This test requires
|
||||
;; TEDIT package.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
(DO-TEST "INSPECTOR-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ TEST-START (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>INSPECT.REPORT")
|
||||
(DEFUN T-FORMAT (TIME)
|
||||
(FORMAT *OUTPUT* "~2%TOTAL TEST RUN TIME FOR INSPECTOR: ~F MINUTES ~%"
|
||||
TIME))
|
||||
|
||||
(DEFUN ITEM-FORMAT-S (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: INSPECTOR TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'SUCCESS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-F (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: INSPECTOR TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'FAIL (IL:DATE) IL:USERNAME))
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IF (EQ TEST-ITEM T) (ITEM-FORMAT-S COMMAND-LANGUAGE)
|
||||
(ITEM-FORMAT-F COMMAND-LANGUAGE)))
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ INSPECTORW (IL:CREATEW '(100 100 325 90) "TEST WINDOW FOR INSPECTION" NIL T))
|
||||
(SETQ INSPECTOR "INSPECTOR")
|
||||
(SETQ INSPECTCODE-TITLE "CODE FOR COS")
|
||||
; Creating various objects to be inspected....
|
||||
(PAUSE)
|
||||
(SETQ INSPECT-ITEM-LIST
|
||||
(LIST (make-array '(3 3) :displaced-to (make-array '(4 3))) ; array
|
||||
(gentemp) ; atom
|
||||
(1- most-negative-fixnum) ; bignum
|
||||
0 ; bit
|
||||
'#*1001 ; bit-vector
|
||||
#\backspace ; character
|
||||
'common ; common
|
||||
#'cons ; compiled-function
|
||||
#c( 6/7 3.00) ; complex
|
||||
'( a b c . d) ; cons
|
||||
5.00 ; double-float
|
||||
(random most-positive-fixnum) ; fixnum
|
||||
(coerce most-negative-fixnum 'float) ; float
|
||||
#'(lambda nil nil) ; function
|
||||
(setq hash
|
||||
(make-hash-table 7)) ; hash-table
|
||||
4761 ; integer
|
||||
:mot-de-clef ; keyword
|
||||
'(a b c d) ; list
|
||||
37e5 ; long-float
|
||||
(= 1 2) ; null
|
||||
3.1415926535897932384d0 ; number
|
||||
(car(list-all-packages)) ; package
|
||||
(pathname) ; pathname
|
||||
;*random-state* ; random state - inspecting this hangs
|
||||
27/60 ; ratio
|
||||
5 ; rational
|
||||
(copy-readtable) ; readtable
|
||||
'(A 'B "C") ; sequence
|
||||
;; Breaks; see AR 6494
|
||||
(coerce 6 'short-float) ; short-float
|
||||
(make-array '(2 2)) ; simple-array
|
||||
'#*1001 ; simple-bit-vector
|
||||
"twine" ; simple-string
|
||||
(make-array 50 :initial-element 0) ; simple-vector
|
||||
.001 ; single-float
|
||||
#\* ; standard-char
|
||||
(make-synonym-stream) ; stream
|
||||
(make-array 20 :element-type 'string-char :initial-element #\0) ; string
|
||||
#\. ; string-char
|
||||
(gentemp) ; symbol
|
||||
(not (equal 2 3)) ; t
|
||||
'#( 5 4 3 2 1) ; vector
|
||||
IL:promptwindow ; window
|
||||
))
|
||||
(SETF (GETHASH 'COLOR HASH) 'BROWN
|
||||
(GETHASH 'NAME HASH) 'FRED
|
||||
(GETHASH 'AGE HASH) 29
|
||||
(GETHASH 'PHONE HASH) '777-6551
|
||||
(GETHASH 'HEIGHT HASH) '6-FEET
|
||||
(GETHASH 'WEIGHT HASH) '170)
|
||||
(SETQ SPACE ": ")
|
||||
(SETQ MESS0 "In this part of test, various lisp objects will be inspected.
|
||||
Numbers except for complex and fraction types, and characters
|
||||
are not inspectable and an appropriate message will be printed.
|
||||
If a inspect menu pops up, select the item INSPECT
|
||||
To create an inspector window, simply click the left mouse button
|
||||
Please respond with y or n after an inspector window is created. ")
|
||||
(SETQ MESS1 "Is an inspector window created for ~A? ~%or a message displayed if ~A is not inspectable?")
|
||||
(SETQ MESS2 "Please indicate a position for inspecting
|
||||
the compiled function COS with left mouse button")
|
||||
(SETQ MESS3 "Is the inspector window displayed for
|
||||
the compiled function COS (Yes or NO?)")
|
||||
(SETQ MESS4 "Is the inspection information displayed
|
||||
in the specified inspector window?")
|
||||
(SETQ MESS5 "The inspector window should have been created
|
||||
for inspecting the compiled function COS")
|
||||
(SETQ MESS6 "Inspecting *random-state* never returns (AR 8203)
|
||||
Please run this test after this test is completed by entering
|
||||
(INSPECT *RANDOM-STATE*) and return Cont-E if it never returns.
|
||||
If it still fails the test, please update the log file accordingly:
|
||||
{eris}<lispcore>test>program-analysis>inspect.report.")
|
||||
(SETQ MESS7 "Are you ready to start testing(y or n)? ")
|
||||
(SETQ PROMPT-MESS "Item being inspected: ")
|
||||
(SETQ PROMPT-MESS1 "Item just inspected: ~A: ~A~2%")
|
||||
|
||||
; Load TEDIT if not already loaded....
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(IL:FILESLOAD (IL:SYSLOAD) TEDIT)
|
||||
|
||||
; Check the intial value of inspector variables...
|
||||
(IF (AND (= IL:MAXINSPECTCDRLEVEL 50)
|
||||
(= IL:MAXINSPECTARRAYLEVEL 300)
|
||||
(EQUAL IL:INSPECTPRINTLEVEL '(2 . 5))
|
||||
(EQ IL:INSPECTALLFIELDSFLG T))
|
||||
(SETQ VARIABLES-SET-CORRECT T)
|
||||
(SETQ VARIABLES-SET-CORRECT NIL))
|
||||
|
||||
; Create various objects to be inspected...
|
||||
; Trying to inspect random state object will hang the system (never returns)
|
||||
; A number or character cannot be inspected and an appropriate message should be
|
||||
; generated for these objects...
|
||||
(SETQ INSPECT-ITEM-NAMES
|
||||
'(ARRAY ATOM BIGNUM BIT BIT-VECTOR CHARACTER
|
||||
COMMON COMPILED-FUNCTION COMPLEX CONS
|
||||
DOUBLE-FLOAT FIXNUM FLOAT FUNCTION
|
||||
HASH-TABLE INTEGER KEYWORD LIST LONG-FLOAT
|
||||
NULL NUMBER PACKAGE PATHNAME
|
||||
RATIO RATIONAL READTABLE SEQUENCE
|
||||
SHORT-FLOAT SIMPLE-ARRAY SIMPLE-BIT-VECTOR
|
||||
SIMPLE-STRING SIMPLE-VECTOR SINGLE-FLOAT
|
||||
STANDARD-CHAR STREAM STRING STRING-CHAR
|
||||
SYMBOL T VECTOR WINDOW) ITEM-NAMES INSPECT-ITEM-NAMES))
|
||||
|
||||
(IL:PROMPTPRINT MESS0)
|
||||
(PAUSE)
|
||||
(IL:ASKUSER 15 'IL:Y MESS7)
|
||||
(SETQ INSPECT-WINDOWS NIL)
|
||||
(IL:FOR ITEM IL:IN INSPECT-ITEM-LIST IL:DO
|
||||
(PROGN (SETQ POP-ITEM (POP INSPECT-ITEM-NAMES))
|
||||
(SETQ ITEM-VALUE (POP INSPECT-ITEM-LIST))
|
||||
(IL:PROMPTPRINT PROMPT-MESS POP-ITEM SPACE ITEM-VALUE)
|
||||
(PAUSE)
|
||||
(INSPECT ITEM)
|
||||
(FORMAT T PROMPT-MESS1 POP-ITEM ITEM-VALUE)
|
||||
(IF (EQ 'IL:Y (IL:ASKUSER IL:DWIMWAIT 'IL:Y
|
||||
(FORMAT T MESS1 POP-ITEM POP-ITEM)))
|
||||
(IL:SET (PACK* POP-ITEM '-INSPECTED-FLG) T)
|
||||
(IL:SET (PACK* POP-ITEM '-INSPECTED-FLG) NIL))
|
||||
(IL:CLEARW)
|
||||
(SLEEP 1)))
|
||||
|
||||
|
||||
; Inspecting the compiled code of the function...
|
||||
(PAUSE)
|
||||
(IL:PROMPTPRINT MESS5)
|
||||
(IL:INSPECTCODE 'COS)
|
||||
(IF (EQ 'IL:Y (IL:ASKUSER IL:DWIMWAIT 'IL:Y MESS3))
|
||||
(SETQ INSPECTCODE-FLG T)
|
||||
(SETQ INSPECTCODE-FLG NIL))
|
||||
|
||||
(SLEEP 2)
|
||||
; Closing the inspector window...
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE) INSPECTCODE-TITLE))
|
||||
|
||||
; Testing to see if an object could be displayed in a specified window...
|
||||
(PAUSE)
|
||||
(SETQ INSPECT-ARRAY (MAKE-ARRAY '(2 2) :INITIAL-CONTENTS '((1 2) (3 4))))
|
||||
(IL:OPENW INSPECTORW)
|
||||
(INSPECT INSPECT-ARRAY NIL INSPECTORW)
|
||||
(IF (EQ 'IL:Y (IL:ASKUSER IL:DWIMWAIT 'IL:Y MESS4))
|
||||
(SETQ INSPECT-WHERE-FLG T)
|
||||
(SETQ INSPECT-WHERE-FLG NIL))
|
||||
|
||||
; Delete all inspect windows that have been created...
|
||||
(PAUSE)
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN
|
||||
(AND (NOT (EQ (IL:WINDOWPROP WINDOW 'IL:TITLE) NIL))
|
||||
(OR (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR :start1 0 :end1 9)
|
||||
(STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR
|
||||
:start1 (- (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE)) 9)
|
||||
:end1 (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE))))
|
||||
)
|
||||
)
|
||||
|
||||
; Test for AR8203
|
||||
(IL:PROMPTPRINT MESS6)
|
||||
(PAUSE)
|
||||
|
||||
(SETQ TEST-END (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TOTAL-TEST-TIME (FLOAT (/ (- TEST-END TEST-START) 60000)))
|
||||
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
(DO-TEST 'INSPECTOR-TEST-RESULT
|
||||
(PROGN (SETQ *OUTPUT* (OPEN TEST-RESULT :DIRECTION :OUTPUT
|
||||
:IF-EXISTS :APPEND))
|
||||
(PASS-FAIL 'INITIAL-VALUES-OF-VARIABLES VARIABLES-SET-CORRECT)
|
||||
(IL:FOR X IL:IN ITEM-NAMES IL:DO
|
||||
(PROGN
|
||||
(SETQ PF-ITEM (POP ITEM-NAMES))
|
||||
(PASS-FAIL X (EVAL (PACK* PF-ITEM '-INSPECTED-FLG)))))
|
||||
(PASS-FAIL 'INSPECTCODE INSPECTCODE-FLG)
|
||||
(PASS-FAIL 'INSPECT-WHERE INSPECT-WHERE-FLG)
|
||||
(T-FORMAT TOTAL-TEST-TIME)
|
||||
(CLOSE *OUTPUT*)
|
||||
(IDENTITY T)
|
||||
)
|
||||
)
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,261 +0,0 @@
|
||||
;; Function To Be Tested: INSPECTOR (Program Analysis)
|
||||
;;
|
||||
;; Source: IRM VOLUME 3 (Lyric Beta Release 2)
|
||||
;; Section 26. User Input/Output Packages
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 21, 1987
|
||||
;;
|
||||
;; Last Update: March 30, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>inspector.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (INSPECT OBJECT ASTYPE WHERE) - primary inspector function
|
||||
;;
|
||||
;; Function Description: The inspector provides a display-oriented and window-based
|
||||
;; facility for looking at and changing arbitrary Interlisp-D data structures.
|
||||
;; The inspector can be used to inspect all ser datatypes and many sysem datatypes.
|
||||
;; The inspector displays the field names and values of an arbitrary object in
|
||||
;; a window that allows setting of the properties and further inpection of the values.
|
||||
;; This latter feature makes it possible to "walk" around all of the data structures
|
||||
;; in the system at the touch of a buttton. For more information, refer to IRM, vol 2
|
||||
;; pages 26.1 through 26.9
|
||||
;;
|
||||
;; Argument(s): The primary function for inspector is INSPECT whose arguments are
|
||||
;; described here.
|
||||
;; OBJECT: object to be inspected
|
||||
;; ASTYPE: Record type of OBJECT. If ASTYPE is NIL, the data type of OJECT will be
|
||||
;; used to determine its property names in the inspect window.
|
||||
;; WHERE: speccifies the location of the inspect window. If NIL, the user will be
|
||||
;; prompted for location
|
||||
;;
|
||||
;; Returns: Inspection Window
|
||||
;;
|
||||
;; Constraints/Limitations: The primary emphasis of this testing will be focused
|
||||
;; on the function INSPECT. Instructions will be given in the prompt
|
||||
;; window for the user action to be taken during testing and appropriate messages
|
||||
;; will be displayed to explain each test process. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>inspect.report. This test requires
|
||||
;; TEDIT package.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
(DO-TEST "INSPECTOR-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ TEST-START (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>INSPECT.REPORT")
|
||||
(DEFUN T-FORMAT (TIME)
|
||||
(FORMAT *OUTPUT* "~2%TOTAL TEST RUN TIME FOR INSPECTOR: ~F MINUTES ~%"
|
||||
TIME))
|
||||
|
||||
(DEFUN ITEM-FORMAT-S (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: INSPECTOR TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'SUCCESS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-F (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: INSPECTOR TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'FAIL (IL:DATE) IL:USERNAME))
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IF (NOT TEST-ITEM) (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
))
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ INSPECTORW (IL:CREATEW '(100 100 325 90) "TEST WINDOW FOR INSPECTION" NIL T))
|
||||
(SETQ INSPECTOR "INSPECTOR")
|
||||
(SETQ INSPECTCODE-TITLE "CODE FOR COS")
|
||||
; Creating various objects to be inspected....
|
||||
(PAUSE)
|
||||
(SETQ INSPECT-ITEM-LIST
|
||||
(LIST (make-array '(3 3) :displaced-to (make-array '(4 3))) ; array
|
||||
(gentemp) ; atom
|
||||
(1- most-negative-fixnum) ; bignum
|
||||
0 ; bit
|
||||
'#*1001 ; bit-vector
|
||||
#\backspace ; character
|
||||
'common ; common
|
||||
#'cons ; compiled-function
|
||||
#c( 6/7 3.00) ; complex
|
||||
'( a b c . d) ; cons
|
||||
5.00 ; double-float
|
||||
(random most-positive-fixnum) ; fixnum
|
||||
(coerce most-negative-fixnum 'float) ; float
|
||||
#'(lambda nil nil) ; function
|
||||
(setq hash
|
||||
(make-hash-table 7)) ; hash-table
|
||||
4761 ; integer
|
||||
:mot-de-clef ; keyword
|
||||
'(a b c d) ; list
|
||||
37e5 ; long-float
|
||||
(= 1 2) ; null
|
||||
3.1415926535897932384d0 ; number
|
||||
(car(list-all-packages)) ; package
|
||||
(pathname) ; pathname
|
||||
;*random-state* ; random state - inspecting this hangs
|
||||
27/60 ; ratio
|
||||
5 ; rational
|
||||
(copy-readtable) ; readtable
|
||||
'(A 'B "C") ; sequence
|
||||
;; Breaks; see AR 6494
|
||||
(coerce 6 'short-float) ; short-float
|
||||
(make-array '(2 2)) ; simple-array
|
||||
'#*1001 ; simple-bit-vector
|
||||
"twine" ; simple-string
|
||||
(make-array 50 :initial-element 0) ; simple-vector
|
||||
.001 ; single-float
|
||||
#\* ; standard-char
|
||||
(make-synonym-stream) ; stream
|
||||
(make-array 20 :element-type 'string-char :initial-element #\0) ; string
|
||||
#\. ; string-char
|
||||
(gentemp) ; symbol
|
||||
(not (equal 2 3)) ; t
|
||||
'#( 5 4 3 2 1) ; vector
|
||||
IL:promptwindow ; window
|
||||
))
|
||||
(SETF (GETHASH 'COLOR HASH) 'BROWN
|
||||
(GETHASH 'NAME HASH) 'FRED
|
||||
(GETHASH 'AGE HASH) 29
|
||||
(GETHASH 'PHONE HASH) '777-6551
|
||||
(GETHASH 'HEIGHT HASH) '6-FEET
|
||||
(GETHASH 'WEIGHT HASH) '170)
|
||||
(SETQ SPACE ": ")
|
||||
(SETQ MESS0 "In this part of test, various lisp objects will be inspected.
|
||||
Numbers except for complex and fraction types, and characters
|
||||
are not inspectable and an appropriate message will be printed.
|
||||
If a inspect menu pops up, select the item INSPECT
|
||||
To create an inspector window, simply click the left mouse button
|
||||
Please respond with y or n after an inspector window is created. ")
|
||||
(SETQ MESS1 "Is an inspector window created for ~A? ~%or a message displayed if ~A is not inspectable?")
|
||||
(SETQ MESS2 "Please indicate a position for inspecting
|
||||
the compiled function COS with left mouse button")
|
||||
(SETQ MESS3 "Is the inspector window displayed for
|
||||
the compiled function COS (Yes or NO?)")
|
||||
(SETQ MESS4 "Is the inspection information displayed
|
||||
in the specified inspector window?")
|
||||
(SETQ MESS5 "The inspector window should have been created
|
||||
for inspecting the compiled function COS")
|
||||
(SETQ MESS6 "Inspecting *random-state* never returns (AR 8203)
|
||||
Please run this test after this test is completed by entering
|
||||
(INSPECT *RANDOM-STATE*) and return Cont-E if it never returns.
|
||||
If it still fails the test, please update the log file accordingly:
|
||||
{eris}<lispcore>test>program-analysis>inspect.report.")
|
||||
(SETQ MESS7 "Are you ready to start testing(y or n)? ")
|
||||
(SETQ PROMPT-MESS "Item being inspected: ")
|
||||
(SETQ PROMPT-MESS1 "Item just inspected: ~A: ~A~2%")
|
||||
|
||||
; Load TEDIT if not already loaded....
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(IL:FILESLOAD (IL:SYSLOAD) TEDIT)
|
||||
|
||||
; Check the intial value of inspector variables...
|
||||
(IF (AND (= IL:MAXINSPECTCDRLEVEL 50)
|
||||
(= IL:MAXINSPECTARRAYLEVEL 300)
|
||||
(EQUAL IL:INSPECTPRINTLEVEL '(2 . 5))
|
||||
(EQ IL:INSPECTALLFIELDSFLG T))
|
||||
(SETQ VARIABLES-SET-CORRECT T)
|
||||
(SETQ VARIABLES-SET-CORRECT NIL))
|
||||
|
||||
; Create various objects to be inspected...
|
||||
; Trying to inspect random state object will hang the system (never returns)
|
||||
; A number or character cannot be inspected and an appropriate message should be
|
||||
; generated for these objects...
|
||||
(SETQ INSPECT-ITEM-NAMES
|
||||
'(ARRAY ATOM BIGNUM BIT BIT-VECTOR CHARACTER
|
||||
COMMON COMPILED-FUNCTION COMPLEX CONS
|
||||
DOUBLE-FLOAT FIXNUM FLOAT FUNCTION
|
||||
HASH-TABLE INTEGER KEYWORD LIST LONG-FLOAT
|
||||
NULL NUMBER PACKAGE PATHNAME
|
||||
RATIO RATIONAL READTABLE SEQUENCE
|
||||
SHORT-FLOAT SIMPLE-ARRAY SIMPLE-BIT-VECTOR
|
||||
SIMPLE-STRING SIMPLE-VECTOR SINGLE-FLOAT
|
||||
STANDARD-CHAR STREAM STRING STRING-CHAR
|
||||
SYMBOL T VECTOR WINDOW) ITEM-NAMES INSPECT-ITEM-NAMES))
|
||||
|
||||
(IL:PROMPTPRINT MESS0)
|
||||
(PAUSE)
|
||||
(IL:ASKUSER 15 'IL:Y MESS7)
|
||||
(SETQ INSPECT-WINDOWS NIL)
|
||||
(IL:FOR ITEM IL:IN INSPECT-ITEM-LIST IL:DO
|
||||
(PROGN (SETQ POP-ITEM (POP INSPECT-ITEM-NAMES))
|
||||
(SETQ ITEM-VALUE (POP INSPECT-ITEM-LIST))
|
||||
(IL:PROMPTPRINT PROMPT-MESS POP-ITEM SPACE ITEM-VALUE)
|
||||
(PAUSE)
|
||||
(INSPECT ITEM)
|
||||
(FORMAT T PROMPT-MESS1 POP-ITEM ITEM-VALUE)
|
||||
(IF (EQ 'IL:Y (IL:ASKUSER IL:DWIMWAIT 'IL:Y
|
||||
(FORMAT T MESS1 POP-ITEM POP-ITEM)))
|
||||
(IL:SET (PACK* POP-ITEM '-INSPECTED-FLG) T)
|
||||
(IL:SET (PACK* POP-ITEM '-INSPECTED-FLG) NIL))
|
||||
(IL:CLEARW)
|
||||
(SLEEP 1)))
|
||||
|
||||
|
||||
; Inspecting the compiled code of the function...
|
||||
(PAUSE)
|
||||
(IL:PROMPTPRINT MESS5)
|
||||
(IL:INSPECTCODE 'COS)
|
||||
(IF (EQ 'IL:Y (IL:ASKUSER IL:DWIMWAIT 'IL:Y MESS3))
|
||||
(SETQ INSPECTCODE-FLG T)
|
||||
(SETQ INSPECTCODE-FLG NIL))
|
||||
|
||||
(SLEEP 2)
|
||||
; Closing the inspector window...
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE) INSPECTCODE-TITLE))
|
||||
|
||||
; Testing to see if an object could be displayed in a specified window...
|
||||
(PAUSE)
|
||||
(SETQ INSPECT-ARRAY (MAKE-ARRAY '(2 2) :INITIAL-CONTENTS '((1 2) (3 4))))
|
||||
(IL:OPENW INSPECTORW)
|
||||
(INSPECT INSPECT-ARRAY NIL INSPECTORW)
|
||||
(IF (EQ 'IL:Y (IL:ASKUSER IL:DWIMWAIT 'IL:Y MESS4))
|
||||
(SETQ INSPECT-WHERE-FLG T)
|
||||
(SETQ INSPECT-WHERE-FLG NIL))
|
||||
|
||||
; Delete all inspect windows that have been created...
|
||||
(PAUSE)
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN
|
||||
(AND (NOT (EQ (IL:WINDOWPROP WINDOW 'IL:TITLE) NIL))
|
||||
(OR (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR :start1 0 :end1 9)
|
||||
(STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR
|
||||
:start1 (- (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE)) 9)
|
||||
:end1 (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE))))
|
||||
)
|
||||
)
|
||||
|
||||
; Test for AR8203
|
||||
(IL:PROMPTPRINT MESS6)
|
||||
(PAUSE)
|
||||
|
||||
(SETQ TEST-END (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TOTAL-TEST-TIME (FLOAT (/ (- TEST-END TEST-START) 60000)))
|
||||
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
(DO-TEST 'INSPECTOR-TEST-RESULT
|
||||
(PROGN
|
||||
(PASS-FAIL 'INITIAL-VALUES-OF-VARIABLES VARIABLES-SET-CORRECT)
|
||||
(IL:FOR X IL:IN ITEM-NAMES IL:DO
|
||||
(PROGN
|
||||
(SETQ PF-ITEM (POP ITEM-NAMES))
|
||||
(PASS-FAIL X (EVAL (PACK* PF-ITEM '-INSPECTED-FLG)))))
|
||||
(PASS-FAIL 'INSPECTCODE INSPECTCODE-FLG)
|
||||
(PASS-FAIL 'INSPECT-WHERE INSPECT-WHERE-FLG)
|
||||
(T-FORMAT TOTAL-TEST-TIME)
|
||||
(IDENTITY T)
|
||||
)
|
||||
)
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,228 +0,0 @@
|
||||
;; Function To Be Tested: INSPECTOR (Program Analysis)
|
||||
;;
|
||||
;; Source: IRM VOLUME 3 (Lyric Beta Release 2)
|
||||
;; Section 26. User Input/Output Packages
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 21, 1987
|
||||
;;
|
||||
;; Last Update: March 30, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>inspector.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (INSPECT OBJECT ASTYPE WHERE) - primary inspector function
|
||||
;;
|
||||
;; Function Description: The inspector provides a display-oriented and window-based
|
||||
;; facility for looking at and changing arbitrary Interlisp-D data structures.
|
||||
;; The inspector can be used to inspect all ser datatypes and many sysem datatypes.
|
||||
;; The inspector displays the field names and values of an arbitrary object in
|
||||
;; a window that allows setting of the properties and further inpection of the values.
|
||||
;; This latter feature makes it possible to "walk" around all of the data structures
|
||||
;; in the system at the touch of a buttton. For more information, refer to IRM, vol 2
|
||||
;; pages 26.1 through 26.9
|
||||
;;
|
||||
;; Argument(s): The primary function for inspector is INSPECT whose arguments are
|
||||
;; described here.
|
||||
;; OBJECT: object to be inspected
|
||||
;; ASTYPE: Record type of OBJECT. If ASTYPE is NIL, the data type of OJECT will be
|
||||
;; used to determine its property names in the inspect window.
|
||||
;; WHERE: speccifies the location of the inspect window. If NIL, the user will be
|
||||
;; prompted for location
|
||||
;;
|
||||
;; Returns: Inspection Window
|
||||
;;
|
||||
;; Constraints/Limitations: The primary emphasis of this testing will be focused
|
||||
;; on the function INSPECT. Instructions will be given in the prompt
|
||||
;; window for the user action to be taken during testing and appropriate messages
|
||||
;; will be displayed to explain each test process. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>inspect.report. This test requires
|
||||
;; TEDIT package.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
(DO-TEST "INSPECTOR-TEST-SETUP"
|
||||
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL)
|
||||
IL:ELSE "Woo! It worked!"
|
||||
))
|
||||
|
||||
(SETQ INSPECTORW (IL:CREATEW '(100 100 325 90) "TEST WINDOW FOR INSPECTION" NIL T))
|
||||
(SETQ INSPECTOR "INSPECTOR")
|
||||
(SETQ INSPECTCODE-TITLE "CODE FOR COS")
|
||||
|
||||
; Creating various objects to be inspected....
|
||||
(SETQ INSPECT-ITEM-LIST
|
||||
(LIST (make-array '(3 3) :displaced-to (make-array '(4 3))) ; array
|
||||
(gentemp) ; atom
|
||||
(1- most-negative-fixnum) ; bignum
|
||||
0 ; bit
|
||||
'#*1001 ; bit-vector
|
||||
#\backspace ; character
|
||||
'common ; common
|
||||
#'cons ; compiled-function
|
||||
#c( 6/7 3.00) ; complex
|
||||
'( a b c . d) ; cons
|
||||
5.00 ; double-float
|
||||
(random most-positive-fixnum) ; fixnum
|
||||
(coerce most-negative-fixnum 'float) ; float
|
||||
#'(lambda nil nil) ; function
|
||||
(setq hash
|
||||
(make-hash-table 7)) ; hash-table
|
||||
4761 ; integer
|
||||
:mot-de-clef ; keyword
|
||||
'(a b c d) ; list
|
||||
37e5 ; long-float
|
||||
(= 1 2) ; null
|
||||
3.1415926535897932384d0 ; number
|
||||
(car(list-all-packages)) ; package
|
||||
(pathname) ; pathname
|
||||
;*random-state* ; random state - inspecting this hangs
|
||||
27/60 ; ratio
|
||||
5 ; rational
|
||||
(copy-readtable) ; readtable
|
||||
'(A 'B "C") ; sequence
|
||||
;; Breaks; see AR 6494
|
||||
(coerce 6 'short-float) ; short-float
|
||||
(make-array '(2 2)) ; simple-array
|
||||
'#*1001 ; simple-bit-vector
|
||||
"twine" ; simple-string
|
||||
(make-array 50 :initial-element 0) ; simple-vector
|
||||
.001 ; single-float
|
||||
#\* ; standard-char
|
||||
(make-synonym-stream) ; stream
|
||||
(make-array 20 :element-type 'string-char :initial-element #\0) ; string
|
||||
#\. ; string-char
|
||||
(gentemp) ; symbol
|
||||
(not (equal 2 3)) ; t
|
||||
'#( 5 4 3 2 1) ; vector
|
||||
IL:promptwindow ; window
|
||||
))
|
||||
(SETF (GETHASH 'COLOR HASH) 'BROWN
|
||||
(GETHASH 'NAME HASH) 'FRED
|
||||
(GETHASH 'AGE HASH) 29
|
||||
(GETHASH 'PHONE HASH) '777-6551
|
||||
(GETHASH 'HEIGHT HASH) '6-FEET
|
||||
(GETHASH 'WEIGHT HASH) '170)
|
||||
(SETQ SPACE ": ")
|
||||
(SETQ MESS0 "In this part of test, various lisp objects will be inspected.
|
||||
Numbers except for complex and fraction types, and characters
|
||||
are not inspectable and an appropriate message will be printed.
|
||||
If a inspect menu pops up, select the item INSPECT
|
||||
To create an inspector window, simply click the left mouse button
|
||||
Please respond with y or n after an inspector window is created. ")
|
||||
(SETQ MESS1 "Is an inspector window created for ~A? ~%or a message displayed if ~A is not inspectable?")
|
||||
(SETQ MESS2 "Please indicate a position for inspecting
|
||||
the compiled function COS with left mouse button")
|
||||
(SETQ MESS3 "Is the inspector window displayed for
|
||||
the compiled function COS (Yes or NO?)")
|
||||
(SETQ MESS4 "Is the inspection information displayed
|
||||
in the specified inspector window?")
|
||||
(SETQ MESS5 "The inspector window should have been created
|
||||
for inspecting the compiled function COS")
|
||||
(SETQ MESS6 "Inspecting *random-state* never returns (AR 8203)
|
||||
Please run this test after this test is completed by entering
|
||||
(INSPECT *RANDOM-STATE*) and return Cont-E if it never returns.
|
||||
If it still fails the test, please update the log file accordingly:
|
||||
{eris}<lispcore>test>program-analysis>inspect.report.")
|
||||
(SETQ MESS7 "Are you ready to start testing(y or n)? ")
|
||||
(SETQ PROMPT-MESS "Item being inspected: ")
|
||||
(SETQ PROMPT-MESS1 "Item just inspected: ~A: ~A~2%")
|
||||
|
||||
; Load TEDIT if not already loaded....
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(IL:FILESLOAD (IL:SYSLOAD) TEDIT)
|
||||
|
||||
; Check the intial value of inspector variables...
|
||||
(PASS-FAIL 'INITIAL-VALUES-OF-VARIABLES (AND (= IL:MAXINSPECTCDRLEVEL 50)
|
||||
(= IL:MAXINSPECTARRAYLEVEL 300)
|
||||
(EQUAL IL:INSPECTPRINTLEVEL '(2 . 5))
|
||||
(EQ IL:INSPECTALLFIELDSFLG T)))
|
||||
|
||||
; Create various objects to be inspected...
|
||||
; Trying to inspect random state object will hang the system (never returns)
|
||||
; A number or character cannot be inspected and an appropriate message should be
|
||||
; generated for these objects...
|
||||
(SETQ INSPECT-ITEM-NAMES
|
||||
'(ARRAY ATOM BIGNUM BIT BIT-VECTOR CHARACTER
|
||||
COMMON COMPILED-FUNCTION COMPLEX CONS
|
||||
DOUBLE-FLOAT FIXNUM FLOAT FUNCTION
|
||||
HASH-TABLE INTEGER KEYWORD LIST LONG-FLOAT
|
||||
NULL NUMBER PACKAGE PATHNAME
|
||||
RATIO RATIONAL READTABLE SEQUENCE
|
||||
SHORT-FLOAT SIMPLE-ARRAY SIMPLE-BIT-VECTOR
|
||||
SIMPLE-STRING SIMPLE-VECTOR SINGLE-FLOAT
|
||||
STANDARD-CHAR STREAM STRING STRING-CHAR
|
||||
SYMBOL T VECTOR WINDOW) ITEM-NAMES INSPECT-ITEM-NAMES))
|
||||
|
||||
|
||||
|
||||
(Y-OR-N-P MESS7)
|
||||
(SETQ INSPECT-WINDOWS NIL)
|
||||
(IL:FOR ITEM IL:IN INSPECT-ITEM-LIST IL:DO
|
||||
(SETQ POP-ITEM (POP INSPECT-ITEM-NAMES))
|
||||
(SETQ ITEM-VALUE (POP INSPECT-ITEM-LIST))
|
||||
(IL:PROMPTPRINT PROMPT-MESS POP-ITEM SPACE ITEM-VALUE)
|
||||
(INSPECT ITEM)
|
||||
(FORMAT T PROMPT-MESS1 POP-ITEM ITEM-VALUE)
|
||||
(IL:SET (PACK* POP-ITEM '-INSPECTED-FLG)
|
||||
(Y-OR-N-P (FORMAT T MESS1 POP-ITEM POP-ITEM)))
|
||||
)
|
||||
|
||||
(IL:FOR X IL:IN ITEM-NAMES IL:DO
|
||||
(SETQ PF-ITEM (POP ITEM-NAMES))
|
||||
(PASS-FAIL X (EVAL (PACK* PF-ITEM '-INSPECTED-FLG))))
|
||||
|
||||
|
||||
; Inspecting the compiled code of the function...
|
||||
(IL:PROMPTPRINT MESS5)
|
||||
(IL:INSPECTCODE 'COS)
|
||||
(PASS-FAIL 'INSPECTCODE (Y-OR-N-P MESS3))
|
||||
|
||||
; Closing the inspector window...
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE) INSPECTCODE-TITLE))
|
||||
|
||||
; Testing to see if an object could be displayed in a specified window...
|
||||
(SETQ INSPECT-ARRAY (MAKE-ARRAY '(2 2) :INITIAL-CONTENTS '((1 2) (3 4))))
|
||||
(IL:OPENW INSPECTORW)
|
||||
(INSPECT INSPECT-ARRAY NIL INSPECTORW)
|
||||
(PASS-FAIL 'INSPECT-WHERE (Y-OR-N-P MESS4))
|
||||
|
||||
; Delete all inspect windows that have been created...
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN
|
||||
(AND (NOT (EQ (IL:WINDOWPROP WINDOW 'IL:TITLE) NIL))
|
||||
(OR (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR :start1 0 :end1 9)
|
||||
(STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR
|
||||
:start1 (- (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE)) 9)
|
||||
:end1 (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE))))
|
||||
)
|
||||
)
|
||||
|
||||
; Test for AR8203
|
||||
(IL:PROMPTPRINT MESS6)
|
||||
|
||||
|
||||
|
||||
TEST-SUCCEEDED
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,228 +0,0 @@
|
||||
;; Function To Be Tested: INSPECTOR (Program Analysis)
|
||||
;;
|
||||
;; Source: IRM VOLUME 3 (Lyric Beta Release 2)
|
||||
;; Section 26. User Input/Output Packages
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 21, 1987
|
||||
;;
|
||||
;; Last Update: March 30, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>inspector.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (INSPECT OBJECT ASTYPE WHERE) - primary inspector function
|
||||
;;
|
||||
;; Function Description: The inspector provides a display-oriented and window-based
|
||||
;; facility for looking at and changing arbitrary Interlisp-D data structures.
|
||||
;; The inspector can be used to inspect all ser datatypes and many sysem datatypes.
|
||||
;; The inspector displays the field names and values of an arbitrary object in
|
||||
;; a window that allows setting of the properties and further inpection of the values.
|
||||
;; This latter feature makes it possible to "walk" around all of the data structures
|
||||
;; in the system at the touch of a buttton. For more information, refer to IRM, vol 2
|
||||
;; pages 26.1 through 26.9
|
||||
;;
|
||||
;; Argument(s): The primary function for inspector is INSPECT whose arguments are
|
||||
;; described here.
|
||||
;; OBJECT: object to be inspected
|
||||
;; ASTYPE: Record type of OBJECT. If ASTYPE is NIL, the data type of OJECT will be
|
||||
;; used to determine its property names in the inspect window.
|
||||
;; WHERE: speccifies the location of the inspect window. If NIL, the user will be
|
||||
;; prompted for location
|
||||
;;
|
||||
;; Returns: Inspection Window
|
||||
;;
|
||||
;; Constraints/Limitations: The primary emphasis of this testing will be focused
|
||||
;; on the function INSPECT. Instructions will be given in the prompt
|
||||
;; window for the user action to be taken during testing and appropriate messages
|
||||
;; will be displayed to explain each test process. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>inspect.report. This test requires
|
||||
;; TEDIT package.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
(DO-TEST "INSPECTOR-TEST-SETUP"
|
||||
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL)
|
||||
IL:ELSE "Woo! It worked!"
|
||||
))
|
||||
|
||||
(SETQ INSPECTORW (IL:CREATEW '(100 100 325 90) "TEST WINDOW FOR INSPECTION" NIL T))
|
||||
(SETQ INSPECTOR "INSPECTOR")
|
||||
(SETQ INSPECTCODE-TITLE "CODE FOR COS")
|
||||
|
||||
; Creating various objects to be inspected....
|
||||
(SETQ INSPECT-ITEM-LIST
|
||||
(LIST (make-array '(3 3) :displaced-to (make-array '(4 3))) ; array
|
||||
(gentemp) ; atom
|
||||
(1- most-negative-fixnum) ; bignum
|
||||
0 ; bit
|
||||
'#*1001 ; bit-vector
|
||||
#\backspace ; character
|
||||
'common ; common
|
||||
#'cons ; compiled-function
|
||||
#c( 6/7 3.00) ; complex
|
||||
'( a b c . d) ; cons
|
||||
5.00 ; double-float
|
||||
(random most-positive-fixnum) ; fixnum
|
||||
(coerce most-negative-fixnum 'float) ; float
|
||||
#'(lambda nil nil) ; function
|
||||
(setq hash
|
||||
(make-hash-table 7)) ; hash-table
|
||||
4761 ; integer
|
||||
:mot-de-clef ; keyword
|
||||
'(a b c d) ; list
|
||||
37e5 ; long-float
|
||||
(= 1 2) ; null
|
||||
3.1415926535897932384d0 ; number
|
||||
(car(list-all-packages)) ; package
|
||||
(pathname) ; pathname
|
||||
;*random-state* ; random state - inspecting this hangs
|
||||
27/60 ; ratio
|
||||
5 ; rational
|
||||
(copy-readtable) ; readtable
|
||||
'(A 'B "C") ; sequence
|
||||
;; Breaks; see AR 6494
|
||||
(coerce 6 'short-float) ; short-float
|
||||
(make-array '(2 2)) ; simple-array
|
||||
'#*1001 ; simple-bit-vector
|
||||
"twine" ; simple-string
|
||||
(make-array 50 :initial-element 0) ; simple-vector
|
||||
.001 ; single-float
|
||||
#\* ; standard-char
|
||||
(make-synonym-stream) ; stream
|
||||
(make-array 20 :element-type 'string-char :initial-element #\0) ; string
|
||||
#\. ; string-char
|
||||
(gentemp) ; symbol
|
||||
(not (equal 2 3)) ; t
|
||||
'#( 5 4 3 2 1) ; vector
|
||||
IL:promptwindow ; window
|
||||
))
|
||||
(SETF (GETHASH 'COLOR HASH) 'BROWN
|
||||
(GETHASH 'NAME HASH) 'FRED
|
||||
(GETHASH 'AGE HASH) 29
|
||||
(GETHASH 'PHONE HASH) '777-6551
|
||||
(GETHASH 'HEIGHT HASH) '6-FEET
|
||||
(GETHASH 'WEIGHT HASH) '170)
|
||||
(SETQ SPACE ": ")
|
||||
(SETQ MESS0 "In this part of test, various lisp objects will be inspected.
|
||||
Numbers except for complex and fraction types, and characters
|
||||
are not inspectable and an appropriate message will be printed.
|
||||
If a inspect menu pops up, select the item INSPECT
|
||||
To create an inspector window, simply click the left mouse button
|
||||
Please respond with y or n after an inspector window is created. ")
|
||||
(SETQ MESS1 "Is an inspector window created for ~A? ~%or a message displayed if ~A is not inspectable?")
|
||||
(SETQ MESS2 "Please indicate a position for inspecting
|
||||
the compiled function COS with left mouse button")
|
||||
(SETQ MESS3 "Is the inspector window displayed for
|
||||
the compiled function COS (Yes or NO?)")
|
||||
(SETQ MESS4 "Is the inspection information displayed
|
||||
in the specified inspector window?")
|
||||
(SETQ MESS5 "The inspector window should have been created
|
||||
for inspecting the compiled function COS")
|
||||
(SETQ MESS6 "Inspecting *random-state* never returns (AR 8203)
|
||||
Please run this test after this test is completed by entering
|
||||
(INSPECT *RANDOM-STATE*) and return Cont-E if it never returns.
|
||||
If it still fails the test, please update the log file accordingly:
|
||||
{eris}<lispcore>test>program-analysis>inspect.report.")
|
||||
(SETQ MESS7 "Are you ready to start testing(y or n)? ")
|
||||
(SETQ PROMPT-MESS "Item being inspected: ")
|
||||
(SETQ PROMPT-MESS1 "Item just inspected: ~A: ~A~2%")
|
||||
|
||||
; Load TEDIT if not already loaded....
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(IL:FILESLOAD (IL:SYSLOAD) TEDIT)
|
||||
|
||||
; Check the intial value of inspector variables...
|
||||
(PASS-FAIL 'INITIAL-VALUES-OF-VARIABLES (AND (= IL:MAXINSPECTCDRLEVEL 50)
|
||||
(= IL:MAXINSPECTARRAYLEVEL 300)
|
||||
(EQUAL IL:INSPECTPRINTLEVEL '(2 . 5))
|
||||
(EQ IL:INSPECTALLFIELDSFLG T)))
|
||||
|
||||
; Create various objects to be inspected...
|
||||
; Trying to inspect random state object will hang the system (never returns)
|
||||
; A number or character cannot be inspected and an appropriate message should be
|
||||
; generated for these objects...
|
||||
(SETQ INSPECT-ITEM-NAMES
|
||||
'(ARRAY ATOM BIGNUM BIT BIT-VECTOR CHARACTER
|
||||
COMMON COMPILED-FUNCTION COMPLEX CONS
|
||||
DOUBLE-FLOAT FIXNUM FLOAT FUNCTION
|
||||
HASH-TABLE INTEGER KEYWORD LIST LONG-FLOAT
|
||||
NULL NUMBER PACKAGE PATHNAME
|
||||
RATIO RATIONAL READTABLE SEQUENCE
|
||||
SHORT-FLOAT SIMPLE-ARRAY SIMPLE-BIT-VECTOR
|
||||
SIMPLE-STRING SIMPLE-VECTOR SINGLE-FLOAT
|
||||
STANDARD-CHAR STREAM STRING STRING-CHAR
|
||||
SYMBOL T VECTOR WINDOW) ITEM-NAMES INSPECT-ITEM-NAMES)
|
||||
|
||||
|
||||
|
||||
(Y-OR-N-P MESS7)
|
||||
(SETQ INSPECT-WINDOWS NIL)
|
||||
(IL:FOR ITEM IL:IN INSPECT-ITEM-LIST IL:DO
|
||||
(SETQ POP-ITEM (POP INSPECT-ITEM-NAMES))
|
||||
(SETQ ITEM-VALUE (POP INSPECT-ITEM-LIST))
|
||||
(IL:PROMPTPRINT PROMPT-MESS POP-ITEM SPACE ITEM-VALUE)
|
||||
(INSPECT ITEM)
|
||||
(FORMAT T PROMPT-MESS1 POP-ITEM ITEM-VALUE)
|
||||
(IL:SET (PACK* POP-ITEM '-INSPECTED-FLG)
|
||||
(Y-OR-N-P (FORMAT T MESS1 POP-ITEM POP-ITEM)))
|
||||
)
|
||||
|
||||
(IL:FOR X IL:IN ITEM-NAMES IL:DO
|
||||
(SETQ PF-ITEM (POP ITEM-NAMES))
|
||||
(PASS-FAIL X (EVAL (PACK* PF-ITEM '-INSPECTED-FLG))))
|
||||
|
||||
|
||||
; Inspecting the compiled code of the function...
|
||||
(IL:PROMPTPRINT MESS5)
|
||||
(IL:INSPECTCODE 'COS)
|
||||
(PASS-FAIL 'INSPECTCODE (Y-OR-N-P MESS3))
|
||||
|
||||
; Closing the inspector window...
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE) INSPECTCODE-TITLE))
|
||||
|
||||
; Testing to see if an object could be displayed in a specified window...
|
||||
(SETQ INSPECT-ARRAY (MAKE-ARRAY '(2 2) :INITIAL-CONTENTS '((1 2) (3 4))))
|
||||
(IL:OPENW INSPECTORW)
|
||||
(INSPECT INSPECT-ARRAY NIL INSPECTORW)
|
||||
(PASS-FAIL 'INSPECT-WHERE (Y-OR-N-P MESS4))
|
||||
|
||||
; Delete all inspect windows that have been created...
|
||||
(IL:FOR WINDOW IL:IN (IL:OPENWINDOWS)
|
||||
IL:DO (IL:CLOSEW WINDOW)
|
||||
IL:WHEN
|
||||
(AND (NOT (EQ (IL:WINDOWPROP WINDOW 'IL:TITLE) NIL))
|
||||
(OR (STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR :start1 0 :end1 9)
|
||||
(STRING-EQUAL (IL:WINDOWPROP WINDOW 'IL:TITLE)
|
||||
INSPECTOR
|
||||
:start1 (- (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE)) 9)
|
||||
:end1 (LENGTH (IL:WINDOWPROP WINDOW 'IL:TITLE))))
|
||||
)
|
||||
)
|
||||
|
||||
; Test for AR8203
|
||||
(IL:PROMPTPRINT MESS6)
|
||||
|
||||
|
||||
|
||||
TEST-SUCCEEDED
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
264
internal/test/env/program-analysis/hand/SPY.U.~1~
vendored
264
internal/test/env/program-analysis/hand/SPY.U.~1~
vendored
@@ -1,264 +0,0 @@
|
||||
;; Function To Be Tested: SPY (Part I) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 187
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 12, 1987
|
||||
;;
|
||||
;; Last Update: March 18, 1987
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>spy.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (See Spy documentation)
|
||||
;;
|
||||
;; Function Description: Spy is a tool to help programs run faster. Spy has two parts:
|
||||
;; a "sampler" that one runs while running his program, which monitors what the program
|
||||
;; is doing, anda "displayer" that displays the data gathered by the sampler.
|
||||
;; The "displayer" uses the grapher package to display the data gathered by the sampler.
|
||||
;; In the graph, the height of each node is adjusted to be proportional to the amount
|
||||
;; of time. Just as Masterscope and Browser give an interactive picture of the static
|
||||
;; structure of the program, Spy give an interactive picture of the dynamic structure.
|
||||
;;
|
||||
;; Required packages: Grapher, readnumber, imageobj, and tedit
|
||||
;;
|
||||
;; Functions: (SPY.BUTTON) - Turns spy on and off.
|
||||
;; (SPY.START) - Reinitializes the internal Spy data structure and turns on
|
||||
;; Sampling.
|
||||
;; (SPY.END) - Turns off sampling, and cleans up the data structure
|
||||
;; (SPY.TOGGLE) - If Spying is off, turn it on with (SPY.START). If it's on,
|
||||
;; turn it off with (SPY.END) and then show the results with (SPY.TREE 10).
|
||||
;; (WITH.SPY form) - Macro which calls (SPY.START), evaluates the form, calls
|
||||
;; (SPY.END), and another one will turn it off.
|
||||
;; (SPY.TREE threshold individualp mergetype depthlimit) - display the results
|
||||
;; of the last "spy" in a grapher window. For argument description,
|
||||
;; see SPY documentation.
|
||||
;; (SPY.LEGEND) - This brings up a window that shows what they mean
|
||||
;; (SPY.BORDER) - This brings up a window that shows the interpretation of
|
||||
;; SPY.BORDERS
|
||||
;; Variables: SPY.FREQUENCY - How many times per second to sample? Initially 10.
|
||||
;; Max: 60
|
||||
;; SPY.NOMERGEFNS - Functions on this list are not merged under
|
||||
;; MergeDefault
|
||||
;; SPY.TREE - This holds the data from the last sampling. One can save
|
||||
;; and restore it using UGLYVARS.
|
||||
;; SPY.BORDERS - This controls the border display on a tree.
|
||||
;; SPY.FONT - Font used to display node labels. Initially (GACHA 10)
|
||||
;; SPY.MAXLINES - Maximum height of a node in the graph, measured
|
||||
;; in multiples of the font height of SPY.FONT.
|
||||
;; Argument(s): (SEE Spy documentation)
|
||||
;;
|
||||
;; Returns: (SEE Spy documentation)
|
||||
;;
|
||||
;; Constraints/Limitations: Testing of SPY requires much user interface; however, may of the
|
||||
;; functional tests are written in such a way that many of the top-level functions will be
|
||||
;; automatically executed and test results will be recorded in the following file
|
||||
;; {eris}<lispcore>test>program-analysis>browser.report. User interface is necessary for
|
||||
;; some of the spy functions. Appropriate messages will be printed when user interface is
|
||||
;; required during testing. Instructions for manually testing SPY (pages 189 - 193), should
|
||||
;; be read carefully before testing the SPY display results (Using SPY,Merging, and Individual
|
||||
;; vs Cumulative mode).
|
||||
|
||||
(DO-TEST "SPY-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ TEST-START (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>SPY.REPORT")
|
||||
(DEFUN S-FORMAT (TIME)
|
||||
(FORMAT *OUTPUT* "~2%TOTAL TEST RUN TIME FOR SPY: ~F MINUTES ~%"
|
||||
TIME))
|
||||
|
||||
(DEFUN ITEM-FORMAT-S (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: SPY TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'SUCCESS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-F (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: SPY TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'FAIL (IL:DATE) IL:USERNAME))
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IF (EQ TEST-ITEM T) (ITEM-FORMAT-S COMMAND-LANGUAGE)
|
||||
(ITEM-FORMAT-F COMMAND-LANGUAGE)))
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ SPYW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
(SETQ SPY-COMMAND-STRING
|
||||
"(IL:PAGEHEIGHT 0)
|
||||
;Loading spy and other required package
|
||||
; they are not already loaded...
|
||||
(PAUSE)
|
||||
; This part of the test will load spy and other required packages...
|
||||
(IF (AND (MEMBER 'IL:SPY IL:FILELST)
|
||||
(MEMBER 'IL:GRAPHER IL:FILELST)
|
||||
(MEMBER 'IL:READNUMBER IL:FILELST)
|
||||
(MEMBER 'IL:IMAGEOBJ IL:FILELST))
|
||||
(PROGN (IL:PROMPTPRINT '(SPY and other necessary files are already loaded))
|
||||
(SLEEP 2)
|
||||
(IL:CLRPROMPT))
|
||||
(PROGN (IL:LOAD? '{ERINYES}<LYRIC>LIBRARY>SPY.LCOM 'IL:SYSLOAD)
|
||||
(IL:LOAD? '{ERINYES}<LYRIC>LIBRARY>GRAPHER.LCOM 'IL:SYSLOAD)
|
||||
(IL:LOAD? '{ERINYES}<LYRIC>LIBRARY>READNUMBER.LCOM 'IL:SYSLOAD)
|
||||
(IL:LOAD? '{ERINYES}<LYRIC>LIBRARY>IMAGEOBJ.LCOM 'IL:SYSLOAD)))
|
||||
|
||||
; This part determines if all spy functions are defined and variables bound ....
|
||||
(PAUSE)
|
||||
|
||||
(IF (AND (NOTANY #'NULL
|
||||
(MAPCAR #'FBOUNDP '(IL:SPY.BUTTON IL:SPY.START IL:SPY.END
|
||||
IL:WITH.SPY IL:SPY.TREE IL:SPY.LEGEND)))
|
||||
(NOTANY #'NULL
|
||||
(MAPCAR #'BOUNDP '(IL:SPY.FREQUENCY IL:SPY.NOMERGEFNS
|
||||
IL:SPY.TREE IL:SPY.BORDERS IL:SPY.FONT IL:SPY.MAXLINES)))
|
||||
)
|
||||
(SETQ IL:FUNCTIONS-VARIABLES-FLG T)
|
||||
(SETQ IL:FUNCTIONS-VARIABLES-FLG NIL))
|
||||
|
||||
; Test to see if the SPY variables are bound to correct initial values
|
||||
|
||||
(IF (AND (EQ IL:SPY.FREQUENCY 10)
|
||||
(PROGN (SETQ NOMERGEFNS-FLG NIL)
|
||||
(DOLIST (Y '(IL:ERRORSET IL:\\\\EVAL IL:\\\\EVALFORM IL:APPLY IL:EVAL))
|
||||
(IF (MEMBER Y IL:SPY.NOMERGEFNS) (PUSH T NOMERGEFNS-FLG)
|
||||
(PUSH NIL NOMERGEFNS-FLG)))
|
||||
(NOTANY #'NULL NOMERGEFNS-FLG))
|
||||
(AND (EQ (IL:FONTPROP IL:SPY.FONT 'IL:FAMILY) 'IL:GACHA)
|
||||
(= (IL:FONTPROP IL:SPY.FONT 'IL:SIZE) 8))
|
||||
(ZEROP (MOD IL:SPY.MAXLINES (IL:FONTPROP IL:SPY.FONT 'IL:HEIGHT)))
|
||||
)
|
||||
(SETQ IL:SPY-INITIAL-FLG T)
|
||||
(SETQ IL:SPY-INITIAL-FLG NIL)
|
||||
)
|
||||
|
||||
; Test for SPY.BUTTON
|
||||
; (SPY.BUTTON) will turn spy on/off
|
||||
;
|
||||
(CL:IN-PACKAGE 'INTERLISP)
|
||||
(SPY.BUTTON '(90 . 5))
|
||||
(CURSORPOSITION '(134 . -145))
|
||||
; Clicking the left mouse button will turn it on...
|
||||
(XCL-TEST::PAUSE)
|
||||
(APPLY (WINDOWPROP SPY.BUTTON 'BUTTONEVENTFN))
|
||||
(IF (EQ \\\\PERIODIC.INTERRUPT '\\\\SPY.INTERRUPT)
|
||||
then (SETQ SPY-BUTTON-ON T)
|
||||
else (SETQ SPY-BUTTON-ON NIL))
|
||||
|
||||
; Clicking it again will turn off the spy and display the results....
|
||||
(XCL-TEST::PAUSE)
|
||||
(PROMPTPRINT '(please indicate the spy.window position with left mouse button))
|
||||
(APPLY (WINDOWPROP SPY.BUTTON 'BUTTONEVENTFN))
|
||||
(CLOSEW SPY.BUTTON)
|
||||
(IF (EQ \\\\PERIODIC.INTERRUPT NIL)
|
||||
then (SETQ SPY-BUTTON-OFF T)
|
||||
else (SETQ SPY-BUTTON-OFF NIL))
|
||||
(SPY.END)
|
||||
(CLOSEW SPY.WINDOW)
|
||||
(CLRPROMPT)
|
||||
|
||||
; This part of the test is for (SPY.START) and (SPY.END)
|
||||
; (SPY.START) will turns on the sampling
|
||||
(XCL-TEST::PAUSE)
|
||||
(SPY.START)
|
||||
; Now SPY should be turned back on.
|
||||
(If (EQUAL \\\\PERIODIC.INTERRUPT '\\\\SPY.INTERRUPT)
|
||||
then (SETQ SPY-START T)
|
||||
else (SETQ SPY-START NIL))
|
||||
; (SPY.END) will turn off sampling.
|
||||
(XCL-TEST::PAUSE)
|
||||
(SPY.END)
|
||||
; Now SPY should be turned off.
|
||||
(If (EQ \\\\PERIODIC.INTERRUPT NIL)
|
||||
then (SETQ SPY-END T)
|
||||
else (SETQ SPY-END NIL))
|
||||
|
||||
; The following will test (SPY.TOGGLE)
|
||||
; If SPY is off, it will turn it on; otherwise, it will turn it off
|
||||
; with (SPY.END) and show the results.
|
||||
(XCL-TEST::PAUSE)
|
||||
(SETQ \\\\PERIODIC.INTERRUPT NIL)
|
||||
(SPY.BUTTON '(100 . 100))
|
||||
(SPY.TOGGLE)
|
||||
(If (EQ \\\\PERIODIC.INTERRUPT '\\\\SPY.INTERRUPT)
|
||||
then (SETQ SPY-TOGGLE-ON T)
|
||||
else (SETQ SPY-TOGGLE-ON NIL))
|
||||
; Invoking (SPY.TOGGLE) again will turn spy off and display the results...
|
||||
(XCL-TEST::PAUSE)
|
||||
(PROMPTPRINT '(please indicate the spy.window position with left mouse button))
|
||||
(SPY.TOGGLE)
|
||||
(If (EQ \\\\PERIODIC.INTERRUPT NIL)
|
||||
then (SETQ SPY-TOGGLE-OFF T)
|
||||
else (SETQ SPY-TOGGLE-OFF NIL))
|
||||
(CLOSEW SPY.BUTTON)
|
||||
(CLOSEW SPY.WINDOW)
|
||||
(CLRPROMPT)
|
||||
|
||||
|
||||
; The following will test (WITH.SPY form)
|
||||
; This will evaluate the form with spy on
|
||||
(XCL-TEST::PAUSE)
|
||||
(WITH.SPY (FOR X FROM 1 TO 10 COLLECT (ADD1 X)))
|
||||
(SETQ WITH-SPY-VAL IT)
|
||||
(IF (EQUAL WITH-SPY-VAL
|
||||
(PROGN (SPY.START) (PROG1 (FOR X FROM 1 TO 10 COLLECT (ADD1 X)) (SPY.END))))
|
||||
then (SETQ WITH-SPY T)
|
||||
else (SETQ WITH-SPY NIL))
|
||||
|
||||
; This following will test SPY.TREE, which display the results in a grapher window.
|
||||
; (SPY.TREE 10) will display the last spy with threshold set to 10
|
||||
(XCL-TEST::PAUSE)
|
||||
(PROMPTPRINT '(please indicate the spy.window position with left mouse button))
|
||||
(SPY.TREE 10)
|
||||
(IF (EQ (NOT (MEMBER SPY.WINDOW (OPENWINDOWS))) NIL)
|
||||
THEN (SETQ SPY-TREE1 T)
|
||||
ELSE (SETQ SPY-TREE1 NIL))
|
||||
(CLOSEW SPY.WINDOW)
|
||||
|
||||
; (SPY.TREE 10 T) Should display the spy graph in different format
|
||||
(XCL-TEST::PAUSE)
|
||||
(PROMPTPRINT '(please indicate the spy.window position with left mouse button))
|
||||
(SPY.TREE 10 T)
|
||||
(IF (EQ (NOT (MEMBER SPY.WINDOW (OPENWINDOWS))) NIL)
|
||||
THEN (SETQ SPY-TREE2 T)
|
||||
ELSE (SETQ SPY-TREE2 NIL))
|
||||
(CLOSEW SPY.WINDOW)
|
||||
|
||||
; (SPY.TREE 10 T 'ALL 2) Should display the spy graph in with depthlimit set to 2
|
||||
(XCL-TEST::PAUSE)
|
||||
(PROMPTPRINT '(please indicate the spy.window position with left mouse button))
|
||||
(SPY.TREE 10 T 'ALL 2)
|
||||
(IF (EQ (NOT (MEMBER SPY.WINDOW (OPENWINDOWS))) NIL)
|
||||
THEN (SETQ SPY-TREE3 T)
|
||||
ELSE (SETQ SPY-TREE3 NIL))
|
||||
(CLRPROMPT)
|
||||
(CLOSEW SPY.WINDOW)
|
||||
(CL:IN-PACKAGE 'XCL-TEST)
|
||||
; Now do-test will analyze the results of testing
|
||||
(DO-TEST 'SPY-TEST-RESULT
|
||||
(PROGN (SETQ *OUTPUT* (OPEN TEST-RESULT :DIRECTION :OUTPUT
|
||||
:IF-EXISTS :APPEND))
|
||||
(PASS-FAIL 'IL:FUNCTION-VARIABLE-DEFINITION IL:FUNCTIONS-VARIABLES-FLG)
|
||||
(PASS-FAIL 'IL:SPY-INITIAL-VALUES IL:SPY-INITIAL-FLG)
|
||||
(PASS-FAIL 'IL:FUNCTION-VARIABLE-DEFINITION IL:FUNCTIONS-VARIABLES-FLG)
|
||||
(PASS-FAIL 'IL:SPY-BUTTON-ON IL:SPY-BUTTON-ON)
|
||||
(PASS-FAIL 'IL:SPY-BUTTON-OFF IL:SPY-BUTTON-OFF)
|
||||
(PASS-FAIL 'IL:SPY-START IL:SPY-START)
|
||||
(PASS-FAIL 'IL:SPY-END IL:SPY-END)
|
||||
(PASS-FAIL 'IL:SPY-TOGGLE (AND IL:SPY-TOGGLE-ON IL:SPY-TOGGLE-OFF))
|
||||
(PASS-FAIL 'IL:WITH-SPY IL:WITH-SPY)
|
||||
(PASS-FAIL 'IL:SPY-TREE (AND IL:SPY-TREE1 IL:SPY-TREE2 IL:SPY-TREE3))
|
||||
(SETQ TEST-END (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TOTAL-TEST-TIME (FLOAT (/ (- TEST-END TEST-START) 60000)))
|
||||
(S-FORMAT TOTAL-TEST-TIME)
|
||||
(CLOSE *OUTPUT*)
|
||||
(IDENTITY T)
|
||||
)
|
||||
)
|
||||
|
||||
")
|
||||
(IL:BKSYSBUF SPY-COMMAND-STRING)
|
||||
)
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
201
internal/test/env/program-analysis/hand/SPY.U.~2~
vendored
201
internal/test/env/program-analysis/hand/SPY.U.~2~
vendored
@@ -1,201 +0,0 @@
|
||||
;; Function To Be Tested: SPY (Part I) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 187
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 12, 1987
|
||||
;;
|
||||
;; Last Update: March 18, 1987
|
||||
;;
|
||||
;; Massively munged: Rene P. S. Bane on June 22, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>spy.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (See Spy documentation)
|
||||
;;
|
||||
;; Function Description: Spy is a tool to help programs run faster. Spy has two parts:
|
||||
;; a "sampler" that one runs while running his program, which monitors what the program
|
||||
;; is doing, anda "displayer" that displays the data gathered by the sampler.
|
||||
;; The "displayer" uses the grapher package to display the data gathered by the sampler.
|
||||
;; In the graph, the height of each node is adjusted to be proportional to the amount
|
||||
;; of time. Just as Masterscope and Browser give an interactive picture of the static
|
||||
;; structure of the program, Spy give an interactive picture of the dynamic structure.
|
||||
;;
|
||||
;; Required packages: Grapher, readnumber, imageobj, and tedit
|
||||
;;
|
||||
;; Functions: (SPY.BUTTON) - Turns spy on and off.
|
||||
;; (SPY.START) - Reinitializes the internal Spy data structure and turns on
|
||||
;; Sampling.
|
||||
;; (SPY.END) - Turns off sampling, and cleans up the data structure
|
||||
;; (SPY.TOGGLE) - If Spying is off, turn it on with (SPY.START). If it's on,
|
||||
;; turn it off with (SPY.END) and then show the results with (SPY.TREE 10).
|
||||
;; (WITH.SPY form) - Macro which calls (SPY.START), evaluates the form, calls
|
||||
;; (SPY.END), and another one will turn it off.
|
||||
;; (SPY.TREE threshold individualp mergetype depthlimit) - display the results
|
||||
;; of the last "spy" in a grapher window. For argument description,
|
||||
;; see SPY documentation.
|
||||
;; (SPY.LEGEND) - This brings up a window that shows what they mean
|
||||
;; (SPY.BORDER) - This brings up a window that shows the interpretation of
|
||||
;; SPY.BORDERS
|
||||
;; Variables: SPY.FREQUENCY - How many times per second to sample? Initially 10.
|
||||
;; Max: 60
|
||||
;; SPY.NOMERGEFNS - Functions on this list are not merged under
|
||||
;; MergeDefault
|
||||
;; SPY.TREE - This holds the data from the last sampling. One can save
|
||||
;; and restore it using UGLYVARS.
|
||||
;; SPY.BORDERS - This controls the border display on a tree.
|
||||
;; SPY.FONT - Font used to display node labels. Initially (GACHA 10)
|
||||
;; SPY.MAXLINES - Maximum height of a node in the graph, measured
|
||||
;; in multiples of the font height of SPY.FONT.
|
||||
;; Argument(s): (SEE Spy documentation)
|
||||
;;
|
||||
;; Returns: (SEE Spy documentation)
|
||||
;;
|
||||
;; Constraints/Limitations: Testing of SPY requires much user interface; however, may of the
|
||||
;; functional tests are written in such a way that many of the top-level functions will be
|
||||
;; automatically executed and test results will be recorded in the following file
|
||||
;; {eris}<lispcore>test>program-analysis>browser.report. User interface is necessary for
|
||||
;; some of the spy functions. Appropriate messages will be printed when user interface is
|
||||
;; required during testing. Instructions for manually testing SPY (pages 189 - 193), should
|
||||
;; be read carefully before testing the SPY display results (Using SPY,Merging, and Individual
|
||||
;; vs Cumulative mode).
|
||||
|
||||
(DO-TEST "SPY-TEST-SETUP"
|
||||
(SETQ SPY-TEST-RESULTS T) ; assume test succeeds, set to nil if something fails
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM) IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE) (SETQ SPY-TEST-RESULTS NIL)
|
||||
))
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ SPYW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
(IL:PAGEHEIGHT 0)
|
||||
;Loading spy and other required package
|
||||
; they are not already loaded...
|
||||
(PAUSE)
|
||||
; This part of the test will load spy and other required packages...
|
||||
(IL:FILESLOAD (IL:SYSLOAD) SPY GRAPHER READNUMBER IMAGEOBJ)
|
||||
|
||||
; This part determines if all spy functions are defined and variables bound ....
|
||||
(PAUSE)
|
||||
|
||||
(PASS-FAIL 'IL:FUNCTION-VARIABLE-DEFINITION
|
||||
(AND (NOTANY #'NULL
|
||||
(MAPCAR #'FBOUNDP '(IL:SPY.BUTTON IL:SPY.START IL:SPY.END
|
||||
IL:WITH.SPY IL:SPY.TREE IL:SPY.LEGEND)))
|
||||
(NOTANY #'NULL
|
||||
(MAPCAR #'BOUNDP '(IL:SPY.FREQUENCY IL:SPY.NOMERGEFNS
|
||||
IL:SPY.TREE IL:SPY.BORDERS IL:SPY.FONT IL:SPY.MAXLINES)))
|
||||
))
|
||||
|
||||
|
||||
; Test to see if the SPY variables are bound to correct initial values
|
||||
|
||||
(PASS-FAIL 'IL:SPY-INITIAL-VALUES
|
||||
(AND (EQ IL:SPY.FREQUENCY 10)
|
||||
(PROGN (SETQ NOMERGEFNS-FLG NIL)
|
||||
(DOLIST (Y '(IL:ERRORSET IL:\\\\EVAL IL:\\\\EVALFORM IL:APPLY IL:EVAL))
|
||||
(IF (MEMBER Y IL:SPY.NOMERGEFNS) (PUSH T NOMERGEFNS-FLG)
|
||||
(PUSH NIL NOMERGEFNS-FLG)))
|
||||
(NOTANY #'NULL NOMERGEFNS-FLG))
|
||||
(AND (EQ (IL:FONTPROP IL:SPY.FONT 'IL:FAMILY) 'IL:GACHA)
|
||||
(= (IL:FONTPROP IL:SPY.FONT 'IL:SIZE) 8))
|
||||
(ZEROP (MOD IL:SPY.MAXLINES (IL:FONTPROP IL:SPY.FONT 'IL:HEIGHT)))
|
||||
)
|
||||
)
|
||||
|
||||
; Test for SPY.BUTTON
|
||||
; (SPY.BUTTON) will turn spy on/off
|
||||
;
|
||||
(IL:SPY.BUTTON '(90 . 5))
|
||||
(IL:CURSORPOSITION '(134 . -145))
|
||||
(PASS-FAIL "SPY.BUTTON gets you a Spy Eye"
|
||||
(Y-OR-N-P "Did a Spy Eye just appear? "))
|
||||
; Clicking the left mouse button will turn it on...
|
||||
(XCL-TEST::PAUSE)
|
||||
(APPLY (IL:WINDOWPROP IL:SPY.BUTTON 'IL:BUTTONEVENTFN) NIL)
|
||||
(PASS-FAIL 'IL:SPY-BUTTON-ON
|
||||
(Y-OR-N-P "Did the Spy Eye open? "))
|
||||
|
||||
; Clicking it again will turn off the spy and display the results....
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(APPLY (IL:WINDOWPROP IL:SPY.BUTTON 'IL:BUTTONEVENTFN) NIL)
|
||||
(PASS-FAIL 'IL:SPY-BUTTON-OFF (Y-OR-N-P "Did the Spy Eye close? "))
|
||||
(IL:SPY.END)
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
(IL:CLRPROMPT)
|
||||
|
||||
; This part of the test is for (SPY.START) and (SPY.END)
|
||||
; (SPY.START) will turns on the sampling
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:SPY.START)
|
||||
; Now SPY should be turned back on.
|
||||
(PASS-FAIL 'IL:SPY-START
|
||||
(Y-OR-N-P "Did the Spy Eye open? "))
|
||||
; (SPY.END) will turn off sampling.
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:SPY.END)
|
||||
; Now SPY should be turned off.
|
||||
(PASS-FAIL 'IL:SPY-END (Y-OR-N-P "Did the Spy Eye close? "))
|
||||
|
||||
; The following will test (SPY.TOGGLE)
|
||||
; If SPY is off, it will turn it on; otherwise, it will turn it off
|
||||
; with (SPY.END) and show the results.
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:SPY.TOGGLE)
|
||||
(PASS-FAIL 'IL:SPY-TOGGLE-ON (Y-OR-N-P "Did the Spy Eye open? "))
|
||||
; Invoking (SPY.TOGGLE) again will turn spy off and display the results...
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(IL:SPY.TOGGLE)
|
||||
(PASS-FAIL 'IL:SPY-TOGGLE-OFF (Y-OR-N-P "Did the Spy Eye close? "))
|
||||
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
(IL:CLRPROMPT)
|
||||
|
||||
|
||||
; The following will test (WITH.SPY form)
|
||||
; This will evaluate the form with spy on
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:WITH.SPY (IL:FOR X IL:FROM 1 IL:TO 10 IL:COLLECT (IL:ADD1 X)))
|
||||
(SETQ IL:WITH-SPY-VAL IL:IT)
|
||||
(PASS-FAIL 'IL:WITH-SPY (EQUAL IL:WITH-SPY-VAL
|
||||
(PROGN (IL:SPY.START) (PROG1 (IL:FOR X IL:FROM 1 IL:TO 10 IL:COLLECT (IL:ADD1 X)) (IL:SPY.END)))))
|
||||
|
||||
; This following will test SPY.TREE, which display the results in a grapher window.
|
||||
; (SPY.TREE 10) will display the last spy with threshold set to 10
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(IL:SPY.TREE 10)
|
||||
(SETQ IL:SPY-TREE1 (MEMBER IL:SPY.WINDOW (IL:OPENWINDOWS)))
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
|
||||
; (SPY.TREE 10 T) Should display the spy graph in different format
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(IL:SPY.TREE 10 T)
|
||||
(SETQ IL:SPY-TREE2 (MEMBER IL:SPY.WINDOW (IL:OPENWINDOWS)))
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
|
||||
; (SPY.TREE 10 T 'ALL 2) Should display the spy graph in with depthlimit set to 2
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(IL:SPY.TREE 10 T 'IL:ALL 2)
|
||||
(SETQ IL:SPY-TREE3 (MEMBER IL:SPY.WINDOW (IL:OPENWINDOWS)))
|
||||
(IL:CLRPROMPT)
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
(IL:CLOSEW IL:SPY.BUTTON)
|
||||
SPY-TEST-RESULTS
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
195
internal/test/env/program-analysis/hand/SPY.U.~3~
vendored
195
internal/test/env/program-analysis/hand/SPY.U.~3~
vendored
@@ -1,195 +0,0 @@
|
||||
;; Function To Be Tested: SPY (Part I) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 187
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 12, 1987
|
||||
;;
|
||||
;; Last Update: March 18, 1987
|
||||
;;
|
||||
;; Massively munged: Rene P. S. Bane on June 22, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>spy.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (See Spy documentation)
|
||||
;;
|
||||
;; Function Description: Spy is a tool to help programs run faster. Spy has two parts:
|
||||
;; a "sampler" that one runs while running his program, which monitors what the program
|
||||
;; is doing, anda "displayer" that displays the data gathered by the sampler.
|
||||
;; The "displayer" uses the grapher package to display the data gathered by the sampler.
|
||||
;; In the graph, the height of each node is adjusted to be proportional to the amount
|
||||
;; of time. Just as Masterscope and Browser give an interactive picture of the static
|
||||
;; structure of the program, Spy give an interactive picture of the dynamic structure.
|
||||
;;
|
||||
;; Required packages: Grapher, readnumber, imageobj, and tedit
|
||||
;;
|
||||
;; Functions: (SPY.BUTTON) - Turns spy on and off.
|
||||
;; (SPY.START) - Reinitializes the internal Spy data structure and turns on
|
||||
;; Sampling.
|
||||
;; (SPY.END) - Turns off sampling, and cleans up the data structure
|
||||
;; (SPY.TOGGLE) - If Spying is off, turn it on with (SPY.START). If it's on,
|
||||
;; turn it off with (SPY.END) and then show the results with (SPY.TREE 10).
|
||||
;; (WITH.SPY form) - Macro which calls (SPY.START), evaluates the form, calls
|
||||
;; (SPY.END), and another one will turn it off.
|
||||
;; (SPY.TREE threshold individualp mergetype depthlimit) - display the results
|
||||
;; of the last "spy" in a grapher window. For argument description,
|
||||
;; see SPY documentation.
|
||||
;; (SPY.LEGEND) - This brings up a window that shows what they mean
|
||||
;; (SPY.BORDER) - This brings up a window that shows the interpretation of
|
||||
;; SPY.BORDERS
|
||||
;; Variables: SPY.FREQUENCY - How many times per second to sample? Initially 10.
|
||||
;; Max: 60
|
||||
;; SPY.NOMERGEFNS - Functions on this list are not merged under
|
||||
;; MergeDefault
|
||||
;; SPY.TREE - This holds the data from the last sampling. One can save
|
||||
;; and restore it using UGLYVARS.
|
||||
;; SPY.BORDERS - This controls the border display on a tree.
|
||||
;; SPY.FONT - Font used to display node labels. Initially (GACHA 10)
|
||||
;; SPY.MAXLINES - Maximum height of a node in the graph, measured
|
||||
;; in multiples of the font height of SPY.FONT.
|
||||
;; Argument(s): (SEE Spy documentation)
|
||||
;;
|
||||
;; Returns: (SEE Spy documentation)
|
||||
;;
|
||||
;; Constraints/Limitations: Testing of SPY requires much user interface; however, may of the
|
||||
;; functional tests are written in such a way that many of the top-level functions will be
|
||||
;; automatically executed and test results will be recorded in the following file
|
||||
;; {eris}<lispcore>test>program-analysis>browser.report. User interface is necessary for
|
||||
;; some of the spy functions. Appropriate messages will be printed when user interface is
|
||||
;; required during testing. Instructions for manually testing SPY (pages 189 - 193), should
|
||||
;; be read carefully before testing the SPY display results (Using SPY,Merging, and Individual
|
||||
;; vs Cumulative mode).
|
||||
|
||||
(DO-TEST "SPY-TEST-SETUP"
|
||||
(SETQ SPY-TEST-RESULTS T) ; assume test succeeds, set to nil if something fails
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM) IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE) (SETQ SPY-TEST-RESULTS NIL)
|
||||
))
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ SPYW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
(IL:PAGEHEIGHT 0)
|
||||
;Loading spy and other required package
|
||||
; they are not already loaded...
|
||||
(PAUSE)
|
||||
; This part of the test will load spy and other required packages...
|
||||
(IL:FILESLOAD (IL:SYSLOAD) SPY GRAPHER READNUMBER IMAGEOBJ)
|
||||
|
||||
; This part determines if all spy functions are defined and variables bound ....
|
||||
(PAUSE)
|
||||
|
||||
(PASS-FAIL 'IL:FUNCTION-VARIABLE-DEFINITION
|
||||
(AND (NOTANY #'NULL
|
||||
(MAPCAR #'FBOUNDP '(IL:SPY.BUTTON IL:SPY.START IL:SPY.END
|
||||
IL:WITH.SPY IL:SPY.TREE IL:SPY.LEGEND)))
|
||||
(NOTANY #'NULL
|
||||
(MAPCAR #'BOUNDP '(IL:SPY.FREQUENCY IL:SPY.NOMERGEFNS
|
||||
IL:SPY.TREE IL:SPY.BORDERS IL:SPY.FONT IL:SPY.MAXLINES)))
|
||||
))
|
||||
|
||||
|
||||
; Test to see if the SPY variables are bound to correct initial values
|
||||
|
||||
(PASS-FAIL 'IL:SPY-INITIAL-VALUES
|
||||
(AND (EQ IL:SPY.FREQUENCY 10)
|
||||
(AND (EQ (IL:FONTPROP IL:SPY.FONT 'IL:FAMILY) 'IL:GACHA)
|
||||
(= (IL:FONTPROP IL:SPY.FONT 'IL:SIZE) 8))
|
||||
(ZEROP (MOD IL:SPY.MAXLINES (IL:FONTPROP IL:SPY.FONT 'IL:HEIGHT)))
|
||||
)
|
||||
)
|
||||
|
||||
; Test for SPY.BUTTON
|
||||
; (SPY.BUTTON) will turn spy on/off
|
||||
;
|
||||
(IL:SPY.BUTTON '(90 . 5))
|
||||
(IL:CURSORPOSITION '(134 . -145))
|
||||
(PASS-FAIL "SPY.BUTTON gets you a Spy Eye"
|
||||
(Y-OR-N-P "Did a Spy Eye just appear? "))
|
||||
; Clicking the left mouse button will turn it on...
|
||||
(XCL-TEST::PAUSE)
|
||||
(APPLY (IL:WINDOWPROP IL:SPY.BUTTON 'IL:BUTTONEVENTFN) NIL)
|
||||
(PASS-FAIL 'IL:SPY-BUTTON-ON
|
||||
(Y-OR-N-P "Did the Spy Eye open? "))
|
||||
|
||||
; Clicking it again will turn off the spy and display the results....
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(APPLY (IL:WINDOWPROP IL:SPY.BUTTON 'IL:BUTTONEVENTFN) NIL)
|
||||
(PASS-FAIL 'IL:SPY-BUTTON-OFF (Y-OR-N-P "Did the Spy Eye close? "))
|
||||
(IL:SPY.END)
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
(IL:CLRPROMPT)
|
||||
|
||||
; This part of the test is for (SPY.START) and (SPY.END)
|
||||
; (SPY.START) will turns on the sampling
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:SPY.START)
|
||||
; Now SPY should be turned back on.
|
||||
(PASS-FAIL 'IL:SPY-START
|
||||
(Y-OR-N-P "Did the Spy Eye open? "))
|
||||
; (SPY.END) will turn off sampling.
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:SPY.END)
|
||||
; Now SPY should be turned off.
|
||||
(PASS-FAIL 'IL:SPY-END (Y-OR-N-P "Did the Spy Eye close? "))
|
||||
|
||||
; The following will test (SPY.TOGGLE)
|
||||
; If SPY is off, it will turn it on; otherwise, it will turn it off
|
||||
; with (SPY.END) and show the results.
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:SPY.TOGGLE)
|
||||
(PASS-FAIL 'IL:SPY-TOGGLE-ON (Y-OR-N-P "Did the Spy Eye open? "))
|
||||
; Invoking (SPY.TOGGLE) again will turn spy off and display the results...
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(IL:SPY.TOGGLE)
|
||||
(PASS-FAIL 'IL:SPY-TOGGLE-OFF (Y-OR-N-P "Did the Spy Eye close? "))
|
||||
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
(IL:CLRPROMPT)
|
||||
|
||||
|
||||
; The following will test (WITH.SPY form)
|
||||
; This will evaluate the form with spy on
|
||||
(XCL-TEST::PAUSE)
|
||||
|
||||
(PASS-FAIL 'IL:WITH-SPY (EQUAL (IL:WITH.SPY (IL:FOR X IL:FROM 1 IL:TO 10 IL:COLLECT (IL:ADD1 X)))
|
||||
(PROGN (IL:SPY.START) (PROG1 (IL:FOR X IL:FROM 1 IL:TO 10 IL:COLLECT (IL:ADD1 X)) (IL:SPY.END)))))
|
||||
|
||||
; This following will test SPY.TREE, which display the results in a grapher window.
|
||||
; (SPY.TREE 10) will display the last spy with threshold set to 10
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(IL:SPY.TREE 10)
|
||||
(SETQ IL:SPY-TREE1 (MEMBER IL:SPY.WINDOW (IL:OPENWINDOWS)))
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
|
||||
; (SPY.TREE 10 T) Should display the spy graph in different format
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(IL:SPY.TREE 10 T)
|
||||
(SETQ IL:SPY-TREE2 (MEMBER IL:SPY.WINDOW (IL:OPENWINDOWS)))
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
|
||||
; (SPY.TREE 10 T 'ALL 2) Should display the spy graph in with depthlimit set to 2
|
||||
(XCL-TEST::PAUSE)
|
||||
(IL:PROMPTPRINT "please indicate the spy.window position with left mouse button")
|
||||
(IL:SPY.TREE 10 T 'IL:ALL 2)
|
||||
(SETQ IL:SPY-TREE3 (MEMBER IL:SPY.WINDOW (IL:OPENWINDOWS)))
|
||||
(IL:CLRPROMPT)
|
||||
(IL:CLOSEW IL:SPY.WINDOW)
|
||||
(IL:CLOSEW IL:SPY.BUTTON)
|
||||
SPY-TEST-RESULTS
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
;; Function To Be Tested: BROWSER (Part I) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 10, 1987
|
||||
;;
|
||||
;; Last Update: March 12, 1987
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>browser-part1.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (BROWSER T/NIL)
|
||||
;;
|
||||
;; Function Description: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it. Part 1 of this test is
|
||||
;; to determine if masterscope is unaffected when the BROWSER is not enabled or
|
||||
;; (IL:BROWSER NIL). Part I also tests to see if grapher is automatically loaded
|
||||
;; by browser.
|
||||
|
||||
;;
|
||||
;; Argument(s): T or NIL (SEE Browser documentation)
|
||||
;;
|
||||
;; Returns: IL:MSPATHS
|
||||
;;
|
||||
;; Constraints/Limitations: ; Part 1 of this test is to determine if masterscope is
|
||||
;; unaffected when the BROWSER is not enabled or (IL:BROWSER NIL)
|
||||
;; Part 2 tests masterscope modification by BROWSER. This is test part 2, which
|
||||
;; is stored in {eris}<lispcore>test>program-analysis>browser-part2.u
|
||||
;; Part 1 test must be run first before Part 2 test since the former loads functions
|
||||
;; utilized by the latter. Since Browser calls LAYOUTFOREST module of GRAPHER to
|
||||
;; display the graph at a user-designated location, user interface is required and
|
||||
;; testing will not be totally automatic. Instructions will be given for user input
|
||||
;; during testing. The test will utilize do-test and the interlisp function bksysfuf.
|
||||
;; Comments or messages are incorporated within each command file, which will be run
|
||||
;; by using the function bksysbuf. Each test setup is titled "BROWSER-TEST-SETUP",
|
||||
;; which executes the command string. The do-test form within the command file will
|
||||
;; return T or "testfailed" This test file requires MASTERSCOPE, TEDIT, BROWSER, and
|
||||
;; GRAPHER packages
|
||||
;;
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-GFuntion
|
||||
;; |
|
||||
;; GFun-A------------------------GFun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; GFun-A1 GFun-A2 GFun-A3 GFun-B1 GFun-B2 GFun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; GFun-C1 GFun-A1
|
||||
;;
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>browser.report
|
||||
|
||||
(DO-TEST "BROWSER-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>BROWSER.REPORT")
|
||||
(DEFUN R-FORMAT (STATUS)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: MASTERSCOPE~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" (LISP-IMPLEMENTATION-VERSION) STATUS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-S (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: BROWSER TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'SUCCESS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-F (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: BROWSER TEST-ITEM: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'FAIL (IL:DATE) IL:USERNAME))
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IF (EQ TEST-ITEM T) (ITEM-FORMAT-S COMMAND-LANGUAGE)
|
||||
(ITEM-FORMAT-F COMMAND-LANGUAGE)))
|
||||
(SETQ {CORE}PATHS "{CORE}PATHS")
|
||||
(DEFUN PAUSE NIL (PROGN
|
||||
(IL:PLAYTUNE '((262 . 15000) (440 . 15000) (349 . 15000)))
|
||||
(SLEEP 2)))
|
||||
(SETQ BROWSERW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
(SETQ BROWSER-COMMAND-STRING
|
||||
";Loading browser will automatically load grapher package.
|
||||
; This part of the test determines if grapher is loaded.
|
||||
(PAUSE)
|
||||
(IL:PAGEHEIGHT 0)
|
||||
(DELETE 'IL:GRAPHER IL:SYSFILES)
|
||||
(IL:LOAD? '{ERINYES}<LYRIC>LIBRARY>MASTERSCOPE.LCOM 'IL:SYSLOAD)
|
||||
(IL:LOAD '{ERINYES}<LYRIC>LIBRARY>BROWSER.LCOM 'IL:SYSLOAD)
|
||||
(IF (OR (MEMBER 'IL:GRAPHER IL:SYSFILES)
|
||||
(MEMBER 'IL:GRAPHER IL:FILELST))
|
||||
(SETQ GRAPHER-LDFLG T)
|
||||
(PROGN (SETQ GRAPHER-LDFLG NIL)
|
||||
(IL:LOAD '{ERINYES}<LYRIC>LIBRARY>GRAPHER.LCOM 'IL:SYSLOAD)))
|
||||
|
||||
; This part of test determines if the variables BROWSERFORMAT and BROWSERBOXING
|
||||
; are bound.
|
||||
(PAUSE)
|
||||
(IF (AND (BOUNDP 'IL:BROWSERFORMAT) (BOUNDP 'IL:BROWSERBOXING))
|
||||
(SETQ BROWSER-VARIABLES T)
|
||||
(SETQ BROWSER-VARIABLES NIL))
|
||||
|
||||
|
||||
; Reinitialize and Define functions to be analyzed....
|
||||
(PAUSE)
|
||||
. ERASE
|
||||
(DEFUN TOP-GFUNTION NIL (AND (GFUN-A) (GFUN-B)))
|
||||
(DEFUN GFUN-A NIL (OR (GFUN-A1) (GFUN-A2) (GFUN-A3)))
|
||||
(DEFUN GFUN-B NIL (OR (GFUN-B1) (GFUN-B2) (GFUN-B3)))
|
||||
(DEFUN GFUN-A1 NIL T)
|
||||
(DEFUN GFUN-A2 NIL NIL)
|
||||
(DEFUN GFUN-A3 NIL T)
|
||||
(DEFUN GFUN-B1 NIL (AND (GFUN-C1)(GFUN-A1)))
|
||||
(DEFUN GFUN-B2 NIL NIL)
|
||||
(DEFUN GFUN-B3 NIL T)
|
||||
(DEFUN GFUN-C1 NIL NIL)
|
||||
|
||||
; Start analyzing functions in gtop-function and others...
|
||||
(PAUSE)
|
||||
. ANALYZE TOP-GFUNTION
|
||||
. ANALYZE GFUN-A
|
||||
. ANALYZE GFUN-B
|
||||
. ANALYZE GFUN-A1
|
||||
. ANALYZE GFUN-A2
|
||||
. ANALYZE GFUN-A3
|
||||
. ANALYZE GFUN-B1
|
||||
. ANALYZE GFUN-B2
|
||||
. ANALYZE GFUN-B3
|
||||
. ANALYZE GFUN-C1
|
||||
; Browser is now loaded and activated
|
||||
(PAUSE)
|
||||
; Part 1 of this test is to determine if masterscope is unaffected when
|
||||
; the BROWSER is not enabled or (IL:BROWSER NIL)
|
||||
(IL:BROWSER NIL)
|
||||
; Browser is now deactivated ...
|
||||
(PAUSE)
|
||||
; This will cause masterscope to diaplay graphs in a teletype mode
|
||||
; or in the exec.
|
||||
; show paths should display the following path, which should look like;
|
||||
; 1.gfun-a1 gfun-a top-gfuntion
|
||||
; 2. gfun-b1 gfun-b top-gfuntion
|
||||
(PAUSE)
|
||||
(DRIBBLE '{CORE}PATHS)
|
||||
. SHOW PATHS TO GFUN-A1 FROM TOP-GFUNTION
|
||||
(DRIBBLE)
|
||||
; analyzing the file that contains the masterscope interaction (show paths)
|
||||
(SETQ PATHS (OPEN {CORE}PATHS))
|
||||
(DO (( i 0 (1+ i)))
|
||||
((= i 5) t)
|
||||
(READ-LINE PATHS))
|
||||
(IF (AND (STRING-EQUAL (READ-LINE PATHS) '|1.gfun-a1 gfun-a top-gfuntion|)
|
||||
(STRING-EQUAL (READ-LINE PATHS) '|2. gfun-b1 gfun-b top-gfuntion|))
|
||||
(SETQ BROWSER-DISABLED-FLG T)(SETQ BROWSER-DISABLED-FLG NIL))
|
||||
(CLOSE PATHS)
|
||||
(DELETE-FILE '{CORE}PATHS)
|
||||
(DO-TEST 'BROWSER-TEST-RESULT
|
||||
(PROGN (SETQ *OUTPUT* (OPEN TEST-RESULT :DIRECTION :OUTPUT
|
||||
:IF-EXISTS :APPEND))
|
||||
(PASS-FAIL 'BROWSER-VARIABLES-BOUND? BROWSER-VARIABLES)
|
||||
(PASS-FAIL 'GRAGPER-LOADED? GRAPHER-LDFLG)
|
||||
(PASS-FAIL 'BROWSER-DISABLED BROWSER-DISABLED-FLG)
|
||||
(CLOSE *OUTPUT*)
|
||||
(IDENTITY T)
|
||||
)
|
||||
)
|
||||
|
||||
")
|
||||
(IL:BKSYSBUF BROWSER-COMMAND-STRING)
|
||||
)
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
;; Function To Be Tested: BROWSER (Part I) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lisp Library Modules Manual (Lyric Beta Release 2)
|
||||
;; Browser, Page 11
|
||||
;; Section: Program Analysis (Library)
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: March 10, 1987
|
||||
;;
|
||||
;; Last Update: March 12, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;; Munged more: June 24, 1988 by Rene P. S. Bane
|
||||
;;
|
||||
;; Filed As: {ERIS}<test>env>program-analysis>hand>browser-part1.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: (BROWSER T/NIL)
|
||||
;;
|
||||
;; Function Description: BROWSER modifies the SHOW PATHS command of Masterscope so that
|
||||
;; the command's output is displayed as an undirected graph. It creates a new window
|
||||
;; for each SHOW PATHS command, but will reuse a window if that window has an earlier
|
||||
;; instance of the same SHOW PATHS command displayed in it. Part 1 of this test is
|
||||
;; to determine if masterscope is unaffected when the BROWSER is not enabled or
|
||||
;; (IL:BROWSER NIL). Part I also tests to see if grapher is automatically loaded
|
||||
;; by browser.
|
||||
|
||||
;;
|
||||
;; Argument(s): T or NIL (SEE Browser documentation)
|
||||
;;
|
||||
;; Returns: IL:MSPATHS
|
||||
;;
|
||||
;; Constraints/Limitations: ; Part 1 of this test is to determine if masterscope is
|
||||
;; unaffected when the BROWSER is not enabled or (IL:BROWSER NIL)
|
||||
;; Part 2 tests masterscope modification by BROWSER. This is test part 2, which
|
||||
;; is stored in {eris}<lispcore>test>program-analysis>browser-part2.u
|
||||
;; Part 1 test must be run first before Part 2 test since the former loads functions
|
||||
;; utilized by the latter. Since Browser calls LAYOUTFOREST module of GRAPHER to
|
||||
;; display the graph at a user-designated location, user interface is required and
|
||||
;; testing will not be totally automatic. Instructions will be given for user input
|
||||
;; during testing. The test will utilize do-test and the interlisp function bksysfuf.
|
||||
;; Comments or messages are incorporated within each command file, which will be run
|
||||
;; by using the function bksysbuf. Each test setup is titled "BROWSER-TEST-SETUP",
|
||||
;; which executes the command string. The do-test form within the command file will
|
||||
;; return T or "testfailed" This test file requires MASTERSCOPE, TEDIT, BROWSER, and
|
||||
;; GRAPHER packages
|
||||
;;
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-GFuntion
|
||||
;; |
|
||||
;; GFun-A------------------------GFun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; GFun-A1 GFun-A2 GFun-A3 GFun-B1 GFun-B2 GFun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; GFun-C1 GFun-A1
|
||||
;;
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>browser.report
|
||||
|
||||
(DO-TEST "BROWSER-TEST-SETUP"
|
||||
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL)
|
||||
IL:ELSE "Pair-fect-o"
|
||||
)
|
||||
)
|
||||
|
||||
(SETQ BROWSERW (IL:CREATEW '(100 100 325 90) NIL NIL T))
|
||||
|
||||
(IL:PAGEHEIGHT 0)
|
||||
; This part of test determines if the variables BROWSERFORMAT and BROWSERBOXING
|
||||
; are bound.
|
||||
(PASS-FAIL "Browser variables bound" (AND (BOUNDP 'IL:BROWSERFORMAT) (BOUNDP 'IL:BROWSERBOXING)))
|
||||
|
||||
; Reinitialize and Define functions to be analyzed....
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-GFUNTION NIL (AND (GFUN-A) (GFUN-B)))
|
||||
(DEFUN GFUN-A NIL (OR (GFUN-A1) (GFUN-A2) (GFUN-A3)))
|
||||
(DEFUN GFUN-B NIL (OR (GFUN-B1) (GFUN-B2) (GFUN-B3)))
|
||||
(DEFUN GFUN-A1 NIL T)
|
||||
(DEFUN GFUN-A2 NIL NIL)
|
||||
(DEFUN GFUN-A3 NIL T)
|
||||
(DEFUN GFUN-B1 NIL (AND (GFUN-C1)(GFUN-A1)))
|
||||
(DEFUN GFUN-B2 NIL NIL)
|
||||
(DEFUN GFUN-B3 NIL T)
|
||||
(DEFUN GFUN-C1 NIL NIL)
|
||||
|
||||
; Start analyzing functions in gtop-function and others...
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-GFUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A1))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A2))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-A3))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B1))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B2))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-B3))
|
||||
(IL:MASTERSCOPE '(ANALYZE GFUN-C1))
|
||||
|
||||
; Browser is now loaded and activated
|
||||
; Part 1 of this test is to determine if masterscope is unaffected when
|
||||
; the BROWSER is not enabled or (IL:BROWSER NIL)
|
||||
(IL:BROWSER NIL)
|
||||
|
||||
; Browser is now deactivated ...
|
||||
; This will cause masterscope to display graphs in a teletype mode
|
||||
; or in the exec.
|
||||
; show paths should display the following path, which should look like;
|
||||
; 1.gfun-a1 gfun-a top-gfuntion
|
||||
; 2. gfun-b1 gfun-b top-gfuntion
|
||||
(DRIBBLE '{CORE}PATHS)
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO GFUN-A1 FROM TOP-GFUNTION))
|
||||
(DRIBBLE)
|
||||
; analyzing the file that contains the masterscope interaction (show paths)
|
||||
(SETQ PATHS (OPEN "{CORE}PATHS"))
|
||||
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE PATHS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-gfuntion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Show paths (would-be graph)"
|
||||
(AND
|
||||
|
||||
(STRING-EQUAL "1.GFUN-A1GFUN-ATOP-GFUNTION" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "2.GFUN-B1GFUN-BTOP-GFUNTION" (DELETE #\Space (READ-LINE PATHS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
(CLOSE PATHS)
|
||||
(DELETE-FILE '{CORE}PATHS)
|
||||
|
||||
TEST-SUCCEEDED
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,22 +0,0 @@
|
||||
(DEFINE-FILE-INFO §READTABLE "XCL" §PACKAGE "INTERLISP")
|
||||
(FILECREATED "19-Mar-87 10:54:40" {DSK}<LISPFILES>LIBRARY>NEW-FUNCTION.\;1 629
|
||||
|
||||
|changes| |to:| (VARS NEW-FUNCTIONCOMS)
|
||||
(FNS NEW-FUNCTION))
|
||||
|
||||
|
||||
; Copyright (c) 1987 by XEROX Corporation. All rights reserved.
|
||||
|
||||
(PRETTYCOMPRINT NEW-FUNCTIONCOMS)
|
||||
|
||||
(RPAQQ NEW-FUNCTIONCOMS ((FNS NEW-FUNCTION)))
|
||||
(DEFINEQ
|
||||
|
||||
(NEW-FUNCTION
|
||||
(LAMBDA (X Y) (* \; "Edited 19-Mar-87 10:52 by jpark")
|
||||
(PLUS X Y)))
|
||||
)
|
||||
(PUTPROPS NEW-FUNCTION COPYRIGHT ("XEROX Corporation" 1987))
|
||||
(DECLARE\: DONTCOPY
|
||||
(FILEMAP (NIL (390 545 (NEW-FUNCTION 400 . 543)))))
|
||||
STOP
|
||||
@@ -1,22 +0,0 @@
|
||||
(DEFINE-FILE-INFO READTABLE "XCL" PACKAGE "INTERLISP")
|
||||
(FILECREATED "19-Mar-87 10:54:40" {DSK}<LISPFILES>LIBRARY>NEW-FUNCTION.\;1 629
|
||||
|
||||
|changes| |to:| (VARS NEW-FUNCTIONCOMS)
|
||||
(FNS NEW-FUNCTION))
|
||||
|
||||
|
||||
; Copyright (c) 1987 by XEROX Corporation. All rights reserved.
|
||||
|
||||
(PRETTYCOMPRINT NEW-FUNCTIONCOMS)
|
||||
|
||||
(RPAQQ NEW-FUNCTIONCOMS ((FNS NEW-FUNCTION)))
|
||||
(DEFINEQ
|
||||
|
||||
(NEW-FUNCTION
|
||||
(LAMBDA (X Y) (* \; "Edited 19-Mar-87 10:52 by jpark")
|
||||
(PLUS X Y)))
|
||||
)
|
||||
(PUTPROPS NEW-FUNCTION COPYRIGHT ("XEROX Corporation" 1987))
|
||||
(DECLARE\: DONTCOPY
|
||||
(FILEMAP (NIL (390 545 (NEW-FUNCTION 400 . 543)))))
|
||||
STOP
|
||||
@@ -1,230 +0,0 @@
|
||||
;; Function To Be Tested: . (MASTERSCOPE) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lyric Release Overview (Lyric Beta Release)
|
||||
;; Section 19 (Masterscope), Page 22
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: Feb 25, 1987
|
||||
;;
|
||||
;; Last Update: March 26, 1987
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>masterscope.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: . &rest LINE
|
||||
;;
|
||||
;; Function Description: Make a MASTERSCOPE query. Masterscope is an interactive
|
||||
;; program for analyzing and cross referencing user programs. It contains
|
||||
;; facilities for analyzing user functions to determine what other functions are
|
||||
;; called, how and where variables are bound, set, or referenced, as well as
|
||||
;; which functions use particular record declarations. Masterscope is able to
|
||||
;; analyze definitions directly from a file as well as in-core definitions.
|
||||
;; This test is almost identical to the masterscope as an exec command, which is
|
||||
;; located in {eris}<lispcore>test>exec>masterscope.u
|
||||
;;
|
||||
;; Argument(s): Masterscope commands (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Returns: (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Constraints/Limitations: Due to the nature of Programmer's Assistant commands,
|
||||
;; testing them will be performed using do-test and the interlisp function bksysfuf.
|
||||
;; Comments or messages are incorporated within
|
||||
;; each command file, which will be run by using the function bksysbuf.
|
||||
;; Each test setup is titled "MASTERSCOPE-TEST-SETUP", which executes the command
|
||||
;; string. The do-test form within the command file will return T or "test
|
||||
;; failed" This test file requires TEDIT and MASTERSCOPE package
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-Funtion
|
||||
;; |
|
||||
;; Fun-A------------------------Fun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; Fun-A1 Fun-A2 Fun-A3 Fun-B1 Fun-B2 Fun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; Fun-C1 Fun-A1
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "MASTERSCOPE-TEST-SETUP"
|
||||
(PROGN
|
||||
(SETQ TEST-START (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ MESS1 "Now do-test will determine if correct results have been returned for the analysis of user functions...")
|
||||
(SETQ TEST-RESULT "{ERIS}<LISPCORE>TEST>PROGRAM-ANALYSIS>MASTERSCOPE.REPORT")
|
||||
(DEFUN R-FORMAT (STATUS)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: MASTERSCOPE~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" (LISP-IMPLEMENTATION-VERSION) STATUS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-S (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: MASTERSCOPE COMMAND LANGUAGE: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'SUCCESS (IL:DATE) IL:USERNAME))
|
||||
(DEFUN ITEM-FORMAT-F (COMMAND-LANGUAGE)
|
||||
(FORMAT *OUTPUT* "~%COMMAND: MASTERSCOPE COMMAND LANGUAGE: ~A~%LISP VERSION: ~A ~%STATUS: ~A DATE: ~A TESTER: ~A~%" COMMAND-LANGUAGE (LISP-IMPLEMENTATION-VERSION) 'FAIL (IL:DATE) IL:USERNAME))
|
||||
(SETQ {CORE}WHO-CALLS "{CORE}WHO-CALLS")
|
||||
(SETQ {CORE}PATHS "{CORE}PATHS")
|
||||
(SETQ {CORE}DESCRIBE "{CORE}DESCRIBE")
|
||||
(SETQ MASTERSCOPE-COMMAND-STRING
|
||||
"; Reinitialize and Define functions to be analyzed
|
||||
. ERASE
|
||||
(DEFUN TOP-FUNTION NIL (AND (FUN-A) (FUN-B)))
|
||||
(DEFUN FUN-A NIL (OR (FUN-A1) (FUN-A2) (FUN-A3)))
|
||||
(DEFUN FUN-B NIL (OR (FUN-B1) (FUN-B2) (FUN-B3)))
|
||||
(DEFUN FUN-A1 NIL T)
|
||||
(DEFUN FUN-A2 NIL NIL)
|
||||
(DEFUN FUN-A3 NIL T)
|
||||
(DEFUN FUN-B1 NIL (AND (FUN-C1)(FUN-A1)))
|
||||
(DEFUN FUN-B2 NIL NIL)
|
||||
(DEFUN FUN-B3 NIL T)
|
||||
(DEFUN FUN-C1 NIL NIL)
|
||||
; Start analyzing functions in top-function
|
||||
. ANALYZE TOP-FUNTION
|
||||
. ANALYZE FUN-A
|
||||
. ANALYZE FUN-B
|
||||
. ANALYZE FUN-B1
|
||||
. WHO CALLS FUN-A1
|
||||
(IF (EQUAL * '(FUN-A FUN-B1)) (SETQ FUN-A1-CALL T) (SETQ FUN-A1-CALL NIL))
|
||||
. WHO CALLS TOP-FUNTION
|
||||
(IF (EQUAL * NIL) (SETQ TOP-FUN-CALL T) (SETQ TOP-FUN-CALL NIL))
|
||||
. WHO CALLS FUN-A
|
||||
(IF (EQUAL * '(TOP-FUNTION)) (SETQ FUN-A-CALL T) (SETQ FUN-A-CALL NIL))
|
||||
. WHO CALLS FUN-B2
|
||||
(IF (EQUAL * '(FUN-B)) (SETQ FUN-B-CALL T) (SETQ FUN-B-CALL NIL))
|
||||
(DRIBBLE '{CORE}WHO-CALLS)
|
||||
. WHO CALLS WHO
|
||||
(DRIBBLE)
|
||||
(DRIBBLE '{CORE}PATHS)
|
||||
. SHOW PATHS TO FUN-A1 FROM TOP-FUNTION
|
||||
(DRIBBLE)
|
||||
|
||||
; ERASE (erase all information about the functions in SET from the database)
|
||||
|
||||
. WHO CALLS FUN-A1
|
||||
. ERASE FUN-A
|
||||
. WHO CALLS FUN-A1
|
||||
(IF (EQUAL * '(FUN-B1)) (SETQ FUN-A-ERASED T) (SETQ FUN-A-ERASED NIL))
|
||||
(SETQ ALL-ERASED-FLG NIL)
|
||||
. ERASE
|
||||
. WHO CALLS FUN-A
|
||||
(IF (EQUAL * NIL) (PUSH T ALL-ERASED-FLG) (PUSH NIL ALL-ERASED-FLG))
|
||||
. WHO CALLS FUN-B2
|
||||
(IF (EQUAL * NIL) (PUSH T ALL-ERASED-FLG) (PUSH NIL ALL-ERASED-FLG))
|
||||
. WHO CALLS FUN-B2
|
||||
(IF (EQUAL * NIL) (PUSH T ALL-ERASED-FLG) (PUSH NIL ALL-ERASED-FLG))
|
||||
|
||||
; REANALYZE (causes masterscope to reanalyze the functions in SET)
|
||||
. ANALYZE TOP-FUNTION
|
||||
. ANALYZE FUN-A
|
||||
. ANALYZE FUN-B
|
||||
. ANALYZE FUN-B1
|
||||
. ERASE FUN-A
|
||||
. REANALYZE FUN-A
|
||||
. WHO CALLS FUN-A1
|
||||
(IF (EQUAL * '(FUN-B1 FUN-A)) (SETQ REANALYZED-FLG T) (SETQ REANALYZED-FLG NIL))
|
||||
|
||||
. ERASE
|
||||
;SET ARE SET
|
||||
|
||||
. WHO IS CALLED BY TOP-FUNTION
|
||||
(IF (EQUAL * '(FUN-A FUN-B)) (SETQ CALLED-BY-FLG T) (SETQ CALLED-BY-FLG NIL))
|
||||
|
||||
|
||||
; DESCRIBE SET (prints out the bind, use freely and call information)
|
||||
|
||||
(DEFUN FUN-DESCRIBE (X Y) (PROGN (SETQ X1 (1+ X)) (SETQ Y1 (1- Y))))
|
||||
. ANALYZE FUN-DESCRIBE
|
||||
(DRIBBLE '{CORE}DESCRIBE)
|
||||
. DESCRIBE FUN-DESCRIBE
|
||||
(DRIBBLE)
|
||||
. ERASE
|
||||
; analyzing the file that contains describe results
|
||||
(SETQ DESCRIBE-LIST '(| calls: 1+,1-| | binds: x,y| | uses free: y1,x1|))
|
||||
(SETQ DESCRIBE-FLG NIL)
|
||||
(SETQ DESCRIBE-FILE (OPEN {CORE}DESCRIBE))
|
||||
(DO (( i 0 (1+ i)))
|
||||
((= i 4) t)
|
||||
(READ-LINE DESCRIBE-FILE))
|
||||
(DOLIST (Y DESCRIBE-LIST) (IF (STRING-EQUAL Y (READ-LINE DESCRIBE-FILE))
|
||||
(PUSH T DESCRIBE-FLG)
|
||||
(PUSH NIL DESCRIBE-FLG)))
|
||||
(CLOSE DESCRIBE-FILE)
|
||||
(DELETE-FILE {CORE}DESCRIBE)
|
||||
|
||||
; analyzing the file that contains the previous masterscope interactions
|
||||
; (who calls?)
|
||||
(SETQ CALL-LIST '(|fun-b -- (fun-b1 fun-b2 fun-b3)|
|
||||
|fun-a -- (fun-a1 fun-a2 fun-a3)|
|
||||
|top-funtion -- (fun-a fun-b)|
|
||||
|fun-b1 -- (fun-c1 fun-a1)|
|
||||
))
|
||||
|
||||
(SETQ WHO-CALLS-FLG NIL)
|
||||
(SETQ WHO-CALLS (OPEN {CORE}WHO-CALLS))
|
||||
(READ-LINE WHO-CALLS)
|
||||
(READ-LINE WHO-CALLS)
|
||||
(READ-LINE WHO-CALLS)
|
||||
(DOLIST (Y CALL-LIST) (IF (STRING-EQUAL Y (READ-LINE WHO-CALLS))
|
||||
(PUSH T WHO-CALLS-FLG)
|
||||
(PUSH NIL WHO-CALLS-FLG)))
|
||||
(CLOSE WHO-CALLS)
|
||||
; analyzing the file that contains the masterscope interaction (show paths)
|
||||
(SETQ PATHS (OPEN {CORE}PATHS))
|
||||
(DO (( i 0 (1+ i)))
|
||||
((= i 5) t)
|
||||
(READ-LINE PATHS))
|
||||
|
||||
(IF (AND (STRING-EQUAL (READ-LINE PATHS) '|1.fun-a1 fun-a top-funtion|)
|
||||
(STRING-EQUAL (READ-LINE PATHS) '|2. fun-b1 fun-b top-funtion|))
|
||||
(SETQ PATHS-FLG T)(SETQ PATHS-FLG NIL))
|
||||
(CLOSE PATHS)
|
||||
(DELETE-FILE '{CORE}PATHS)
|
||||
(DELETE-FILE '{CORE}WHO-CALLS)
|
||||
(FORMAT NIL MESS1)
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IF (EQ TEST-ITEM T) (ITEM-FORMAT-S COMMAND-LANGUAGE)
|
||||
(ITEM-FORMAT-F COMMAND-LANGUAGE)))
|
||||
(SETQ TEST-END (GET-INTERNAL-RUN-TIME))
|
||||
(SETQ TOTAL-TEST-TIME (FLOAT (/ (- TEST-END TEST-START) 60000)))
|
||||
|
||||
(DO-TEST 'MASTERSCOPE-TEST-RESULT
|
||||
(PROG2 (SETQ *OUTPUT* (OPEN TEST-RESULT :DIRECTION :OUTPUT
|
||||
:IF-EXISTS :APPEND))
|
||||
(IF (AND (EQ FUN-A1-CALL T)
|
||||
(EQ TOP-FUN-CALL T)
|
||||
(EQ FUN-A-CALL T)
|
||||
(EQ FUN-B-CALL T)
|
||||
(EQ PATHS-FLG T)
|
||||
(EQ FUN-A-ERASED T)
|
||||
(NOTANY #'NULL ALL-ERASED-FLG)
|
||||
(EQ REANALYZED-FLG T)
|
||||
(EQ CALLED-BY-FLG T)
|
||||
(NOTANY #'NULL DESCRIBE-FLG)
|
||||
(NOTANY #'NULL WHO-CALLS-FLG))
|
||||
(PROGN (R-FORMAT 'SUCCESS) T)
|
||||
(PROGN (R-FORMAT 'FAIL) NIL))
|
||||
(PASS-FAIL 'WHO-CALLS
|
||||
(NOTANY #'NULL WHO-CALLS-FLG))
|
||||
(PASS-FAIL 'SHOW-PATHS PATHS-FLG)
|
||||
(PASS-FAIL 'ERASED (AND FUN-A-ERASED
|
||||
(NOTANY #'NULL ALL-ERASED-FLG)))
|
||||
(PASS-FAIL 'WHO-IS-CALLED-BY CALLED-BY-FLG)
|
||||
(PASS-FAIL 'REANALYZE REANALYZED-FLG)
|
||||
(PASS-FAIL 'DESCRIBE (NOTANY #'NULL DESCRIBE-FLG))
|
||||
(T-FORMAT TOTAL-TEST-TIME)
|
||||
(CLOSE *OUTPUT*)
|
||||
)
|
||||
)
|
||||
|
||||
")
|
||||
(IL:BKSYSBUF MASTERSCOPE-COMMAND-STRING)
|
||||
)
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,220 +0,0 @@
|
||||
;; Function To Be Tested: . (MASTERSCOPE) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lyric Release Overview (Lyric Beta Release)
|
||||
;; Section 19 (Masterscope), Page 22
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: Feb 25, 1987
|
||||
;;
|
||||
;; Last Update: March 26, 1987
|
||||
;;
|
||||
;; Somewhat Repaired: June 16, 1988
|
||||
;;
|
||||
;; Munged (as little as possible) by Rene P. S. Bane June 24, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>masterscope.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: . &rest LINE
|
||||
;;
|
||||
;; Function Description: Make a MASTERSCOPE query. Masterscope is an interactive
|
||||
;; program for analyzing and cross referencing user programs. It contains
|
||||
;; facilities for analyzing user functions to determine what other functions are
|
||||
;; called, how and where variables are bound, set, or referenced, as well as
|
||||
;; which functions use particular record declarations. Masterscope is able to
|
||||
;; analyze definitions directly from a file as well as in-core definitions.
|
||||
;; This test is almost identical to the masterscope as an exec command, which is
|
||||
;; located in {eris}<lispcore>test>exec>masterscope.u
|
||||
;;
|
||||
;; Argument(s): Masterscope commands (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Returns: (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Constraints/Limitations: Due to the nature of Programmer's Assistant commands,
|
||||
;; testing them will be performed using do-test and the interlisp function bksysfuf.
|
||||
;; Comments or messages are incorporated within
|
||||
;; each command file, which will be run by using the function bksysbuf.
|
||||
;; Each test setup is titled "MASTERSCOPE-TEST-SETUP", which executes the command
|
||||
;; string. The do-test form within the command file will return T or "test
|
||||
;; failed" This test file requires TEDIT and MASTERSCOPE package
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-Funtion
|
||||
;; |
|
||||
;; Fun-A------------------------Fun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; Fun-A1 Fun-A2 Fun-A3 Fun-B1 Fun-B2 Fun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; Fun-C1 Fun-A1
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "MASTERSCOPE-TEST-SETUP"
|
||||
;; If the browser is already loaded, undo what the browser did so this testfile
|
||||
;; will work properly, then redo it. This is relying on the browser to always
|
||||
;; affect MSPATHS, because there is no official way of undoing the browser
|
||||
;; (that I know of)
|
||||
(IL:IF (IL:GETD 'IL:OLDMSPATHS)
|
||||
IL:THEN
|
||||
(IL:MOVD 'IL:MSPATHS 'TMP-MSPATHS)
|
||||
(IL:MOVD 'IL:OLDMSPATHS 'IL:MSPATHS))
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL)
|
||||
IL:ELSE "Hey, no problem!"))
|
||||
|
||||
; Reinitialize and Define functions to be analyzed
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-FUNTION NIL (AND (FUN-A) (FUN-B)))
|
||||
(DEFUN FUN-A NIL (OR (FUN-A1) (FUN-A2) (FUN-A3)))
|
||||
(DEFUN FUN-B NIL (OR (FUN-B1) (FUN-B2) (FUN-B3)))
|
||||
(DEFUN FUN-A1 NIL T)
|
||||
(DEFUN FUN-A2 NIL NIL)
|
||||
(DEFUN FUN-A3 NIL T)
|
||||
(DEFUN FUN-B1 NIL (AND (FUN-C1)(FUN-A1)))
|
||||
(DEFUN FUN-B2 NIL NIL)
|
||||
(DEFUN FUN-B3 NIL T)
|
||||
(DEFUN FUN-C1 NIL NIL)
|
||||
; Start analyzing functions in top-function
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A1" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(PASS-FAIL "Who calls TOP-FUNTION" (NOT (IL:MASTERSCOPE '(WHO CALLS TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A)) '(TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-B2" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-B2)) '(FUN-B))))
|
||||
|
||||
(DRIBBLE '{CORE}WHO-CALLS)
|
||||
(IL:MASTERSCOPE '(WHO CALLS WHO))
|
||||
(DRIBBLE)
|
||||
|
||||
(DRIBBLE '{CORE}PATHS)
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO FUN-A1 FROM TOP-FUNTION))
|
||||
(DRIBBLE)
|
||||
|
||||
; ERASE (erase all information about the functions in SET from the database)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "All info erased" (NOT (OR (IL:MASTERSCOPE '(WHO CALLS FUN-A))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B1))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B2))
|
||||
)))
|
||||
|
||||
; REANALYZE (causes masterscope to reanalyze the functions in SET)
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
(IL:MASTERSCOPE '(ERASE FUN-A))
|
||||
(IL:MASTERSCOPE '(REANALYZE FUN-A))
|
||||
|
||||
(PASS-FAIL "Reanalyzing" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "Called-by (reanalyzing too)" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO IS CALLED BY TOP-FUNTION)) '(FUN-A FUN-B))))
|
||||
|
||||
|
||||
; DESCRIBE SET (prints out the bind, use freely and call information)
|
||||
|
||||
(DEFUN FUN-DESCRIBE (X Y) (PROGN (SETQ X1 (1+ X)) (SETQ Y1 (1- Y))))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-DESCRIBE))
|
||||
(DRIBBLE '{CORE}DESCRIBE)
|
||||
(IL:MASTERSCOPE '(DESCRIBE FUN-DESCRIBE))
|
||||
(DRIBBLE)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
; analyzing the file that contains hopefully correct results
|
||||
(SETQ DESCRIBE-FLG NIL)
|
||||
(SETQ DESCRIBE-FILE (OPEN "{CORE}DESCRIBE"))
|
||||
;; Yeeuck. Awful test, relies on Masterscope returning exactly the characters
|
||||
;; expected. At least now it doesn't require the exact number of spaces....Rene
|
||||
;; p.s. premature EOF will return a NIL so however John Parks meant to determine
|
||||
;; if the test failed will still work, supposedly. I mean, true or false results
|
||||
;; are still pushed onto DESCRIBE-FLG, for whatever reason they're supposed to be
|
||||
;; pushed.
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE DESCRIBE-FILE NIL 'EOF))))
|
||||
(NOT (SEARCH "calls" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Describe"
|
||||
(AND (STRING-EQUAL "calls:1+,1-" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "binds:X,Y" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
(STRING-EQUAL "usesfree:Y1,X1" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE DESCRIBE-FILE)
|
||||
(DELETE-FILE "{CORE}DESCRIBE")
|
||||
|
||||
; analyzing the file that contains the previous masterscope interactions
|
||||
; (who calls?)
|
||||
|
||||
(SETQ WHO-CALLS (OPEN "{CORE}WHO-CALLS"))
|
||||
;; Another test which replaces the previous "throw away the first three lines
|
||||
;; no matter what" and ignores spaces. See comment for the DESCRIBE test. There
|
||||
;; MUST be a better way! And >>I<< didn't spell "funtion" that way....Rene
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE WHO-CALLS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Who calls...? (analyzing)"
|
||||
(AND
|
||||
(STRING-EQUAL "top-funtion--(fun-afun-b)" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "FUN-B1--(FUN-C1FUN-A1)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
(STRING-EQUAL "FUN-B--(FUN-B1FUN-B2FUN-B3)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
(STRING-EQUAL "FUN-A--(FUN-A1FUN-A2FUN-A3)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE WHO-CALLS)
|
||||
(DELETE-FILE "{CORE}WHO-CALLS")
|
||||
|
||||
; analyzing the file that contains the masterscope interaction (show paths)
|
||||
(SETQ PATHS (OPEN "{CORE}PATHS"))
|
||||
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE PATHS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Show paths (would-be graph)"
|
||||
(AND
|
||||
|
||||
(STRING-EQUAL "1.FUN-A1FUN-ATOP-FUNTION" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "2.FUN-B1FUN-BTOP-FUNTION" (DELETE #\Space (READ-LINE PATHS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE PATHS)
|
||||
(DELETE-FILE "{CORE}PATHS")
|
||||
|
||||
;; if the browser was loaded, reset MSPATHS so it looks loaded again
|
||||
(IL:IF (IL:GETD 'OLDMSPATHS)
|
||||
IL:THEN (IL:MOVD 'TMP-MSPATHS 'IL:MSPATHS))
|
||||
|
||||
TEST-SUCCEEDED
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
;; Function To Be Tested: . (MASTERSCOPE) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lyric Release Overview (Lyric Beta Release)
|
||||
;; Section 19 (Masterscope), Page 22
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: Feb 25, 1987
|
||||
;;
|
||||
;; Last Update: March 26, 1987
|
||||
;;
|
||||
;; Massively munged by Rene P. S. Bane June 24, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>masterscope.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: . &rest LINE
|
||||
;;
|
||||
;; Function Description: Make a MASTERSCOPE query. Masterscope is an interactive
|
||||
;; program for analyzing and cross referencing user programs. It contains
|
||||
;; facilities for analyzing user functions to determine what other functions are
|
||||
;; called, how and where variables are bound, set, or referenced, as well as
|
||||
;; which functions use particular record declarations. Masterscope is able to
|
||||
;; analyze definitions directly from a file as well as in-core definitions.
|
||||
;; This test is almost identical to the masterscope as an exec command, which is
|
||||
;; located in {eris}<lispcore>test>exec>masterscope.u
|
||||
;;
|
||||
;; Argument(s): Masterscope commands (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Returns: (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Constraints/Limitations: Due to the nature of Programmer's Assistant commands,
|
||||
;; testing them will be performed using do-test and the interlisp function bksysfuf.
|
||||
;; Comments or messages are incorporated within
|
||||
;; each command file, which will be run by using the function bksysbuf.
|
||||
;; Each test setup is titled "MASTERSCOPE-TEST-SETUP", which executes the command
|
||||
;; string. The do-test form within the command file will return T or "test
|
||||
;; failed" This test file requires TEDIT and MASTERSCOPE package
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-Funtion
|
||||
;; |
|
||||
;; Fun-A------------------------Fun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; Fun-A1 Fun-A2 Fun-A3 Fun-B1 Fun-B2 Fun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; Fun-C1 Fun-A1
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "MASTERSCOPE-TEST-SETUP"
|
||||
;; If the browser is already loaded, undo what the browser did so this testfile
|
||||
;; will work properly, then redo it. This is relying on the browser to always
|
||||
;; affect MSPATHS, because there is no official way of undoing the browser
|
||||
;; (that I know of)
|
||||
(IL:IF (IL:GETD 'IL:OLDMSPATHS)
|
||||
IL:THEN
|
||||
(IL:MOVD 'IL:MSPATHS 'TMP-MSPATHS)
|
||||
(IL:MOVD 'IL:OLDMSPATHS 'IL:MSPATHS))
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL)
|
||||
IL:ELSE "Hey, no problem!"))
|
||||
|
||||
; Reinitialize and Define functions to be analyzed
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-FUNTION NIL (AND (FUN-A) (FUN-B)))
|
||||
(DEFUN FUN-A NIL (OR (FUN-A1) (FUN-A2) (FUN-A3)))
|
||||
(DEFUN FUN-B NIL (OR (FUN-B1) (FUN-B2) (FUN-B3)))
|
||||
(DEFUN FUN-A1 NIL T)
|
||||
(DEFUN FUN-A2 NIL NIL)
|
||||
(DEFUN FUN-A3 NIL T)
|
||||
(DEFUN FUN-B1 NIL (AND (FUN-C1)(FUN-A1)))
|
||||
(DEFUN FUN-B2 NIL NIL)
|
||||
(DEFUN FUN-B3 NIL T)
|
||||
(DEFUN FUN-C1 NIL NIL)
|
||||
; Start analyzing functions in top-function
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A1" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(PASS-FAIL "Who calls TOP-FUNTION" (NOT (IL:MASTERSCOPE '(WHO CALLS TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A)) '(TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-B2" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-B2)) '(FUN-B))))
|
||||
|
||||
(DRIBBLE '{CORE}WHO-CALLS)
|
||||
(IL:MASTERSCOPE '(WHO CALLS WHO))
|
||||
(DRIBBLE)
|
||||
|
||||
(DRIBBLE '{CORE}PATHS)
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO FUN-A1 FROM TOP-FUNTION))
|
||||
(DRIBBLE)
|
||||
|
||||
; ERASE (erase all information about the functions in SET from the database)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "All info erased" (NOT (OR (IL:MASTERSCOPE '(WHO CALLS FUN-A))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B1))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B2))
|
||||
)))
|
||||
|
||||
; REANALYZE (causes masterscope to reanalyze the functions in SET)
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
(IL:MASTERSCOPE '(ERASE FUN-A))
|
||||
(IL:MASTERSCOPE '(REANALYZE FUN-A))
|
||||
|
||||
(PASS-FAIL "Reanalyzing" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "Called-by (reanalyzing too)" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO IS CALLED BY TOP-FUNTION)) '(FUN-A FUN-B))))
|
||||
|
||||
|
||||
; DESCRIBE SET (prints out the bind, use freely and call information)
|
||||
|
||||
(DEFUN FUN-DESCRIBE (X Y) (SETQ X1 (1+ X)) (SETQ Y1 (1- Y)))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-DESCRIBE))
|
||||
(DRIBBLE '{CORE}DESCRIBE)
|
||||
(IL:MASTERSCOPE '(DESCRIBE FUN-DESCRIBE))
|
||||
(DRIBBLE)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
; analyzing the file that contains hopefully correct results
|
||||
(SETQ DESCRIBE-FLG NIL)
|
||||
(SETQ DESCRIBE-FILE (OPEN "{CORE}DESCRIBE"))
|
||||
;; Yeeuck. Awful test, relies on Masterscope returning exactly the characters
|
||||
;; expected. At least now it doesn't require the exact number of spaces....Rene
|
||||
;; p.s. premature EOF will return a NIL so however John Parks meant to determine
|
||||
;; if the test failed will still work, supposedly. I mean, true or false results
|
||||
;; are still pushed onto DESCRIBE-FLG, for whatever reason they're supposed to be
|
||||
;; pushed.
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE DESCRIBE-FILE NIL 'EOF))))
|
||||
(NOT (SEARCH "calls" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Describe"
|
||||
(AND (STRING-EQUAL "calls:1+,1-" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "binds:X,Y" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
(STRING-EQUAL "usesfree:Y1,X1" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE DESCRIBE-FILE)
|
||||
(DELETE-FILE "{CORE}DESCRIBE")
|
||||
|
||||
; analyzing the file that contains the previous masterscope interactions
|
||||
; (who calls?)
|
||||
|
||||
(SETQ WHO-CALLS (OPEN "{CORE}WHO-CALLS"))
|
||||
;; Another test which replaces the previous "throw away the first three lines
|
||||
;; no matter what" and ignores spaces. See comment for the DESCRIBE test. There
|
||||
;; MUST be a better way! And >>I<< didn't spell "funtion" that way....Rene
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE WHO-CALLS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Who calls...? (analyzing)"
|
||||
(AND
|
||||
(STRING-EQUAL "top-funtion--(fun-afun-b)" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "FUN-B1--(FUN-C1FUN-A1)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
(STRING-EQUAL "FUN-B--(FUN-B1FUN-B2FUN-B3)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
(STRING-EQUAL "FUN-A--(FUN-A1FUN-A2FUN-A3)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE WHO-CALLS)
|
||||
(DELETE-FILE "{CORE}WHO-CALLS")
|
||||
|
||||
; analyzing the file that contains the masterscope interaction (show paths)
|
||||
(SETQ PATHS (OPEN "{CORE}PATHS"))
|
||||
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE PATHS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Show paths (would-be graph)"
|
||||
(AND
|
||||
|
||||
(STRING-EQUAL "1.FUN-A1FUN-ATOP-FUNTION" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "2.FUN-B1FUN-BTOP-FUNTION" (DELETE #\Space (READ-LINE PATHS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE PATHS)
|
||||
(DELETE-FILE "{CORE}PATHS")
|
||||
|
||||
;; if the browser was loaded, reset MSPATHS so it looks loaded again
|
||||
(IL:IF (IL:GETD 'OLDMSPATHS)
|
||||
IL:THEN (IL:MOVD 'TMP-MSPATHS 'IL:MSPATHS))
|
||||
|
||||
TEST-SUCCEEDED
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,216 +0,0 @@
|
||||
;; Function To Be Tested: . (MASTERSCOPE) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lyric Release Overview (Lyric Beta Release)
|
||||
;; Section 19 (Masterscope), Page 22
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: Feb 25, 1987
|
||||
;;
|
||||
;; Last Update: March 26, 1987
|
||||
;;
|
||||
;; Massively munged by Rene P. S. Bane June 24, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>masterscope.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: . &rest LINE
|
||||
;;
|
||||
;; Function Description: Make a MASTERSCOPE query. Masterscope is an interactive
|
||||
;; program for analyzing and cross referencing user programs. It contains
|
||||
;; facilities for analyzing user functions to determine what other functions are
|
||||
;; called, how and where variables are bound, set, or referenced, as well as
|
||||
;; which functions use particular record declarations. Masterscope is able to
|
||||
;; analyze definitions directly from a file as well as in-core definitions.
|
||||
;; This test is almost identical to the masterscope as an exec command, which is
|
||||
;; located in {eris}<lispcore>test>exec>masterscope.u
|
||||
;;
|
||||
;; Argument(s): Masterscope commands (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Returns: (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Constraints/Limitations: Due to the nature of Programmer's Assistant commands,
|
||||
;; testing them will be performed using do-test and the interlisp function bksysfuf.
|
||||
;; Comments or messages are incorporated within
|
||||
;; each command file, which will be run by using the function bksysbuf.
|
||||
;; Each test setup is titled "MASTERSCOPE-TEST-SETUP", which executes the command
|
||||
;; string. The do-test form within the command file will return T or "test
|
||||
;; failed" This test file requires TEDIT and MASTERSCOPE package
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-Funtion
|
||||
;; |
|
||||
;; Fun-A------------------------Fun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; Fun-A1 Fun-A2 Fun-A3 Fun-B1 Fun-B2 Fun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; Fun-C1 Fun-A1
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "MASTERSCOPE-TEST-SETUP"
|
||||
;; If the browser is already loaded, undo what the browser did so this testfile
|
||||
;; will work properly, then redo it. This is relying on the browser to always
|
||||
;; affect MSPATHS, because there is no official way of undoing the browser
|
||||
;; (that I know of)
|
||||
(IL:IF (IL:GETD 'IL:OLDMSPATHS)
|
||||
IL:THEN
|
||||
(IL:MOVD 'IL:MSPATHS 'TMP-MSPATHS)
|
||||
(IL:MOVD 'IL:OLDMSPATHS 'IL:MSPATHS))
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL)
|
||||
IL:ELSE "Hey, no problem!"))
|
||||
|
||||
; Reinitialize and Define functions to be analyzed
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-FUNTION NIL (AND (FUN-A) (FUN-B)))
|
||||
(DEFUN FUN-A NIL (OR (FUN-A1) (FUN-A2) (FUN-A3)))
|
||||
(DEFUN FUN-B NIL (OR (FUN-B1) (FUN-B2) (FUN-B3)))
|
||||
(DEFUN FUN-A1 NIL T)
|
||||
(DEFUN FUN-A2 NIL NIL)
|
||||
(DEFUN FUN-A3 NIL T)
|
||||
(DEFUN FUN-B1 NIL (AND (FUN-C1)(FUN-A1)))
|
||||
(DEFUN FUN-B2 NIL NIL)
|
||||
(DEFUN FUN-B3 NIL T)
|
||||
(DEFUN FUN-C1 NIL NIL)
|
||||
; Start analyzing functions in top-function
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A1" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(PASS-FAIL "Who calls TOP-FUNTION" (NOT (IL:MASTERSCOPE '(WHO CALLS TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A)) '(TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-B2" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-B2)) '(FUN-B))))
|
||||
|
||||
(DRIBBLE '{CORE}WHO-CALLS)
|
||||
(IL:MASTERSCOPE '(WHO CALLS WHO))
|
||||
(DRIBBLE)
|
||||
|
||||
(DRIBBLE '{CORE}PATHS)
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO FUN-A1 FROM TOP-FUNTION))
|
||||
(DRIBBLE)
|
||||
|
||||
; ERASE (erase all information about the functions in SET from the database)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "All info erased" (NOT (OR (IL:MASTERSCOPE '(WHO CALLS FUN-A))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B1))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B2))
|
||||
)))
|
||||
|
||||
; REANALYZE (causes masterscope to reanalyze the functions in SET)
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
(IL:MASTERSCOPE '(ERASE FUN-A))
|
||||
(IL:MASTERSCOPE '(REANALYZE FUN-A))
|
||||
|
||||
(PASS-FAIL "Reanalyzing" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "Called-by (reanalyzing too)" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO IS CALLED BY TOP-FUNTION)) '(FUN-A FUN-B))))
|
||||
|
||||
|
||||
; DESCRIBE SET (prints out the bind, use freely and call information)
|
||||
|
||||
(DEFUN FUN-DESCRIBE (X Y) (SETQ X1 (1+ X)) (SETQ Y1 (1- Y)))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-DESCRIBE))
|
||||
(DRIBBLE '{CORE}DESCRIBE)
|
||||
(IL:MASTERSCOPE '(DESCRIBE FUN-DESCRIBE))
|
||||
(DRIBBLE)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
; analyzing the file that contains hopefully correct results
|
||||
(SETQ DESCRIBE-FLG NIL)
|
||||
(SETQ DESCRIBE-FILE (OPEN "{CORE}DESCRIBE"))
|
||||
|
||||
;; Yeeuck. Awful test, relies on Masterscope returning exactly the characters
|
||||
;; expected. At least now it doesn't require the exact number of spaces....Rene
|
||||
;; p.s. premature EOF will return a NIL, so that will count as failure as well.
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE DESCRIBE-FILE NIL 'EOF))))
|
||||
(NOT (SEARCH "calls" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Describe"
|
||||
(AND (STRING-EQUAL "calls:1+,1-" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "binds:X,Y" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
(STRING-EQUAL "usesfree:Y1,X1" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE DESCRIBE-FILE)
|
||||
(DELETE-FILE "{CORE}DESCRIBE")
|
||||
|
||||
; analyzing the file that contains the previous masterscope interactions
|
||||
; (who calls?)
|
||||
|
||||
(SETQ WHO-CALLS (OPEN "{CORE}WHO-CALLS"))
|
||||
;; Another test which replaces the previous "throw away the first three lines
|
||||
;; no matter what" and ignores spaces. See comment for the DESCRIBE test. There
|
||||
;; MUST be a better way! And >>I<< didn't spell "funtion" that way....Rene
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE WHO-CALLS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Who calls...? (analyzing)"
|
||||
(AND
|
||||
(STRING-EQUAL "top-funtion--(fun-afun-b)" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "FUN-B1--(FUN-C1FUN-A1)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
(STRING-EQUAL "FUN-B--(FUN-B1FUN-B2FUN-B3)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
(STRING-EQUAL "FUN-A--(FUN-A1FUN-A2FUN-A3)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE WHO-CALLS)
|
||||
(DELETE-FILE "{CORE}WHO-CALLS")
|
||||
|
||||
; analyzing the file that contains the masterscope interaction (show paths)
|
||||
(SETQ PATHS (OPEN "{CORE}PATHS"))
|
||||
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE PATHS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Show paths (would-be graph)"
|
||||
(AND
|
||||
|
||||
(STRING-EQUAL "1.FUN-A1FUN-ATOP-FUNTION" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "2.FUN-B1FUN-BTOP-FUNTION" (DELETE #\Space (READ-LINE PATHS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE PATHS)
|
||||
(DELETE-FILE "{CORE}PATHS")
|
||||
|
||||
;; if the browser was loaded, reset MSPATHS so it looks loaded again
|
||||
(IL:IF (IL:GETD 'OLDMSPATHS)
|
||||
IL:THEN (IL:MOVD 'TMP-MSPATHS 'IL:MSPATHS))
|
||||
|
||||
TEST-SUCCEEDED
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,233 +0,0 @@
|
||||
;; Function To Be Tested: . (MASTERSCOPE) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lyric Release Overview (Lyric Beta Release)
|
||||
;; Section 19 (Masterscope), Page 22
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: Feb 25, 1987
|
||||
;;
|
||||
;; Last Update: March 26, 1987
|
||||
;;
|
||||
;; Massively munged by Rene P. S. Bane June 24, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>masterscope.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: . &rest LINE
|
||||
;;
|
||||
;; Function Description: Make a MASTERSCOPE query. Masterscope is an interactive
|
||||
;; program for analyzing and cross referencing user programs. It contains
|
||||
;; facilities for analyzing user functions to determine what other functions are
|
||||
;; called, how and where variables are bound, set, or referenced, as well as
|
||||
;; which functions use particular record declarations. Masterscope is able to
|
||||
;; analyze definitions directly from a file as well as in-core definitions.
|
||||
;; This test is almost identical to the masterscope as an exec command, which is
|
||||
;; located in {eris}<lispcore>test>exec>masterscope.u
|
||||
;;
|
||||
;; Argument(s): Masterscope commands (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Returns: (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Constraints/Limitations: Due to the nature of Programmer's Assistant commands,
|
||||
;; testing them will be performed using do-test and the interlisp function bksysfuf.
|
||||
;; Comments or messages are incorporated within
|
||||
;; each command file, which will be run by using the function bksysbuf.
|
||||
;; Each test setup is titled "MASTERSCOPE-TEST-SETUP", which executes the command
|
||||
;; string. The do-test form within the command file will return T or "test
|
||||
;; failed" This test file requires TEDIT and MASTERSCOPE package
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-Funtion
|
||||
;; |
|
||||
;; Fun-A------------------------Fun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; Fun-A1 Fun-A2 Fun-A3 Fun-B1 Fun-B2 Fun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; Fun-C1 Fun-A1
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "MASTERSCOPE-TEST-SETUP"
|
||||
;; If the browser is already loaded, undo what the browser did so this testfile
|
||||
;; will work properly, then redo it. This is relying on the browser to always
|
||||
;; affect MSPATHS, because there is no official way of undoing the browser
|
||||
;; (that I know of)
|
||||
(IL:IF (IL:GETD 'IL:OLDMSPATHS)
|
||||
IL:THEN
|
||||
(IL:MOVD 'IL:MSPATHS 'TMP-MSPATHS)
|
||||
(IL:MOVD 'IL:OLDMSPATHS 'IL:MSPATHS))
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL)
|
||||
IL:ELSE "Hey, no problem!"))
|
||||
|
||||
; Reinitialize and Define functions to be analyzed
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-FUNTION NIL (AND (FUN-A) (FUN-B)))
|
||||
(DEFUN FUN-A NIL (OR (FUN-A1) (FUN-A2) (FUN-A3)))
|
||||
(DEFUN FUN-B NIL (OR (FUN-B1) (FUN-B2) (FUN-B3)))
|
||||
(DEFUN FUN-A1 NIL T)
|
||||
(DEFUN FUN-A2 NIL NIL)
|
||||
(DEFUN FUN-A3 NIL T)
|
||||
(DEFUN FUN-B1 NIL (AND (FUN-C1)(FUN-A1)))
|
||||
(DEFUN FUN-B2 NIL NIL)
|
||||
(DEFUN FUN-B3 NIL T)
|
||||
(DEFUN FUN-C1 NIL NIL)
|
||||
; Start analyzing functions in top-function
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A1" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(PASS-FAIL "Who calls TOP-FUNTION" (NOT (IL:MASTERSCOPE '(WHO CALLS TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A)) '(TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-B2" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-B2)) '(FUN-B))))
|
||||
|
||||
(DRIBBLE '{CORE}WHO-CALLS)
|
||||
(IL:MASTERSCOPE '(WHO CALLS WHO))
|
||||
(DRIBBLE)
|
||||
|
||||
(DRIBBLE '{CORE}PATHS)
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO FUN-A1 FROM TOP-FUNTION))
|
||||
(DRIBBLE)
|
||||
|
||||
; ERASE (erase all information about the functions in SET from the database)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "All info erased" (NOT (OR (IL:MASTERSCOPE '(WHO CALLS FUN-A))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B1))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B2))
|
||||
)))
|
||||
|
||||
; REANALYZE (causes masterscope to reanalyze the functions in SET)
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
(IL:MASTERSCOPE '(ERASE FUN-A))
|
||||
(IL:MASTERSCOPE '(REANALYZE FUN-A))
|
||||
|
||||
(PASS-FAIL "Reanalyzing" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "Called-by (reanalyzing too)" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO IS CALLED BY TOP-FUNTION)) '(FUN-A FUN-B))))
|
||||
|
||||
|
||||
; DESCRIBE SET (prints out the bind, use freely and call information)
|
||||
|
||||
(DEFUN FUN-DESCRIBE (X Y) (SETQ X1 (1+ X)) (SETQ Y1 (1- Y)))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-DESCRIBE))
|
||||
(DRIBBLE '{CORE}DESCRIBE)
|
||||
(IL:MASTERSCOPE '(DESCRIBE FUN-DESCRIBE))
|
||||
(DRIBBLE)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
; analyzing the file that contains hopefully correct results
|
||||
(SETQ DESCRIBE-FLG NIL)
|
||||
(SETQ DESCRIBE-FILE (OPEN "{CORE}DESCRIBE"))
|
||||
|
||||
;; Yeeuck. Awful test, relies on Masterscope returning exactly the characters
|
||||
;; expected. At least now it doesn't require the exact number of spaces....Rene
|
||||
;; p.s. premature EOF will return a NIL, so that will count as failure as well.
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE DESCRIBE-FILE NIL 'EOF))))
|
||||
(NOT (SEARCH "calls" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Describe"
|
||||
(AND (STRING-EQUAL "calls:1+,1-" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "binds:X,Y" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
(STRING-EQUAL "usesfree:Y1,X1" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE DESCRIBE-FILE)
|
||||
(DELETE-FILE "{CORE}DESCRIBE")
|
||||
|
||||
; analyzing the file that contains the previous masterscope interactions
|
||||
; (who calls?)
|
||||
|
||||
(SETQ WHO-CALLS (OPEN "{CORE}WHO-CALLS"))
|
||||
;; Another test which replaces the previous "throw away the first three lines
|
||||
;; no matter what" and ignores spaces. See comment for the DESCRIBE test. There
|
||||
;; MUST be a better way! And >>I<< didn't spell "funtion" that way....Rene
|
||||
;; JRB - a feature of who calls who is that the order in which the calling information
|
||||
;; comes out is dependent on the order things got analyzed in. Things get reanalyzed
|
||||
;; by Masterscope itself all the time, in whatever order Masterscope feels like doing it.
|
||||
;; What you really have to do here is suck in all the lines and do a SET-EXCLUSIVE-OR
|
||||
'' between two lists of strings; yuck**2.
|
||||
(LET (ALL-LINES NEXT-LINE)
|
||||
;; First suck in the lines
|
||||
(IL:WHILE (NOT (EQ 'EOF (SETQ NEXT-LINE (READ-LINE WHO-CALLS NIL 'EOF))))
|
||||
IL:DO (PUSH (DELETE #\Space NEXT-LINE) ALL-LINES))
|
||||
;; Then compare them
|
||||
(PASS-FAIL "Who calls...? (analyzing)"
|
||||
(NOT (SET-EXCLUSIVE-OR ALL-LINES
|
||||
'("top-funtion--(fun-afun-b)"
|
||||
"FUN-B1--(FUN-C1FUN-A1)"
|
||||
"FUN-B--(FUN-B1FUN-B2FUN-B3)"
|
||||
"FUN-A--(FUN-A1FUN-A2FUN-A3)")
|
||||
:TEST #'STRING-EQUAL))))
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE WHO-CALLS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Who calls...? (analyzing)"
|
||||
(AND
|
||||
(STRING-EQUAL "top-funtion--(fun-afun-b)" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "FUN-B1--(FUN-C1FUN-A1)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
(STRING-EQUAL "FUN-B--(FUN-B1FUN-B2FUN-B3)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
(STRING-EQUAL "FUN-A--(FUN-A1FUN-A2FUN-A3)" (DELETE #\Space (READ-LINE WHO-CALLS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE WHO-CALLS)
|
||||
(DELETE-FILE "{CORE}WHO-CALLS")
|
||||
|
||||
; analyzing the file that contains the masterscope interaction (show paths)
|
||||
(SETQ PATHS (OPEN "{CORE}PATHS"))
|
||||
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE PATHS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Show paths (would-be graph)"
|
||||
(AND
|
||||
|
||||
(STRING-EQUAL "1.FUN-A1FUN-ATOP-FUNTION" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "2.FUN-B1FUN-BTOP-FUNTION" (DELETE #\Space (READ-LINE PATHS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE PATHS)
|
||||
(DELETE-FILE "{CORE}PATHS")
|
||||
|
||||
;; if the browser was loaded, reset MSPATHS so it looks loaded again
|
||||
(IL:IF (IL:GETD 'OLDMSPATHS)
|
||||
IL:THEN (IL:MOVD 'TMP-MSPATHS 'IL:MSPATHS))
|
||||
|
||||
TEST-SUCCEEDED
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,220 +0,0 @@
|
||||
;; Function To Be Tested: . (MASTERSCOPE) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lyric Release Overview (Lyric Beta Release)
|
||||
;; Section 19 (Masterscope), Page 22
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: Feb 25, 1987
|
||||
;;
|
||||
;; Last Update: March 26, 1987
|
||||
;;
|
||||
;; Massively munged by Rene P. S. Bane June 24, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>masterscope.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: . &rest LINE
|
||||
;;
|
||||
;; Function Description: Make a MASTERSCOPE query. Masterscope is an interactive
|
||||
;; program for analyzing and cross referencing user programs. It contains
|
||||
;; facilities for analyzing user functions to determine what other functions are
|
||||
;; called, how and where variables are bound, set, or referenced, as well as
|
||||
;; which functions use particular record declarations. Masterscope is able to
|
||||
;; analyze definitions directly from a file as well as in-core definitions.
|
||||
;; This test is almost identical to the masterscope as an exec command, which is
|
||||
;; located in {eris}<lispcore>test>exec>masterscope.u
|
||||
;;
|
||||
;; Argument(s): Masterscope commands (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Returns: (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Constraints/Limitations: Due to the nature of Programmer's Assistant commands,
|
||||
;; testing them will be performed using do-test and the interlisp function bksysfuf.
|
||||
;; Comments or messages are incorporated within
|
||||
;; each command file, which will be run by using the function bksysbuf.
|
||||
;; Each test setup is titled "MASTERSCOPE-TEST-SETUP", which executes the command
|
||||
;; string. The do-test form within the command file will return T or "test
|
||||
;; failed" This test file requires TEDIT and MASTERSCOPE package
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-Funtion
|
||||
;; |
|
||||
;; Fun-A------------------------Fun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; Fun-A1 Fun-A2 Fun-A3 Fun-B1 Fun-B2 Fun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; Fun-C1 Fun-A1
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "MASTERSCOPE-TEST-SETUP"
|
||||
;; If the browser is already loaded, undo what the browser did so this testfile
|
||||
;; will work properly, then redo it. This is relying on the browser to always
|
||||
;; affect MSPATHS, because there is no official way of undoing the browser
|
||||
;; (that I know of)
|
||||
(IL:IF (IL:GETD 'IL:OLDMSPATHS)
|
||||
IL:THEN
|
||||
(IL:MOVD 'IL:MSPATHS 'TMP-MSPATHS)
|
||||
(IL:MOVD 'IL:OLDMSPATHS 'IL:MSPATHS))
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL)
|
||||
IL:ELSE "Hey, no problem!"))
|
||||
|
||||
; Reinitialize and Define functions to be analyzed
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-FUNTION NIL (AND (FUN-A) (FUN-B)))
|
||||
(DEFUN FUN-A NIL (OR (FUN-A1) (FUN-A2) (FUN-A3)))
|
||||
(DEFUN FUN-B NIL (OR (FUN-B1) (FUN-B2) (FUN-B3)))
|
||||
(DEFUN FUN-A1 NIL T)
|
||||
(DEFUN FUN-A2 NIL NIL)
|
||||
(DEFUN FUN-A3 NIL T)
|
||||
(DEFUN FUN-B1 NIL (AND (FUN-C1)(FUN-A1)))
|
||||
(DEFUN FUN-B2 NIL NIL)
|
||||
(DEFUN FUN-B3 NIL T)
|
||||
(DEFUN FUN-C1 NIL NIL)
|
||||
; Start analyzing functions in top-function
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A1" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(PASS-FAIL "Who calls TOP-FUNTION" (NOT (IL:MASTERSCOPE '(WHO CALLS TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A)) '(TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-B2" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-B2)) '(FUN-B))))
|
||||
|
||||
(DRIBBLE '{CORE}WHO-CALLS)
|
||||
(IL:MASTERSCOPE '(WHO CALLS WHO))
|
||||
(DRIBBLE)
|
||||
|
||||
(DRIBBLE '{CORE}PATHS)
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO FUN-A1 FROM TOP-FUNTION))
|
||||
(DRIBBLE)
|
||||
|
||||
; ERASE (erase all information about the functions in SET from the database)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "All info erased" (NOT (OR (IL:MASTERSCOPE '(WHO CALLS FUN-A))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B1))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B2))
|
||||
)))
|
||||
|
||||
; REANALYZE (causes masterscope to reanalyze the functions in SET)
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
(IL:MASTERSCOPE '(ERASE FUN-A))
|
||||
(IL:MASTERSCOPE '(REANALYZE FUN-A))
|
||||
|
||||
(PASS-FAIL "Reanalyzing" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "Called-by (reanalyzing too)" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO IS CALLED BY TOP-FUNTION)) '(FUN-A FUN-B))))
|
||||
|
||||
|
||||
; DESCRIBE SET (prints out the bind, use freely and call information)
|
||||
|
||||
(DEFUN FUN-DESCRIBE (X Y) (SETQ X1 (1+ X)) (SETQ Y1 (1- Y)))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-DESCRIBE))
|
||||
(DRIBBLE '{CORE}DESCRIBE)
|
||||
(IL:MASTERSCOPE '(DESCRIBE FUN-DESCRIBE))
|
||||
(DRIBBLE)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
; analyzing the file that contains hopefully correct results
|
||||
(SETQ DESCRIBE-FLG NIL)
|
||||
(SETQ DESCRIBE-FILE (OPEN "{CORE}DESCRIBE"))
|
||||
|
||||
;; Yeeuck. Awful test, relies on Masterscope returning exactly the characters
|
||||
;; expected. At least now it doesn't require the exact number of spaces....Rene
|
||||
;; p.s. premature EOF will return a NIL, so that will count as failure as well.
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE DESCRIBE-FILE NIL 'EOF))))
|
||||
(NOT (SEARCH "calls" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Describe"
|
||||
(AND (STRING-EQUAL "calls:1+,1-" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "binds:X,Y" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
(STRING-EQUAL "usesfree:Y1,X1" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE DESCRIBE-FILE)
|
||||
(DELETE-FILE "{CORE}DESCRIBE")
|
||||
|
||||
; analyzing the file that contains the previous masterscope interactions
|
||||
; (who calls?)
|
||||
|
||||
(SETQ WHO-CALLS (OPEN "{CORE}WHO-CALLS"))
|
||||
;; Another test which replaces the previous "throw away the first three lines
|
||||
;; no matter what" and ignores spaces. See comment for the DESCRIBE test. There
|
||||
;; MUST be a better way! And >>I<< didn't spell "funtion" that way....Rene
|
||||
;; JRB - a feature of who calls who is that the order in which the calling information
|
||||
;; comes out is dependent on the order things got analyzed in. Things get reanalyzed
|
||||
;; by Masterscope itself all the time, in whatever order Masterscope feels like doing it.
|
||||
;; What you really have to do here is suck in all the lines and do a SET-EXCLUSIVE-OR
|
||||
'' between two lists of strings; yuck**2.
|
||||
(LET (ALL-LINES NEXT-LINE)
|
||||
;; First suck in the lines
|
||||
(IL:WHILE (NOT (EQ 'EOF (SETQ NEXT-LINE (READ-LINE WHO-CALLS NIL 'EOF))))
|
||||
IL:DO (PUSH (DELETE #\Space NEXT-LINE) ALL-LINES))
|
||||
;; Then compare them
|
||||
(PASS-FAIL "Who calls...? (analyzing)"
|
||||
(NOT (SET-EXCLUSIVE-OR ALL-LINES
|
||||
'("top-funtion--(fun-afun-b)"
|
||||
"FUN-B1--(FUN-C1FUN-A1)"
|
||||
"FUN-B--(FUN-B1FUN-B2FUN-B3)"
|
||||
"FUN-A--(FUN-A1FUN-A2FUN-A3)")
|
||||
:TEST #'STRING-EQUAL))))
|
||||
|
||||
(CLOSE WHO-CALLS)
|
||||
(DELETE-FILE "{CORE}WHO-CALLS")
|
||||
|
||||
; analyzing the file that contains the masterscope interaction (show paths)
|
||||
(SETQ PATHS (OPEN "{CORE}PATHS"))
|
||||
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE PATHS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Show paths (would-be graph)"
|
||||
(AND
|
||||
|
||||
(STRING-EQUAL "1.FUN-A1FUN-ATOP-FUNTION" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "2.FUN-B1FUN-BTOP-FUNTION" (DELETE #\Space (READ-LINE PATHS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE PATHS)
|
||||
(DELETE-FILE "{CORE}PATHS")
|
||||
|
||||
;; if the browser was loaded, reset MSPATHS so it looks loaded again
|
||||
(IL:IF (IL:GETD 'OLDMSPATHS)
|
||||
IL:THEN (IL:MOVD 'TMP-MSPATHS 'IL:MSPATHS))
|
||||
|
||||
TEST-SUCCEEDED
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,220 +0,0 @@
|
||||
;; Function To Be Tested: . (MASTERSCOPE) (Program Analysis)
|
||||
;;
|
||||
;; Source: Lyric Release Overview (Lyric Beta Release)
|
||||
;; Section 19 (Masterscope), Page 22
|
||||
;; Section: Program Analysis
|
||||
;;
|
||||
;; Created By: John Park
|
||||
;;
|
||||
;; Creation Date: Feb 25, 1987
|
||||
;;
|
||||
;; Last Update: March 26, 1987
|
||||
;;
|
||||
;; Massively munged by Rene P. S. Bane June 24, 1988
|
||||
;;
|
||||
;; Filed As: {ERIS}<lispcore>test>program-analysis>masterscope.u
|
||||
;;
|
||||
;;
|
||||
;; Syntax: . &rest LINE
|
||||
;;
|
||||
;; Function Description: Make a MASTERSCOPE query. Masterscope is an interactive
|
||||
;; program for analyzing and cross referencing user programs. It contains
|
||||
;; facilities for analyzing user functions to determine what other functions are
|
||||
;; called, how and where variables are bound, set, or referenced, as well as
|
||||
;; which functions use particular record declarations. Masterscope is able to
|
||||
;; analyze definitions directly from a file as well as in-core definitions.
|
||||
;; This test is almost identical to the masterscope as an exec command, which is
|
||||
;; located in {eris}<lispcore>test>exec>masterscope.u
|
||||
;;
|
||||
;; Argument(s): Masterscope commands (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Returns: (SEE IRM, Vol 3, Section 19)
|
||||
;;
|
||||
;; Constraints/Limitations: Due to the nature of Programmer's Assistant commands,
|
||||
;; testing them will be performed using do-test and the interlisp function bksysfuf.
|
||||
;; Comments or messages are incorporated within
|
||||
;; each command file, which will be run by using the function bksysbuf.
|
||||
;; Each test setup is titled "MASTERSCOPE-TEST-SETUP", which executes the command
|
||||
;; string. The do-test form within the command file will return T or "test
|
||||
;; failed" This test file requires TEDIT and MASTERSCOPE package
|
||||
;; The tree structure of the functions being analyzed are as follows:
|
||||
;;
|
||||
;; Top-Funtion
|
||||
;; |
|
||||
;; Fun-A------------------------Fun-B
|
||||
;; | |
|
||||
;; --------------------- --------------------
|
||||
;; | | | | | |
|
||||
;; Fun-A1 Fun-A2 Fun-A3 Fun-B1 Fun-B2 Fun-B3
|
||||
;; |
|
||||
;; --------------
|
||||
;; | |
|
||||
;; Fun-C1 Fun-A1
|
||||
;;
|
||||
;; Messages will be printed before each command in the command files is executed
|
||||
;; for user monitoring. Test result is logged on
|
||||
;; {eris}<lispcore>test>program-analysis>masterscope.report
|
||||
|
||||
(DO-TEST "MASTERSCOPE-TEST-SETUP"
|
||||
;; If the browser is already loaded, undo what the browser did so this testfile
|
||||
;; will work properly, then redo it. This is relying on the browser to always
|
||||
;; affect MSPATHS, because there is no official way of undoing the browser
|
||||
;; (that I know of)
|
||||
(IL:IF (IL:GETD 'IL:OLDMSPATHS)
|
||||
IL:THEN
|
||||
(IL:MOVD 'IL:MSPATHS 'TMP-MSPATHS)
|
||||
(IL:MOVD 'IL:OLDMSPATHS 'IL:MSPATHS))
|
||||
(SETQ TEST-SUCCEEDED T)
|
||||
(DEFUN PASS-FAIL (COMMAND-LANGUAGE TEST-ITEM)
|
||||
(IL:IF (NOT TEST-ITEM)
|
||||
IL:THEN (FORMAT *ERROR-OUTPUT* "Test ~s failed~%" COMMAND-LANGUAGE)
|
||||
(SETQ TEST-SUCCEEDED NIL) (BREAK "Argh!")
|
||||
IL:ELSE "Hey, no problem!"))
|
||||
|
||||
; Reinitialize and Define functions to be analyzed
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
(DEFUN TOP-FUNTION NIL (AND (FUN-A) (FUN-B)))
|
||||
(DEFUN FUN-A NIL (OR (FUN-A1) (FUN-A2) (FUN-A3)))
|
||||
(DEFUN FUN-B NIL (OR (FUN-B1) (FUN-B2) (FUN-B3)))
|
||||
(DEFUN FUN-A1 NIL T)
|
||||
(DEFUN FUN-A2 NIL NIL)
|
||||
(DEFUN FUN-A3 NIL T)
|
||||
(DEFUN FUN-B1 NIL (AND (FUN-C1)(FUN-A1)))
|
||||
(DEFUN FUN-B2 NIL NIL)
|
||||
(DEFUN FUN-B3 NIL T)
|
||||
(DEFUN FUN-C1 NIL NIL)
|
||||
; Start analyzing functions in top-function
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A1" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(PASS-FAIL "Who calls TOP-FUNTION" (NOT (IL:MASTERSCOPE '(WHO CALLS TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-A" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A)) '(TOP-FUNTION))))
|
||||
|
||||
(PASS-FAIL "Who calls FUN-B2" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-B2)) '(FUN-B))))
|
||||
|
||||
(DRIBBLE '{CORE}WHO-CALLS)
|
||||
(IL:MASTERSCOPE '(WHO CALLS WHO))
|
||||
(DRIBBLE)
|
||||
|
||||
(DRIBBLE '{CORE}PATHS)
|
||||
(IL:MASTERSCOPE '(SHOW PATHS TO FUN-A1 FROM TOP-FUNTION))
|
||||
(DRIBBLE)
|
||||
|
||||
; ERASE (erase all information about the functions in SET from the database)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "All info erased" (NOT (OR (IL:MASTERSCOPE '(WHO CALLS FUN-A))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B1))
|
||||
(IL:MASTERSCOPE '(WHO CALLS FUN-B2))
|
||||
)))
|
||||
|
||||
; REANALYZE (causes masterscope to reanalyze the functions in SET)
|
||||
(IL:MASTERSCOPE '(ANALYZE TOP-FUNTION))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-A))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-B1))
|
||||
(IL:MASTERSCOPE '(ERASE FUN-A))
|
||||
(IL:MASTERSCOPE '(REANALYZE FUN-A))
|
||||
|
||||
(PASS-FAIL "Reanalyzing" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO CALLS FUN-A1)) '(FUN-A FUN-B1))))
|
||||
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
|
||||
(PASS-FAIL "Called-by (reanalyzing too)" (NOT (SET-EXCLUSIVE-OR (IL:MASTERSCOPE '(WHO IS CALLED BY TOP-FUNTION)) '(FUN-A FUN-B))))
|
||||
|
||||
|
||||
; DESCRIBE SET (prints out the bind, use freely and call information)
|
||||
|
||||
(DEFUN FUN-DESCRIBE (X Y) (SETQ X1 (1+ X)) (SETQ Y1 (1- Y)))
|
||||
(IL:MASTERSCOPE '(ANALYZE FUN-DESCRIBE))
|
||||
(DRIBBLE '{CORE}DESCRIBE)
|
||||
(IL:MASTERSCOPE '(DESCRIBE FUN-DESCRIBE))
|
||||
(DRIBBLE)
|
||||
(IL:MASTERSCOPE '(ERASE))
|
||||
; analyzing the file that contains hopefully correct results
|
||||
(SETQ DESCRIBE-FLG NIL)
|
||||
(SETQ DESCRIBE-FILE (OPEN "{CORE}DESCRIBE"))
|
||||
|
||||
;; Yeeuck. Awful test, relies on Masterscope returning exactly the characters
|
||||
;; expected. At least now it doesn't require the exact number of spaces....Rene
|
||||
;; p.s. premature EOF will return a NIL, so that will count as failure as well.
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE DESCRIBE-FILE NIL 'EOF))))
|
||||
(NOT (SEARCH "calls" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Describe"
|
||||
(AND (STRING-EQUAL "calls:1+,1-" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "binds:X,Y" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
(STRING-EQUAL "usesfree:Y1,X1" (DELETE #\Space (READ-LINE DESCRIBE-FILE NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE DESCRIBE-FILE)
|
||||
(DELETE-FILE "{CORE}DESCRIBE")
|
||||
|
||||
; analyzing the file that contains the previous masterscope interactions
|
||||
; (who calls?)
|
||||
|
||||
(SETQ WHO-CALLS (OPEN "{CORE}WHO-CALLS"))
|
||||
;; Another test which replaces the previous "throw away the first three lines
|
||||
;; no matter what" and ignores spaces. See comment for the DESCRIBE test. There
|
||||
;; MUST be a better way! And >>I<< didn't spell "funtion" that way....Rene
|
||||
;; JRB - a feature of who calls who is that the order in which the calling information
|
||||
;; comes out is dependent on the order things got analyzed in. Things get reanalyzed
|
||||
;; by Masterscope itself all the time, in whatever order Masterscope feels like doing it.
|
||||
;; What you really have to do here is suck in all the lines and do a SET-EXCLUSIVE-OR
|
||||
;; between two lists of strings; yuck**2.
|
||||
(LET (ALL-LINES NEXT-LINE)
|
||||
;; First suck in the lines
|
||||
(IL:WHILE (NOT (EQ 'EOF (SETQ NEXT-LINE (READ-LINE WHO-CALLS NIL 'EOF))))
|
||||
IL:DO (PUSH (DELETE #\Space NEXT-LINE) ALL-LINES))
|
||||
;; Then compare them
|
||||
(PASS-FAIL "Who calls...? (analyzing)"
|
||||
(NOT (SET-EXCLUSIVE-OR ALL-LINES
|
||||
'("top-funtion--(fun-afun-b)"
|
||||
"FUN-B1--(FUN-C1FUN-A1)"
|
||||
"FUN-B--(FUN-B1FUN-B2FUN-B3)"
|
||||
"FUN-A--(FUN-A1FUN-A2FUN-A3)")
|
||||
:TEST #'STRING-EQUAL))))
|
||||
|
||||
(CLOSE WHO-CALLS)
|
||||
(DELETE-FILE "{CORE}WHO-CALLS")
|
||||
|
||||
; analyzing the file that contains the masterscope interaction (show paths)
|
||||
(SETQ PATHS (OPEN "{CORE}PATHS"))
|
||||
|
||||
(LET (NEXT-LINE)
|
||||
(IL:WHILE (AND (NOT (EQ 'EOF
|
||||
(SETQ NEXT-LINE (READ-LINE PATHS NIL 'EOF))))
|
||||
(NOT (SEARCH "top-funtion" NEXT-LINE :TEST #'STRING-EQUAL))))
|
||||
(PASS-FAIL "Show paths (would-be graph)"
|
||||
(AND
|
||||
|
||||
(STRING-EQUAL "1.FUN-A1FUN-ATOP-FUNTION" (DELETE #\Space NEXT-LINE))
|
||||
(STRING-EQUAL "2.FUN-B1FUN-BTOP-FUNTION" (DELETE #\Space (READ-LINE PATHS NIL NIL)))
|
||||
))
|
||||
) ; close let
|
||||
|
||||
|
||||
(CLOSE PATHS)
|
||||
(DELETE-FILE "{CORE}PATHS")
|
||||
|
||||
;; if the browser was loaded, reset MSPATHS so it looks loaded again
|
||||
(IL:IF (IL:GETD 'OLDMSPATHS)
|
||||
IL:THEN (IL:MOVD 'TMP-MSPATHS 'IL:MSPATHS))
|
||||
|
||||
TEST-SUCCEEDED
|
||||
|
||||
)
|
||||
|
||||
STOP
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user