From: Eli Bendersky
Subject: CFFI tests problem
Date: 
Message-ID: <1185548194.956849.162610@q75g2000hsh.googlegroups.com>
Hello,

When attempting to run the tests/ of CFFI, I run into a problem: while
the compile.bat provided in the distribution attempts to compile the
libtest.c file with "cl" (MSVC's command line compiler), the latter
doesn't have the "stdint.h" header (required by C99 for the long long
type), and the compilation fails.

Were these tests actually run on a Windows platform with MSVC ? The
existence of the obviously Windows oriented compile.bat suggests so,
but on the other hand, it just doesn't work.

Did anyone have success beating this into submission?

Thanks in advance
Eli Bendersky
http://eli.thegreenplace.net

From: Daniel Albuschat
Subject: Re: CFFI tests problem
Date: 
Message-ID: <f8d1cq$gms$01$1@news.t-online.com>
Eli Bendersky wrote:
> Hello,
> 
> When attempting to run the tests/ of CFFI, I run into a problem: while
> the compile.bat provided in the distribution attempts to compile the
> libtest.c file with "cl" (MSVC's command line compiler), the latter
> doesn't have the "stdint.h" header (required by C99 for the long long
> type), and the compilation fails.
> 
> Were these tests actually run on a Windows platform with MSVC ? The
> existence of the obviously Windows oriented compile.bat suggests so,
> but on the other hand, it just doesn't work.

