That's the answer. In reality I have a last line in the configure.ac that says "echo '#' make && make check && make install" - it does remind a casual install-from-source guy to do a "make check" before going to "make install". 't works pretty well, since many do a simple mousing copy-n-paste of that line in the terminal. It makes that `make check` also optional, possibly reducing time for your own development cycles with the same source tree (but perhaps you current `make check` is quick enough to be run always). Instead I have a rpm spec along that uses `make check` always - the rpm build is also a great way to check that off-develdir builds will succeed as well.
have fun, guido
Dr. David Kirkby schrieb:
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.