Skip to content

Conversation

@housel
Copy link
Member

@housel housel commented Mar 7, 2025

No description provided.

@housel housel force-pushed the environment-testing-202502 branch 2 times, most recently from 0cb52d3 to b83dfc9 Compare March 9, 2025 03:48
housel added 2 commits March 27, 2025 09:02
* sources/dfmc/conversion/convert.dylan
  (convert-next-method-into): Since in some cases a <&lambda> may not
   have a model-definition at the point where next-method code
   generation occurs, use lambda-source-location as the contextual
   source location when generating the next-method closure fragment.
This change fixes the implementation of the environment-protocol
project-compiled? and consolidates definitions related to the
dylanmakefile.mkf file used to pass project build information to the
build-system.

* sources/lib/build-system/build.dylan
  ($dylanmakefile): Rename as $build-system-makefile-name.
  (build-system): Reference renamed $build-system-makefile-name.

* sources/lib/build-system/library.dylan
  (module build-system): Export $build-system-makefile-name.

* sources/project-manager/user-projects/user-projects.dylan
  ($dylan-makefile): Remove redundant constant definition.

* sources/project-manager/user-projects/build.dylan
  (makefile-exists?, generate-makefile): Use
   $build-system-makefile-name from build-system.

* sources/environment/dfmc/projects/library.dylan
  (module dfmc-environment-projects): Import
   $build-system-makefile-name.

* sources/environment/dfmc/projects/projects.dylan
  ($build-makefile): Remove incorrect constant definition.
  (project-compiled?): Reference the correct
   $build-system-makefile-name constant.

* sources/environment/tests/dfmc/projects.dylan
  (test open-projects-test): Check that project-compiled?
   correctly returns true for the already-compiled *test-library*
   and *test-application*.
@housel housel force-pushed the environment-testing-202502 branch from b83dfc9 to c032e73 Compare March 28, 2025 03:32
@housel housel marked this pull request as ready for review March 28, 2025 03:33
@@ -0,0 +1,2577 @@
Module: dylan-test
author: Roger Critchlow (rec@elf.org)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should remove the email address. The internet is a lot meaner place than it was when this was written.

#"gui");
check-equal("Application project name",
project-name(*test-application*),
$test-application);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I improved the output for this to specifically show what was expected (want) and the actual value (got), I had to choose an order, and I chose check-equal(msg, want, got). I chose that because I suspect the "want" expression will often be short (a literal or a variable) and the actual value will tend to be a lot longer.

