* guile-lib - devel branch - 4 patches
@ 2016-10-23 1:06 David Pirotte
2017-01-15 2:04 ` guile-lib - devel branch - unit-test 2 new APIs - 1 patch Lluís Vilanova
0 siblings, 1 reply; 3+ messages in thread
From: David Pirotte @ 2016-10-23 1:06 UTC (permalink / raw)
To: guile-devel
[-- Attachment #1.1: Type: text/plain, Size: 186 bytes --]
Hello Guilers,
Attached 4 patches, review welcome.
Unless negative feedback, I should push these, merge to master and release Guile-Lib
0.2.4 within the next few days.
David.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Fixing-GUILE_SITE_CCACHE_DIR-m4-macro.patch --]
[-- Type: text/x-patch, Size: 974 bytes --]
From e8ea99f9e7698aae5dcdaa314a1f80f1618ca3c1 Mon Sep 17 00:00:00 2001
From: David Pirotte <david@altosw.be>
Date: Sat, 22 Oct 2016 22:28:20 -0200
Subject: [PATCH 1/4] Fixing GUILE_SITE_CCACHE_DIR m4 macro
* m4/guile.m4: Report $GUILE_SITE_CCACHE, not $_guile_lib.
---
m4/guile.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/m4/guile.m4 b/m4/guile.m4
index 6381b13..ce44fc9 100644
--- a/m4/guile.m4
+++ b/m4/guile.m4
@@ -235,11 +235,11 @@ AC_DEFUN([GUILE_SITE_CCACHE_DIR],
[AC_REQUIRE([GUILE_PKG])
AC_MSG_CHECKING(for Guile site-ccache directory)
_guile_lib=`$PKG_CONFIG --print-errors --variable=libdir guile-$GUILE_EFFECTIVE_VERSION`
- AC_MSG_RESULT($_guile_lib)
if test "$_guile_lib" = ""; then
AC_MSG_FAILURE(libdir not found)
fi
GUILE_SITE_CCACHE=$_guile_lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache
+ AC_MSG_RESULT($GUILE_SITE_CCACHE)
AC_SUBST(GUILE_SITE_CCACHE)
])
--
2.9.3
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-Fixing-a-deprecated-param-in-Guile-2.2.patch --]
[-- Type: text/x-patch, Size: 940 bytes --]
From 551050e647e07671968a82c74d417328b858566d Mon Sep 17 00:00:00 2001
From: David Pirotte <david@altosw.be>
Date: Sat, 22 Oct 2016 22:31:06 -0200
Subject: [PATCH 2/4] Fixing a deprecated param in Guile-2.2
* src/os/process.scm: _IONBF setvbuf mode deprecated in Guile-2.2, use
'none instead.
---
src/os/process.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/os/process.scm b/src/os/process.scm
index 0dd302d..57a3bdc 100644
--- a/src/os/process.scm
+++ b/src/os/process.scm
@@ -141,7 +141,10 @@ Examples:
;;; matter, making it unbuffered would just slow things down.
(define (unbuffered-pipe)
(let ((result (pipe)))
- (setvbuf (cdr result) _IONBF)
+ (cond-expand (guile-2.2
+ (setvbuf (cdr result) 'none))
+ (guile-2
+ (setvbuf (cdr result) _IONBF)))
result))
;;; generate the code needed to set up redirections for a child process.
--
2.9.3
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.4: 0003-Simplifying-the-src-EXTRA_DIST-definition.patch --]
[-- Type: text/x-patch, Size: 1151 bytes --]
From 025bde9f5efc410300f2aa6083f5726c5bc60068 Mon Sep 17 00:00:00 2001
From: David Pirotte <david@altosw.be>
Date: Sat, 22 Oct 2016 22:35:21 -0200
Subject: [PATCH 3/4] Simplifying the src EXTRA_DIST definition
* src/Makefile.am: $(SOURCES) already filters wrt statprof, sxml and
texinfo, no need to have EXTRA_DIST 'predefs' in the 'if
HAVE_GUILE_COMPILE ... else ...'.
---
src/Makefile.am | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index dede64d..b120f00 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -68,19 +68,12 @@ SXML_SOURCES =
TEXINFO_SOURCES =
STATPROF_SOURCES =
-EXTRA_DIST = \
- $(SXML_FILES) \
- $(TEXINFO_FILES) \
- $(STATPROF_FILES)
-
else !HAVE_GUILE_COMPILE
SXML_SOURCES = $(SXML_FILES)
TEXINFO_SOURCES = $(TEXINFO_FILES)
STATPROF_SOURCES = $(STATPROF_FILES)
-EXTRA_DIST =
-
endif !HAVE_GUILE_COMPILE
@@ -128,7 +121,7 @@ endif
nobase_mod_DATA = $(SOURCES) $(NOCOMP_SOURCES)
nobase_go_DATA = $(GOBJECTS)
-EXTRA_DIST += \
+EXTRA_DIST = \
$(SOURCES) \
$(NOCOMP_SOURCES)
--
2.9.3
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.5: 0004-Do-not-check-what-is-not-installed.patch --]
[-- Type: text/x-patch, Size: 1987 bytes --]
From 2c98302ea26f5235761540c20e0c563662ab6083 Mon Sep 17 00:00:00 2001
From: David Pirotte <david@altosw.be>
Date: Sat, 22 Oct 2016 22:42:31 -0200
Subject: [PATCH 4/4] Do not check what is not installed.
* unit-tests/Makefile.am: Adapting the test suite Makefile.am so it does
not run a check neither install the test suite code for modules that
are not installed anymore (because they became part of Guile core).
---
unit-tests/Makefile.am | 42 +++++++++++++++++++++++++++++++++---------
1 file changed, 33 insertions(+), 9 deletions(-)
diff --git a/unit-tests/Makefile.am b/unit-tests/Makefile.am
index b3df899..af7acdc 100644
--- a/unit-tests/Makefile.am
+++ b/unit-tests/Makefile.am
@@ -25,6 +25,36 @@
####
+TEST_SXML_FILES = \
+ sxml.fold.scm \
+ sxml.ssax.scm \
+ sxml.transform.scm \
+ sxml.xpath.scm
+
+TEST_TEXINFO_FILES = \
+ texinfo.scm \
+ texinfo.docbook.scm \
+ texinfo.serialize.scm \
+ text.parse-lalr.scm
+
+TEST_STATPROF_FILES = \
+ statprof.scm
+
+
+if HAVE_GUILE_COMPILE
+
+TEST_SXML_SOURCES =
+TEST_TEXINFO_SOURCES =
+TEST_STATPROF_SOURCES =
+
+else !HAVE_GUILE_COMPILE
+
+TEST_SXML_SOURCES = $(TEST_SXML_FILES)
+TEST_TEXINFO_SOURCES = $(TEST_TEXINFO_FILES)
+TEST_STATPROF_SOURCES = $(TEST_STATPROF_FILES)
+
+endif !HAVE_GUILE_COMPILE
+
TESTS= \
api.scm \
container.async-queue.scm \
@@ -37,20 +67,14 @@ TESTS= \
md5.scm \
os.process.scm \
search.basic.scm \
- statprof.scm \
+ $(TEST_STATPROF_SOURCES) \
scheme.kwargs.scm \
string.completion.scm \
string.transform.scm \
string.wrap.scm \
- sxml.fold.scm \
- sxml.ssax.scm \
- sxml.transform.scm \
- sxml.xpath.scm \
+ $(TEST_SXML_SOURCES) \
term.ansi-color.scm \
- texinfo.scm \
- texinfo.docbook.scm \
- texinfo.serialize.scm \
- text.parse-lalr.scm
+ $(TEST_TEXINFO_SOURCES)
TESTS_ENVIRONMENT= \
API_FILE=$(srcdir)/guile-library.api \
--
2.9.3
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: guile-lib - devel branch - unit-test 2 new APIs - 1 patch
2016-10-23 1:06 guile-lib - devel branch - 4 patches David Pirotte
@ 2017-01-15 2:04 ` Lluís Vilanova
2017-01-15 19:55 ` David Pirotte
0 siblings, 1 reply; 3+ messages in thread
From: Lluís Vilanova @ 2017-01-15 2:04 UTC (permalink / raw)
To: David Pirotte; +Cc: guile-devel
David Pirotte writes:
> Hello Guilers,
> Attached: 1 patch
> Please reivew, test ...: unless negative feedback, I should push it, merge to master
> and release Guile-Lib 0.2.5 within the next few days (*)
Nit pick: I don't know what's the coding convention in guile, but your use of
tabs is inconsistent within the patch and across the rest of the file.
Cheers,
Lluis
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: guile-lib - devel branch - unit-test 2 new APIs - 1 patch
2017-01-15 2:04 ` guile-lib - devel branch - unit-test 2 new APIs - 1 patch Lluís Vilanova
@ 2017-01-15 19:55 ` David Pirotte
0 siblings, 0 replies; 3+ messages in thread
From: David Pirotte @ 2017-01-15 19:55 UTC (permalink / raw)
To: Lluís Vilanova; +Cc: guile-devel
[-- Attachment #1.1: Type: text/plain, Size: 289 bytes --]
Hi Lluís,
> Nit pick: I don't know what's the coding convention in guile, but your use of
> tabs is inconsistent within the patch and across the rest of the file.
Oh, I thought I had the proper emacs config, but no! I fixed that now, here is an
updated patch.
Thanks,
David
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Unit-test-2-new-APIs.patch --]
[-- Type: text/x-patch, Size: 3253 bytes --]
From 0b34a9196718e030c9e8c9a0095aec8f0da58425 Mon Sep 17 00:00:00 2001
From: David Pirotte <david@altosw.be>
Date: Sun, 15 Jan 2017 17:49:10 -0200
Subject: [PATCH] Unit-test 2 new APIs
* src/unit-test.scm: New assert-false procedure, new assert macro: both
take an expression as their respective argument; assert-false will
throw a 'test-failed-exception unless expression returns #f; assert
will throw a 'test-failed-exception if expression raises an exception.
---
src/unit-test.scm | 47 +++++++++++++++++++++++++++++++++--------------
1 file changed, 33 insertions(+), 14 deletions(-)
diff --git a/src/unit-test.scm b/src/unit-test.scm
index a46b6fc..3adf971 100644
--- a/src/unit-test.scm
+++ b/src/unit-test.scm
@@ -26,6 +26,7 @@
#:use-module (ice-9 pretty-print)
#:export (assert-equal
assert-true
+ assert-false
assert-numeric-=
<test-result>
tests-run
@@ -46,7 +47,8 @@
run-all-defined-test-cases
exit-with-summary)
- #:export-syntax (assert-exception))
+ #:export-syntax (assert
+ assert-exception))
;; Utility method for finding an object's method given its name. The
@@ -105,31 +107,48 @@
(display " got: ")
(write got))))))
+(define (assert-false got)
+ (if got
+ (throw 'test-failed-exception
+ (with-output-to-string
+ (lambda ()
+ (display "assert-false: ")
+ (display " got: ")
+ (write got))))))
+
(define (assert-numeric-= expected got precision)
(if (> (abs (- expected got)) precision)
(throw 'test-failed-exception
(with-output-to-string
(lambda ()
(display "assert-numeric-=: expected:\n")
- (pretty-print expected)
- (display " precision: ")
- (pretty-print precision)
+ (pretty-print expected)
+ (display " precision: ")
+ (pretty-print precision)
(display " got: ")
(write got))))))
+(define-macro (assert expression)
+ `(catch #t
+ (lambda () ,expression)
+ (lambda (key . args)
+ (throw
+ 'test-failed-exception
+ (format #f "assert: exception on ~S"
+ ',expression)))))
(define-macro (assert-exception expression)
`(catch #t
- (lambda ()
- ,expression
- (throw
- 'test-failed-exception
- (format #f "assert-exception: no exception on ~S"
- ',expression)))
- (lambda (key . args)
- (case key
- ((test-failed-exception) (apply throw key args))
- (else #t)))))
+ (lambda ()
+ ,expression
+ (throw
+ 'test-failed-exception
+ (format #f "assert-exception: no exception on ~S"
+ ',expression)))
+ (lambda (key . args)
+ (case key
+ ((test-failed-exception) (apply throw key args))
+ (else #t)))))
;;;----------------------------------------------------------------
--
2.11.0
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-15 19:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-23 1:06 guile-lib - devel branch - 4 patches David Pirotte
2017-01-15 2:04 ` guile-lib - devel branch - unit-test 2 new APIs - 1 patch Lluís Vilanova
2017-01-15 19:55 ` David Pirotte
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).