I guess it's because you use an outdated Microsoft-compiler (i.e.
MSVC6) that is not supported.
You can write a patch that does not use stdint.h if _MSC_VER <= 1200
(that's what _MSC_VER returns for me on MSVC6).

Regards,
    Daniel Albuschat
From: Ken Tilton
Subject: Re: CFFI tests problem
Date: 
Message-ID: <Wwoqi.51$Oz3.24@newsfe12.lga>
Daniel Albuschat wrote:
> Eli Bendersky wrote:
> 
>> Hello,
>>
>> When attempting to run the tests/ of CFFI, I run into a problem: while
>> the compile.bat provided in the distribution attempts to compile the
>> libtest.c file with "cl" (MSVC's command line compiler), the latter
>> doesn't have the "stdint.h" header (required by C99 for the long long
>> type), and the compilation fails.
>>
>> Were these tests actually run on a Windows platform with MSVC ? The
>> existence of the obviously Windows oriented compile.bat suggests so,
>> but on the other hand, it just doesn't work.
> 
> 
> I guess it's because you use an outdated Microsoft-compiler (i.e.
> MSVC6) that is not supported.
> You can write a patch that does not use stdint.h if _MSC_VER <= 1200
> (that's what _MSC_VER returns for me on MSVC6).

And offer it to the developers on the cffi-devel mailing list (full 
address not handy).

kzo
From: Luís Oliveira
Subject: Re: CFFI tests problem
Date: 
Message-ID: <m1tzrpifx8.fsf@deadspam.com>
Eli Bendersky <······@gmail.com> writes:
> Were these tests actually run on a Windows platform with MSVC ? The
> existence of the obviously Windows oriented compile.bat suggests so,
> but on the other hand, it just doesn't work.

At some point they were, yes.


> Did anyone have success beating this into submission?

And now they compile again.  See:
  <http://common-lisp.net/~loliveira/patches/libtest.patch>

Tested with MSVC8 though because that's what I have.  If it still
doesn't work with MSVC6, I suggest installing MSYS and MinGW.

HTH

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
From: Eli Bendersky
Subject: Re: CFFI tests problem
Date: 
Message-ID: <1185601115.473258.283990@d55g2000hsg.googlegroups.com>
On Jul 28, 1:29 am, ·············@deadspam.com (Lu�s Oliveira) wrote:
> Eli Bendersky <······@gmail.com> writes:
> > Were these tests actually run on a Windows platform with MSVC ? The
> > existence of the obviously Windows oriented compile.bat suggests so,
> > but on the other hand, it just doesn't work.
>
> At some point they were, yes.
>
> > Did anyone have success beating this into submission?
>
> And now they compile again.  See:
>   <http://common-lisp.net/~loliveira/patches/libtest.patch>
>

It appears that this patch file applies to a different libtest.c than
the one I've downloaded yesterday. Can you please provide your latest
snapshot of the tests/ directory with the changes ?

Thanks
Eli
From: Luís Oliveira
Subject: Re: CFFI tests problem
Date: 
Message-ID: <m1ps2cifzk.fsf@deadspam.com>
Eli Bendersky <······@gmail.com> writes:
> It appears that this patch file applies to a different libtest.c than
> the one I've downloaded yesterday. Can you please provide your latest
> snapshot of the tests/ directory with the changes ?

http://common-lisp.net/project/cffi/tarballs/cffi-070727.tar.gz

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
From: Eli Bendersky
Subject: Re: CFFI tests problem
Date: 
Message-ID: <1185678227.696040.224010@b79g2000hse.googlegroups.com>
On Jul 28, 7:40 pm, ·············@deadspam.com (Lu�s Oliveira) wrote:
> Eli Bendersky <······@gmail.com> writes:
> > It appears that this patch file applies to a different libtest.c than
> > the one I've downloaded yesterday. Can you please provide your latest
> > snapshot of the tests/ directory with the changes ?
>
> http://common-lisp.net/project/cffi/tarballs/cffi-070727.tar.gz

Now the C files compile fine. However, when attempting to run the
tests:

Running "nmake test-clisp" from the main directory complains:


GNU CLISP: -x with lisp-file is invalid: 'tests/run-tests.lisp)''
GNU CLISP: use '-h' for help


If I try to load directly from clisp:


[2]> (load "tests/run-tests.lisp")
;; Loading file tests\run-tests.lisp ...
;;; -------- Running tests in CLISP --------

*** - component CFFI-TESTS-SYSTEM::RT not found, required by #<SYSTEM
      "cffi-tests" #x19EE4485>
The following restarts are available:
SKIP           :R1      skip (OPERATE 'LOAD-OP 'CFFI-TESTS ...)
STOP           :R2      stop loading file C:\eli\clisp\cffi\tests\run-
tests.lisp

ABORT          :R3      ABORT


Thanks for your support so far, Luis, it's really appreciated. I think
it's a good thing for it to go through this group - it's best
searchable later this way.

Eli

Eli
From: Luís Oliveira
Subject: Re: CFFI tests problem
Date: 
Message-ID: <m1lkczj0q9.fsf@deadspam.com>
Eli Bendersky <······@gmail.com> writes:
> *** - component CFFI-TESTS-SYSTEM::RT not found, required by #<SYSTEM
>       "cffi-tests" #x19EE4485>

You need RT to have installed.  See <http://cliki.net/rt>.


> Thanks for your support so far, Luis, it's really appreciated. I think
> it's a good thing for it to go through this group - it's best
> searchable later this way.

The cffi-devel mailing list is searchable as well.  Your chances of
getting a fast reply are much higher there, btw.

See ya,

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
From: Ken Tilton
Subject: Re: CFFI tests problem
Date: 
Message-ID: <5eVqi.1637$cM5.506@newsfe12.lga>
Luís Oliveira wrote:
> Eli Bendersky <······@gmail.com> writes:
> 
>>*** - component CFFI-TESTS-SYSTEM::RT not found, required by #<SYSTEM
>>      "cffi-tests" #x19EE4485>
> 
> 
> You need RT to have installed.  See <http://cliki.net/rt>.
> 
> 
> 
>>Thanks for your support so far, Luis, it's really appreciated. I think
>>it's a good thing for it to go through this group - it's best
>>searchable later this way.
> 
> 
> The cffi-devel mailing list is searchable as well.  Your chances of
> getting a fast reply are much higher there, btw.

Recall, Mr. Oliveira, that the mission you accepted with your first SoC 
project had as its objective world domination and your instant 
nomination to the Lisp Hall of Hame. This is best achieved by running 
your dirty laundry straight down Main Street, aka this NG.

Recall that we want to create the illusion of popularity so as to suck 
another generation of productivity down the hole with Lisp, and that 
means a lot of very public nooby hugging every where you turn.

Perhaps a too long way of saying *-devel should be conducted here. As 
the great Jay Sulzberger once declared, "An end to the cabals!"

kzo


-- 
http://www.theoryyalgebra.com/

"Algebra is the metaphysics of arithmetic." - John Ray

"As long as algebra is taught in school,
there will be prayer in school." - Cokie Roberts

"Stand firm in your refusal to remain conscious during algebra."
    - Fran Lebowitz

"I'm an algebra liar. I figure two good lies make a positive."
    - Tim Allen
From: Eli Bendersky
Subject: Re: CFFI tests problem
Date: 
Message-ID: <1185722417.932001.21650@d55g2000hsg.googlegroups.com>
On Jul 29, 6:24 am, ·············@deadspam.com (Lu�s Oliveira) wrote:
> Eli Bendersky <······@gmail.com> writes:
> > *** - component CFFI-TESTS-SYSTEM::RT not found, required by #<SYSTEM
> >       "cffi-tests" #x19EE4485>
>
> You need RT to have installed.  See <http://cliki.net/rt>.
>

Now I get:

[4]> (load "tests/run-tests")
;; Loading file C:\eli\clisp\cffi\tests\run-tests.lisp ...
;;; -------- Running tests in CLISP --------
WARNING: The generic function #<STANDARD-GENERIC-FUNCTION EXPAND-TO-
FOREIGN>
         is being modified, but has already been called.
WARNING: FFI::FOREIGN-LIBRARY-FUNCTION: no dynamic object named
"stdcall_fun"
         in library :DEFAULT
WARNING: The generic function #<STANDARD-GENERIC-FUNCTION EXPAND-TO-
FOREIGN>
         is being modified, but has already been called.
WARNING: The generic function #<STANDARD-GENERIC-FUNCTION EXPAND-FROM-
FOREIGN>
         is being modified, but has already been called.
WARNING: The generic function #<STANDARD-GENERIC-FUNCTION EXPAND-TO-
FOREIGN>
         is being modified, but has already been called.
WARNING: The generic function
          #<STANDARD-GENERIC-FUNCTION TRANSLATE-FROM-FOREIGN>
         is being modified, but has already been called.
WARNING: The generic function #<STANDARD-GENERIC-FUNCTION EXPAND-TO-
FOREIGN>
         is being modified, but has already been called.
WARNING: Replacing method
          #<STANDARD-METHOD
            (#<BUILT-IN-CLASS T> #<STANDARD-CLASS ERROR-ERROR>)>
         in #<STANDARD-GENERIC-FUNCTION EXPAND-TO-FOREIGN>
WARNING: The generic function #<STANDARD-GENERIC-FUNCTION EXPAND-FROM-
FOREIGN>
         is being modified, but has already been called.
WARNING: Replacing method
          #<STANDARD-METHOD
            (#<BUILT-IN-CLASS T> #<STANDARD-CLASS ERROR-ERROR>)>
         in #<STANDARD-GENERIC-FUNCTION EXPAND-FROM-FOREIGN>
WARNING: Replacing method
          #<STANDARD-METHOD
            (#<BUILT-IN-CLASS T> #<STANDARD-CLASS EXPAND-TRACKER>)>
         in #<STANDARD-GENERIC-FUNCTION EXPAND-TO-FOREIGN>

How many times shall we run the tests (uncompiled)? [1]:
Doing 217 pending tests of 217 tests total.
 FUNCALL.CHAR FUNCALL.INT.1 FUNCALL.INT.2 FUNCALL.LONG FUNCALL.LONG-
LONG
 FUNCALL.FLOAT FUNCALL.DOUBLE FUNCALL.STRING.1 FUNCALL.STRING.2
 FUNCALL.STRING.3 FUNCALL.VARARGS.CHAR FUNCALL.VARARGS.INT
 FUNCALL.VARARGS.LONG
Test FUNCALL.VARARGS.DOUBLE failed
Form:
(WITH-FOREIGN-POINTER-AS-STRING (S 100) (SETF (MEM-REF S :CHAR) 0)
 (FOREIGN-FUNCALL "sprintf" :POINTER S :STRING "%.2f" :DOUBLE
  (COERCE PI 'DOUBLE-FLOAT) :INT))
Expected value: "3.14"
Actual value: #<error during printing>
 FUNCALL.VARARGS.STRING FUNCALL.DOUBLE26 FUNCALL.FLOAT26 FUNCALL.F-S-P.
1
 FUNCALL.NAMESPACE.1
WARNING: FFI::FOREIGN-LIBRARY-FUNCTION: no dynamic object named
"stdcall_fun"
         in library :DEFAULT
Test FUNCALL.STDCALL.1 failed
Form:
(FLET
 ((FUN NIL
   (FOREIGN-FUNCALL ("stdcall_fun" :CCONV :STDCALL) :INT 1 :INT 2 :INT
3
    :INT)))
 (LOOP REPEAT 100 DO (FUN) FINALLY (RETURN (FUN))))
Expected value: 6
Actual value: #<SYSTEM::SIMPLE-UNDEFINED-FUNCTION #x19F5A8B5>.
 DEFCFUN.CHAR DEFCFUN.INT DEFCFUN.LONG DEFCFUN.LONG-LONG DEFCFUN.FLOAT
 DEFCFUN.DOUBLE DEFCFUN.STRING.1 DEFCFUN.STRING.2 DEFCFUN.STRING.3
 DEFCFUN.NOARGS DEFCFUN.NOOP DEFCFUN.VARARGS.CHAR
DEFCFUN.VARARGS.SHORT
 DEFCFUN.VARARGS.INT DEFCFUN.VARARGS.LONG
Test DEFCFUN.VARARGS.FLOAT failed
Form: (WITH-FOREIGN-POINTER-AS-STRING (S 100) (SPRINTF S "%.2f" :FLOAT
(FLOAT PI
)))
Expected value: "3.14"
Actual value: #<error during printing>
Test DEFCFUN.VARARGS.DOUBLE failed
Form:
(WITH-FOREIGN-POINTER-AS-STRING (S 100)
 (SPRINTF S "%.2f" :DOUBLE (FLOAT PI 1.0d0)))
Expected value: "3.14"
Actual value: #<error during printing>
 DEFCFUN.VARARGS.STRING DEFCFUN.BFF.1 DEFCFUN.BFF.2
WARNING: FFI::FOREIGN-LIBRARY-FUNCTION: no dynamic object named
         "undefined_foreign_function" in library :DEFAULT
 DEFCFUN.UNDEFINED DEFCFUN.DOUBLE26 DEFCFUN.FLOAT26 DEFCFUN.NAMESPACE.
1
Test DEFCFUN.STDCALL.1 failed
Form: (LOOP REPEAT 100 DO (STDCALL-FUN 1 2 3) FINALLY (RETURN (STDCALL-
FUN 1 2 3
)))
Expected value: 6
Actual value: #<SYSTEM::SIMPLE-UNDEFINED-FUNCTION #x19F7D455>.
 CALLBACKS.CHAR CALLBACKS.UNSIGNED-CHAR CALLBACKS.SHORT
 CALLBACKS.UNSIGNED-SHORT CALLBACKS.INT CALLBACKS.UNSIGNED-INT
 CALLBACKS.LONG CALLBACKS.UNSIGNED-LONG CALLBACKS.LONG-LONG
 CALLBACKS.UNSIGNED-LONG-LONG CALLBACKS.FLOAT CALLBACKS.DOUBLE
 CALLBACKS.POINTER CALLBACKS.STRING CALLBACKS.STRING-NOT-DOCSTRING
 CALLBACKS.QSORT CALLBACKS.VOID CALLBACKS.FUNCALL.1 CALLBACKS.FUNCALL.
2
 CALLBACKS.BFF.1 CALLBACKS.BFF.2 CALLBACKS.NON-EXISTANT
 CALLBACKS.DOUBLE26 CALLBACKS.DOUBLE26.FUNCALL CALLBACKS.FLOAT26
 CALLBACKS.FLOAT26.FUNCALL CALLBACKS.STDCALL.1 FOREIGN-
GLOBALS.REF.CHAR
 FOREIGN-GLOBALS.REF.UNSIGNED-CHAR FOREIGN-GLOBALS.REF.SHORT
...
...
... [goes on and on]
From: Luís Oliveira
Subject: Re: CFFI tests problem
Date: 
Message-ID: <m1hcnliph4.fsf@deadspam.com>
Eli Bendersky <······@gmail.com> writes:
> Now I get:
[...]
> Doing 217 pending tests of 217 tests total.
>  FUNCALL.CHAR FUNCALL.INT.1 FUNCALL.INT.2 FUNCALL.LONG
[...]

There you go.  RT prints the names of the successful tests as it runs
them.  Looks like most of them are passing.

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
From: Eli Bendersky
Subject: Re: CFFI tests problem
Date: 
Message-ID: <1185850787.906828.155850@q75g2000hsh.googlegroups.com>
On Jul 30, 10:52 pm, ·············@deadspam.com (Luís Oliveira) wrote:
> Eli Bendersky <······@gmail.com> writes:
> > Now I get:
> [...]
> > Doing 217 pending tests of 217 tests total.
> >  FUNCALL.CHAR FUNCALL.INT.1 FUNCALL.INT.2 FUNCALL.LONG
>
> [...]
>
> There you go.  RT prints the names of the successful tests as it runs
> them.  Looks like most of them are passing.
>

I would expect them all to pass. Why not ?
And those warnings - are they normal ?

Eli