diff --git a/graphics/bitmap/Makefile b/graphics/bitmap/Makefile index b86212cccfbf..4f57c232cfb8 100644 --- a/graphics/bitmap/Makefile +++ b/graphics/bitmap/Makefile @@ -22,9 +22,12 @@ PLIST_FILES= include/bitmap_image.hpp do-install: ${INSTALL_DATA} ${WRKSRC}/bitmap_image.hpp ${STAGEDIR}${PREFIX}/include -do-test: # tests failure reported to the author: Error - Failed to open 'image.bmp' +do-test: @cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} bitmap_test && \ - ./bitmap_test + ${CXX} ${CXXFLAGS} -o mk-image ${FILESDIR}/mk-image.cpp -I. && \ + ./mk-image && \ + ./bitmap_test && \ + ${ECHO} "Tests succeeded" .include diff --git a/graphics/bitmap/files/mk-image.cpp b/graphics/bitmap/files/mk-image.cpp new file mode 100644 index 000000000000..17b5494c66d9 --- /dev/null +++ b/graphics/bitmap/files/mk-image.cpp @@ -0,0 +1,21 @@ +#include "bitmap_image.hpp" + +// creates the BMP image image.bmp that tests expect + +int main() +{ + bitmap_image base(1024, 800); + base.clear(); + + const double c1 = 0.8; + const double c2 = 0.4; + const double c3 = 0.2; + const double c4 = 0.6; + + ::srand(0xA5AA57A0); + plasma(base, 0, 0, base.width(), base.height(), c1, c2, c3, c4, 3.0, jet_colormap); + + base.save_image("image.bmp"); + + return 0; +}