[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can I force 'make install' to depend on 'make test'?
From: |
Dr. David Kirkby |
Subject: |
Re: Can I force 'make install' to depend on 'make test'? |
Date: |
Tue, 25 Mar 2003 01:30:08 +0000 |
Ronald Landheer-Cieslak wrote:
>
> Though I really don't think it's a good idea, have you tried just adding
> install : check to your Makefile.am?
>
No, I had not, I might try that - but see below.
> Anyways, the reason I don't think it's a good idea is that it will break
> cross-compiling, as your test programs will probably not run on the build
> host in that case..
Can you suggest a better way? I'm open to suggestions, as I'm not convinced my
current method is optimal at all. I had not even considered cross-compilation
issues.
In fact, I would *much appreciate* any suggestions for a better method(s). I'm
sure what I am trying to do is not the best way, but don't know of a better
one.
Basically I will have several source (.c) files that will create 10 platform
dependant binary files (executables). All except one of these 10 binary files
are designed to quickly produce bitmaps of simple shapes. (i.e. a circle inside
a rectangle, a rectangle insider a circle ...)
Next I want to check the 9 binaries are indeed producing the correct bitmaps,
so I check the md5 checksum of the bitmaps produced by the 9 binaries. So a
test is basically like this (must simplified)
create_bitmap_for_rect_in_rect foo.bmp
MD5SUM=`md5 foo.bmp`
if [ $MD5SUM != bdfb21053d9af7302bb587b1b89c113a ] ; then
exit 1
else
exit 0
fi
If the md5 checksum of the bitmaps agree with what I expect, I can assume the 9
binaries are functioning properly.
After creating the bitmaps with these 9 executables, another program (the 10th
binary, called 'atlc') will run a long cpu intensive numerical simulation based
on the contents of each bitmap. The output of 'atlc' consists of 6 further
bitamps and a text file.
I was expecting for the output from 10th binary (atlc) to be useful it two ways.
1) I can check the checkum of the output files, confirming atlc works okay.
2) I can install some of the files produced by atlc, for the purpose of
examples.
Hence my dilemma. It seems sensible to me that 'make install' requires that
'make check' has already been run, but I'm open to suggestions of how to be
structure this.
Should the tests just create files, check their checksum, then remove the
files? Or is it better to leave the files around, so they can be installed as
examples? Since I want to install these as examples and generating them is time
consuming, it seems sensible to do it only once.
Any help appreciated.
--
Dr. David Kirkby,
Senior Research Fellow,
Department of Medical Physics,
University College London,
11-20 Capper St, London, WC1E 6JA.
Tel: 020 7679 6408 Fax: 020 7679 6269
Internal telephone: ext 46408
e-mail address@hidden