unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Make temp file in coding.test work on MS-Windows
@ 2014-08-09 14:16 Eli Zaretskii
  2014-08-12 20:14 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2014-08-09 14:16 UTC (permalink / raw)
  To: guile-devel

I've built Guile 2.0.11 on another system, and found a problem in
coding.test: it assumes that /tmp exists, and creates the temporary
files there.  Here's the patch to make that more portable:

--- test-suite/tests/coding.test~0	2014-01-21 23:45:02.000000000 +0200
+++ test-suite/tests/coding.test	2014-08-09 13:16:46.416750000 +0300
@@ -20,7 +20,10 @@
   #:use-module (test-suite lib))
 
 (define (with-temp-file proc)
-  (let* ((name (string-copy "/tmp/coding-test.XXXXXX"))
+  (let* ((tmpdir (or (getenv "TMPDIR")
+		     (getenv "TEMP")
+		     "/tmp"))
+	 (name (string-concatenate (list tmpdir "/coding-test.XXXXXX")))
          (port (mkstemp! name)))
     (let ((res (with-throw-handler
                 #t





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

* Re: Make temp file in coding.test work on MS-Windows
  2014-08-09 14:16 Make temp file in coding.test work on MS-Windows Eli Zaretskii
@ 2014-08-12 20:14 ` Ludovic Courtès
  2014-08-12 21:35   ` Mark H Weaver
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2014-08-12 20:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: guile-devel

Eli Zaretskii <eliz@gnu.org> skribis:

> I've built Guile 2.0.11 on another system, and found a problem in
> coding.test: it assumes that /tmp exists, and creates the temporary
> files there.  Here's the patch to make that more portable:
>
> --- test-suite/tests/coding.test~0	2014-01-21 23:45:02.000000000 +0200
> +++ test-suite/tests/coding.test	2014-08-09 13:16:46.416750000 +0300
> @@ -20,7 +20,10 @@
>    #:use-module (test-suite lib))
>  
>  (define (with-temp-file proc)
> -  (let* ((name (string-copy "/tmp/coding-test.XXXXXX"))
> +  (let* ((tmpdir (or (getenv "TMPDIR")
> +		     (getenv "TEMP")
> +		     "/tmp"))
> +	 (name (string-concatenate (list tmpdir "/coding-test.XXXXXX")))
>           (port (mkstemp! name)))
>      (let ((res (with-throw-handler
>                  #t

OK to commit, thanks.

Ludo’.



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

* Re: Make temp file in coding.test work on MS-Windows
  2014-08-12 20:14 ` Ludovic Courtès
@ 2014-08-12 21:35   ` Mark H Weaver
  2014-08-13  1:30     ` Nala Ginrut
  2014-08-13 15:43     ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Mark H Weaver @ 2014-08-12 21:35 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-devel

ludo@gnu.org (Ludovic Courtès) writes:

> Eli Zaretskii <eliz@gnu.org> skribis:
>
>> I've built Guile 2.0.11 on another system, and found a problem in
>> coding.test: it assumes that /tmp exists, and creates the temporary
>> files there.  Here's the patch to make that more portable:
>>
>> --- test-suite/tests/coding.test~0	2014-01-21 23:45:02.000000000 +0200
>> +++ test-suite/tests/coding.test	2014-08-09 13:16:46.416750000 +0300
>> @@ -20,7 +20,10 @@
>>    #:use-module (test-suite lib))
>>  
>>  (define (with-temp-file proc)
>> -  (let* ((name (string-copy "/tmp/coding-test.XXXXXX"))
>> +  (let* ((tmpdir (or (getenv "TMPDIR")
>> +		     (getenv "TEMP")
>> +		     "/tmp"))
>> +	 (name (string-concatenate (list tmpdir "/coding-test.XXXXXX")))
>>           (port (mkstemp! name)))
>>      (let ((res (with-throw-handler
>>                  #t
>
> OK to commit, thanks.

Please untabify the lines you changed, and use 'string-append' instead
of 'string-concatenate'.

      Thanks!
        Mark



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

* Re: Make temp file in coding.test work on MS-Windows
  2014-08-12 21:35   ` Mark H Weaver
@ 2014-08-13  1:30     ` Nala Ginrut
  2014-08-13  3:02       ` Mark H Weaver
  2014-08-13 15:43     ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Nala Ginrut @ 2014-08-13  1:30 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: Ludovic Courtès, guile-devel

[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]

2014年8月13日 上午5:36于 "Mark H Weaver" <mhw@netris.org>写道:
>
> ludo@gnu.org (Ludovic Courtès) writes:
>
> > Eli Zaretskii <eliz@gnu.org> skribis:
> >
> >> I've built Guile 2.0.11 on another system, and found a problem in
> >> coding.test: it assumes that /tmp exists, and creates the temporary
> >> files there.  Here's the patch to make that more portable:
> >>
> >> --- test-suite/tests/coding.test~0   2014-01-21 23:45:02.000000000
+0200
> >> +++ test-suite/tests/coding.test     2014-08-09 13:16:46.416750000
+0300
> >> @@ -20,7 +20,10 @@
> >>    #:use-module (test-suite lib))
> >>
> >>  (define (with-temp-file proc)
> >> -  (let* ((name (string-copy "/tmp/coding-test.XXXXXX"))
> >> +  (let* ((tmpdir (or (getenv "TMPDIR")
> >> +                 (getenv "TEMP")
> >> +                 "/tmp"))
> >> +     (name (string-concatenate (list tmpdir "/coding-test.XXXXXX")))
> >>           (port (mkstemp! name)))
> >>      (let ((res (with-throw-handler
> >>                  #t
> >
> > OK to commit, thanks.
>
> Please untabify the lines you changed, and use 'string-append' instead
> of 'string-concatenate'.
>

Out of topic, IIRC string-concatenate is faster than string-append. Maybe
it's unnecessary here?

>       Thanks!
>         Mark
>

[-- Attachment #2: Type: text/html, Size: 1952 bytes --]

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

* Re: Make temp file in coding.test work on MS-Windows
  2014-08-13  1:30     ` Nala Ginrut
@ 2014-08-13  3:02       ` Mark H Weaver
  0 siblings, 0 replies; 6+ messages in thread
From: Mark H Weaver @ 2014-08-13  3:02 UTC (permalink / raw)
  To: Nala Ginrut; +Cc: Ludovic Courtès, guile-devel

Nala Ginrut <nalaginrut@gmail.com> writes:
> Out of topic, IIRC string-concatenate is faster than string-append.

The speed difference between them is surely insignificant, as they both
use the same code internally, and anyway efficiency hardly matters in
the test suite.  The reason for my suggestion was stylistic, but it's
not important.

      Mark



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

* Re: Make temp file in coding.test work on MS-Windows
  2014-08-12 21:35   ` Mark H Weaver
  2014-08-13  1:30     ` Nala Ginrut
@ 2014-08-13 15:43     ` Eli Zaretskii
  1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2014-08-13 15:43 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: ludo, guile-devel

> From: Mark H Weaver <mhw@netris.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  guile-devel <guile-devel@gnu.org>
> Date: Tue, 12 Aug 2014 17:35:11 -0400
> 
> > OK to commit, thanks.
> 
> Please untabify the lines you changed, and use 'string-append' instead
> of 'string-concatenate'.

Done and pushed.



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

end of thread, other threads:[~2014-08-13 15:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-09 14:16 Make temp file in coding.test work on MS-Windows Eli Zaretskii
2014-08-12 20:14 ` Ludovic Courtès
2014-08-12 21:35   ` Mark H Weaver
2014-08-13  1:30     ` Nala Ginrut
2014-08-13  3:02       ` Mark H Weaver
2014-08-13 15:43     ` Eli Zaretskii

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).