I took a look at this issue more carefully. Here is what the Makefile
does under MSYS:
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list='$(TESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
;; \
*) \
echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \
done; \
......<SNIP>
Basically $$tst is the test that is being run, which changes in the
loop. On MSYS $(TESTS_ENVIRONMENT) is blank, and $${dir} is ./
There are test files in the /tests directory (where this makefile is).
These have names like t-parity.exe. There are also test wrappers, with
names like t-parity, which are scripts, which presumably set up the
environment correctly to test the shared library. The corresponding
tests, with names like t-parity.exe are in the .libs directory.
The excerpt from the Makefile above clearly tests the static ones, in
the actual /tests directory, not the shared ones in the /tests/.libs
directory.
The problem appears to be that under MSYS, if $(TESTS_ENVIRONMENT)
$${dir}$$tst; is not the correct way to determine the return value of
a program. Instead, one should do if [ "$?" -eq "0" ]; assuming that
the test has just been run. But this won't work because the entire
make check thing is one line of bash script (note the \ characters at
the end of each line) and under MSYS, $? gives the return value of the
command run on the previous line.
I actually don't have any idea how to get the return value from a
program in MSYS.
Anyhow, I've cc'ed this to mpir-dev and the discussion can continue
there, if anyone is interested or has some insight. The discussion
about how to fix the problem will be too long for mpir-devel.
Bill.
2009/6/4 Bill Hart <[email protected]>:
> 2009/6/4 Cactus <[email protected]>:
>>
>>
>>
>> On Jun 4, 11:15 am, Peter_APIIT <[email protected]> wrote:
>>> How about command to rebuild with cpp interface in static library
>>> format ?
>>
>> To build the static library for the C++ interface with MSVC, first
>> build the version of GMP you want.
>
> You mean MPIR, not GMP. :-)
>
>> This will produce the static C
>> library mpir.lib.
>>
>> Then build the C++ interface as a static library with the lib_mpir_cpp
>> project. This will produce the mpirxx.lib library, which is the C++
>> interface to mpir.
>>
>> Then link both mpir.lib and mpirxx.lib with your C++ application.
>>
>> Brian
>>
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"mpir-devel" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/mpir-devel?hl=en
-~----------~----~----~----~------~----~------~--~---