Skip to content

Commit 6361312

Browse files
committed
dfmc-environment-test-suite: Add initial debugger tests
* sources/environment/tests/dfmc/main-suite.dylan (suite dfmc-environment-browsing-suite): Rename from dfmc-environment-suite. (suite dfmc-environment-suite): New suite incorporating the original environment tests along with the new debugging suite. * sources/environment/tests/dfmc/projects.dylan (test-project-location): Add cmu-test-suite case. (test-project-build): Extracted new function for compiling (and optionally linking) the given project. (open-test-projects): Reference extracted test-project-build. * sources/environment/tests/dfmc/debugging.dylan: New file containing the initially empty dfmc-environment-debugging-suite and its setup and cleanup functions. * sources/environment/tests/dfmc/dfmc-environment-test-suite.lid: Reference the new debugging.dylan.
1 parent b82a168 commit 6361312

File tree

4 files changed

+56
-12
lines changed

4 files changed

+56
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Module: dfmc-environment-test-suite
2+
Synopsis: DFMC Environment Tests
3+
Author: Peter S. Housel
4+
Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
5+
All rights reserved.
6+
License: See License.txt in this distribution for details.
7+
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
8+
9+
define constant $debugging-test-application = "cmu-test-suite";
10+
11+
define function open-debugging-test-project () => ()
12+
let application
13+
= open-project(test-project-location($debugging-test-application));
14+
open-project-compiler-database
15+
(application, error-handler: project-condition-handler);
16+
17+
test-project-build(application, link?: #t);
18+
19+
unless (open-project-compiler-database
20+
(application, error-handler: project-condition-handler))
21+
parse-project-source(application);
22+
end unless;
23+
*test-application* := application;
24+
end function;
25+
26+
define function close-debugging-test-project () => ()
27+
close-project(*test-application*);
28+
end function;
29+
30+
define suite dfmc-environment-debugging-suite
31+
(setup-function: open-debugging-test-project,
32+
cleanup-function: close-debugging-test-project)
33+
end suite;

sources/environment/tests/dfmc/dfmc-environment-test-suite.lid

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Files: library
66
module
77
projects
88
names
9+
debugging
910
main-suite
1011
Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
1112
All rights reserved.

sources/environment/tests/dfmc/main-suite.dylan

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
88

99
/// DFMC environment suite
1010

11-
define suite dfmc-environment-suite
11+
define suite dfmc-environment-browsing-suite
1212
(setup-function: open-test-projects,
1313
cleanup-function: close-test-projects)
1414
suite environment-suite;
1515
suite projects-suite;
1616
suite names-suite;
17-
end suite dfmc-environment-suite;
17+
end suite dfmc-environment-browsing-suite;
18+
19+
define suite dfmc-environment-suite ()
20+
suite dfmc-environment-browsing-suite;
21+
suite dfmc-environment-debugging-suite;
22+
end suite;

sources/environment/tests/dfmc/projects.dylan

+15-10
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,18 @@ define function test-project-location
5555
select (name by \=)
5656
"environment-test-application" => "test-application";
5757
"environment-test-library" => "test-library";
58+
"cmu-test-suite" => "cmu-test-suite";
5859
end,
5960
name);
6061
format-out("project-location: %=\n", location-name);
6162
as(<file-locator>, location-name);
6263
end function test-project-location;
6364

64-
define function open-test-projects () => ()
65-
let library = open-project(test-project-location($test-library));
66-
open-project-compiler-database
67-
(library, error-handler: project-condition-handler);
68-
let application = open-project(test-project-location($test-application));
69-
open-project-compiler-database
70-
(application, error-handler: project-condition-handler);
71-
65+
define function test-project-build (project :: <project-object>, #key link?)
7266
let progress
7367
= make(<progress-stream>, inner-stream: *standard-output*);
74-
build-project(application,
75-
link?: #f,
68+
build-project(project,
69+
link?: link?,
7670
save-databases?: #t,
7771
error-handler: project-condition-handler,
7872
progress-callback:
@@ -87,6 +81,17 @@ define function open-test-projects () => ()
8781
show-progress(progress, position, range, label: label);
8882
end);
8983
new-line(progress);
84+
end function;
85+
86+
define function open-test-projects () => ()
87+
let library = open-project(test-project-location($test-library));
88+
open-project-compiler-database
89+
(library, error-handler: project-condition-handler);
90+
let application = open-project(test-project-location($test-application));
91+
open-project-compiler-database
92+
(application, error-handler: project-condition-handler);
93+
94+
test-project-build(application);
9095

9196
unless (open-project-compiler-database
9297
(library, error-handler: project-condition-handler))

0 commit comments

Comments
 (0)