unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* unit tests best practice
@ 2019-01-03 16:53 Catonano
  2019-01-03 18:44 ` Mike Gran
  2019-01-05 16:49 ` Amirouche Boubekki
  0 siblings, 2 replies; 8+ messages in thread
From: Catonano @ 2019-01-03 16:53 UTC (permalink / raw)
  To: Guile User

Wat's the best practice to instrument a Guile based project for running
unit tests ?

guile-git has this fragment in the Makefile.am file

SCM_LOG_DRIVER =                                \
  $(top_builddir)/pre-inst-env                  \
  $(GUILE) --no-auto-compile -e main            \
      $(top_srcdir)/build-aux/test-driver.scm

as you can see, what Automake produces calls a "main" procedure in a
"test-driver.scm" script in the "build-aux" folder

The effect is that you can call

make check

in the root folder and have the tests run

Instead, in the Makefile.am file produced by guile-hall wired projects you
ave this fragment

AM_TESTS_ENVIRONMENT = abs_top_srcdir=\"$(abs_top_srcdir)\"
SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
AM_SCM_LOG_FLAGS = --no-auto-compile -L \"$(top_srcdir)\"

so there's a SCM_LOG_COMPILER instead of a SCM_LOG_DRIVER

What is this LOG_COMPILER doing, exactly ?

This is what the test-env file contains

#!/bin/sh

\"@abs_top_builddir@/pre-inst-env\" \"$@\"

exit $?

what is this ?

What does this do ?

Alex admits he goes full cargo culting when dealing with the Autotools, in
fact there's this comment line at the beginning of the section producing
the Autotools related files in guile-hall

;;;; Full on cargo cult!

So, if there's any kind soul here willing to clarify/illustrate what is
going on we could make the effort to condensate such knowledge in
guile-hall

Improving the experience in dealing with Guile based project would be a
great progress

One last thing

test-driver uses the API provided by srfi-64 to actually run the tests and
display the results

Does Guile provide a standard version of such script ?
Should Guile provide one ?


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-01-10 10:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-03 16:53 unit tests best practice Catonano
2019-01-03 18:44 ` Mike Gran
2019-01-05 13:28   ` Catonano
2019-01-06 15:27     ` Alex Sassmannshausen
2019-01-10 10:41       ` Catonano
2019-01-05 16:49 ` Amirouche Boubekki
2019-01-05 17:11   ` Catonano
2019-01-06 13:41     ` Amirouche Boubekki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).