(Not sure if it's worth fixing the callers that use the other order....)

housel added 15 commits March 29, 2025 13:52
This test suite is adapted from the tests included with Gwydion Dylan,
expanded for testing interactivity and redefinition in the debugger.

* sources/testing/cmu-test-suite/*: New source files.

* sources/registry/generic/cmu-test-suite: New registry entry.
* sources/testing/cmu-test-suite/cmu-test-suite-library.dylan
  (library cmu-test-suite): Replace import of functional-dylan with
   common-dylan, and explicitly use dylan in order to import internal
   modules.
  (module dylan-test): Replace import of functional-dylan with
   common-dylan, and import simple-profiling for timing.
The %redefine-class interface in the Dylan library has changed, it is
probably best to remove this test for now; class redefinition can be
adequately tested using environment tests.

* sources/testing/cmu-test-suite/redefinition-testing.dylan:
  Removed.

* sources/testing/cmu-test-suite/cmu-test-suite.lid: Removed
  reference to redefinition-testing.dylan.

* sources/testing/cmu-test-suite/cmu-test-suite-library.dylan
  (module dylan-test): Remove import of dylan-incremental.
* sources/testing/cmu-test-suite/cmu-test-suite.hdp: New
  project file for use with the environment tests.
Instead of definiing an open generic function to be called by
run-application after instantiating the new <application>, add an
initialize-client: keyword argument to run-application for explicitly
passing a callback function.

* sources/environment/protocols/applications.dylan
  (run-application): Add an initialize-client keyword argument to
   the generic function definition.
  (initialize-application-client): Remove generic definition and
   default method.
  (run-application on <project-object>): Add an initialize-client:
   keyword argument, and call the referenced callback function
   in place of initialize-application-client.

* sources/environment/protocols/module.dylan
  (module environment-protocols): Remove export of
   initialize-application-client.

* sources/environment/dfmc/application/control-protocols.dylan
  (run-application on <dfmc-application>): Add a do-nothing
   initialize-client: keyword argument so that the method is congruent
   with the generic function definition.

* sources/environment/commands/application/debugging.dylan
  (do-execute-command on <start-application-command>): Explicitly
   pass in a initialize-client: callback.
  (initialize-application-client): Change method definition to a
   function.
* 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.
* sources/environment/tests/dfmc/projects.dylan
  (test open-projects-test): Add checks for project-name,
   project-read-only?, project-can-be-built?, and
   project-can-be-debugged? of both test libraries.
* sources/environment/tests/dfmc/projects.dylan
  (test project-libraries-test): New test, with checks for
   project-library and project-used-libraries.
* sources/environment/tests/dfmc/projects.dylan
  (test project-source-files-test): New test with checks for
   project-filename, project-directory, and project-sources.
  (suite projects-suite): Add project-source-files-test.

* sources/environment/tests/dfmc/module.dylan
  (module dfmc-environment-test-suite): Use the file-system module.
This commit adds debugger initialization and an initial test to the
debugging test suite.

* sources/environment/tests/dfmc/debugging.dylan
  (*test-application-application*): New module variable.
  (dbg-machine): New function.
  ($project-message-queue, $project-message-notification): New
   module constants.
  (debugging-project-message-callback, await-project-message,
   initialize-application-client): New functions.
  (open-debugging-test-project): Subscribe to project messages.
   Identify a target machine and start application debugging.
   Await application-related messages until the debugged
   application has reached its start function.
  (close-debugging-test-project): Close the application and await
   application messages until the debugged application is confirmed
   closed.
  (test stack-trace-test): New test for checking that a stack trace
   can be retrieved at the project start function.
  (suite dfmc-environment-debugging-suite): Add stack-trace-test.

* sources/environment/tests/dfmc/library.dylan
  (library dfmc-environment-test-suite): Use channels, dylan-orb,
   and the access-path implementations. Reference the needed
   dfmc-environment libraries directly rather than depending on
   the environment-commands libraries.

* sources/environment/tests/dfmc/module.dylan
  (module dfmc-environment-test-suite): Use format, threads, channels,
   and dylan-orb. Reference dfmc-application rather than depending on
   the environment-commands module. Import debugger-message from
   access-path.
This commit adds tests of the debugger's machine register reading
capabilities.

* sources/environment/tests/dfmc/debugging.dylan
  (test registers-test): New test for machine register enumeration
   and retrieval.
  (suite dfmc-environment-debugging-suite): Add registers-test.
This commit adds tests of the debugger's interactive expression
evaluation and results display.

* sources/environment/tests/dfmc/debugging.dylan
  ($debugging-library-id, $debugging-module-id): New test suite
   module name identifiers.
 (*transaction-id*): New module variabble for storing the completed
  code execution transaction.
 (note-application-interactive-results): New callback function.
 (clear-project-messages): New utility function for clearing the
  project message queue.
 (initialize-application-client): Register the
  note-application-interactive-results callback.
 ($interactivity-spec): New constant listing expressions to
  evaluate and their expected results.
 (test interactivity-test): New test for basic interactive evaluation
  and redefinition.
 (suite dfmc-environment-debugging-suite): Add interactivity-test

* sources/environment/tests/dfmc/library.dylan
  (library dfmc-environment-test-suite): Reference regular-expressions.

* sources/environment/tests/dfmc/module.dylan
  (module dfmc-environment-test-suite): Reference regular-expressions.
These environment-protocols functions for constructing and navigating
partial stack traces are not used by any clients, and their
implementation uses the unsafe perform-requiring-debugger-transaction.

* sources/environment/protocols/thread-objects.dylan
  (generic thread-stack-trace,
   thread-stack-trace on <project-object>): Remove.

* sources/environment/protocols/stack-frame-objects.dylan
  (stack-frame-next-frame, stack-frame-previous-frame): Remove.

* sources/environment/protocols/module.dylan
  (module environment-protocols): Remove export of thread-stack-trace,
   stack-frame-next-frame, and stack-frame-previous-frame.

* sources/environment/dfmc/application/thread-objects.dylan
  (thread-stack-trace on <dfmc-application>): Remove.

* sources/environment/dfmc/application/stack-frame-objects.dylan
  (stack-frame-previous-frame on <dfmc-application>,
   stack-frame-next-frame on <dfmc-application>): Remove.
The perform-requiring-debugger-transaction function was not thread
safe, and is no longer used after the removal of the partial stack
trace functions.

* sources/environment/target-application/synchronized-access.dylan
  (perform-requiring-debugger-transaction): Remove.

* sources/environment/target-application/library.dylan
  (module target-application): Remove export of
   perform-requiring-debugger-transaction.
This change moves the startup of the debugged application under test
from the suite setup function to a common function called by each test
so that tests can safely leave the target in an unknown state without
interfering with other tests.

* sources/environment/tests/dfmc/debugging.dylan
  (open-debugging-test-project): Move out application startup code to
   ensure-application-at-start.
  (ensure-application-at-start): New function for restarting the
   test application to a known state.
  (test stack-trace-test, test registers-test,
   test interactivity-test): Call ensure-application-at-start at the
   start of test execution.
@housel housel force-pushed the environment-testing-202502 branch from c032e73 to 3c0af40 Compare March 29, 2025 21:04
* sources/testing/cmu-test-suite/*: Remove "// eof" comments
@housel housel merged commit d578c15 into dylan-lang:master Apr 1, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants