1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
guile/test-suite
Andy Wingo 9e6ac923bf Replace libltdl with raw dlopen, dlsym
* NEWS: Update.
* am/bootstrap.am (SOURCES):
* module/Makefile.am (SOURCES): Add system/foreign-library.scm.
* configure.ac: Replace ltdl check with -ldl check.
* libguile/dynl.c: Rewrite to just expose core dlopen / dlsym / etc to a
  helper Scheme module.
  (scm_dynamic_link, scm_dynamic_pointer, scm_dynamic_function)
  (scm_dynamic_object_p, scm_dynamic_call): Rewrite in terms of (system
  foreign-library).
* libguile/extensions.c (load_extension): Avoid scm_dynamic_call.
* module/system/foreign-library.scm: New file.
* module/oop/goops.scm (<dynamic-object>): Hackily export
  <foreign-library> instead of a class here.
* doc/ref/api-foreign.texi (Foreign Function Interface): Rewrite to only
  document the new interfaces.  Eventually we will deprecate
  dynamic-link and friends.
* doc/ref/guile.texi (API Reference): Move Foreign Objects after Foreign
  Function Interface.  Seems there should be some closer relationship
  but this will do for now.
* doc/ref/tour.texi (Putting Extensions into Modules):
* doc/ref/libguile-parallel.texi (Parallel Installations): Update for
  rename of Modules and Extensions to Foreign Extensions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_dynamic_unlink): Deprecate.
* libguile/guile.c: Remove ltdl include.
* test-suite/tests/foreign.test: Update tests to use new API, and update
  error expectations.
2021-01-29 16:12:22 +01:00
..
lalr remove duplicate when/unless definitions 2012-01-20 21:16:50 +01:00
standalone standalone tests require libgnu on DLL-based platforms 2021-01-21 15:35:34 -08:00
test-suite Test suite compile-and-eval tests run -O0 and -O2 2020-05-11 11:05:30 +02:00
tests Replace libltdl with raw dlopen, dlsym 2021-01-29 16:12:22 +01:00
ChangeLog-2008 Rename ChangeLog' files to ChangeLog-2008'. 2008-09-12 21:49:58 +02:00
guile-test Minor expansion of guile-test comments 2017-03-01 10:40:52 +01:00
Makefile.am Move copy-tree to (ice-9 copy-tree); deprecate main binding 2020-09-10 21:57:21 +02:00
README Revert "Note need for subscription to bug-guile@gnu.org." 2008-12-10 19:07:14 +00:00

This directory contains some tests for Guile, and some generic test
support code.

To run these tests, you will need a version of Guile more recent than
15 Feb 1999 --- the tests use the (ice-9 and-let*) and (ice-9
getopt-long) modules, which were added to Guile around then.

For information about how to run the test suite, read the usage
instructions in the comments at the top of the guile-test script.

You can reference the file `lib.scm' from your own code as the module
(test-suite lib); it also has comments at the top and before each
function explaining what's going on.

Please write more Guile tests, and send them to bug-guile@gnu.org.
We'll merge them into the distribution.  All test suites must be
licensed for our use under the GPL, but I don't think I'm going to
collect assignment papers for them.



Some test suite philosophy:

GDB has an extensive test suite --- around 6300 tests.  Every time the
test suite catches a bug, it's great.

GDB is so complicated that folks are often unable to get a solid
understanding of the code before making a change --- we just don't
have time.  You'll see people say things like, "Here's a fix for X; it
doesn't cause any regressions."  The subtext is, I made a change that
looks reasonable, and the test suite didn't complain, so it must be
okay.

I think this is terrible, because it suggests that the writer is using
the test suite as a substitute for having a rock-solid explanation of
why their changes are correct.  The problem is that any test suite is
woefully incomplete.  Diligent reasoning about code can catch corner
conditions or limitations that no test suite will ever find.



Jim's rule for test suites:

Every test suite failure should be a complete, mysterious surprise,
never a possibility you were prepared for.  Any other attitude
indicates that you're using the test suite as a crutch, which you need
only because your understanding is weak.