guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unit tests best practice


From: Catonano
Subject: unit tests best practice
Date: Thu, 3 Jan 2019 17:53:33 +0100

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\" \"address@hidden"

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 ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]