|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83575 - trunk/libs/gil/test
From: chhenning_at_[hidden]
Date: 2013-03-25 20:48:40
Author: chhenning
Date: 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
New Revision: 83575
URL: http://svn.boost.org/trac/boost/changeset/83575
Log:
Changed gil's test suite to use boost::test.
Added:
trunk/libs/gil/test/test.cpp (contents, props changed)
Removed:
trunk/libs/gil/test/Makefile
trunk/libs/gil/test/image_io.cpp
trunk/libs/gil/test/main.cpp
Text files modified:
trunk/libs/gil/test/Jamfile.v2 | 75 +++++++++++++++++---------------
trunk/libs/gil/test/channel.cpp | 19 +++++++
trunk/libs/gil/test/image.cpp | 90 ++++++++++++++-------------------------
trunk/libs/gil/test/performance.cpp | 12 ++++-
trunk/libs/gil/test/pixel.cpp | 12 ++++-
trunk/libs/gil/test/pixel_iterator.cpp | 12 ++++-
6 files changed, 116 insertions(+), 104 deletions(-)
Modified: trunk/libs/gil/test/Jamfile.v2
==============================================================================
--- trunk/libs/gil/test/Jamfile.v2 (original)
+++ trunk/libs/gil/test/Jamfile.v2 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
@@ -1,40 +1,45 @@
-# Copyright 2008 Lubomir Bourdev and Hailin Jin
-#
+# Boost.GIL
+#
+# (C) Copyright 2008: Lubomir Bourdev and Hailin Jin
+#
# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt)
+# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-# Jamfile for building the GIL test app
+# bring in rules for testing
+import testing ;
-project libs/gil/test ;
+project
+ : requirements
+ <library>/boost/test//boost_unit_test_framework
+ <link>static
+ <include>../../../..
+ <toolset>intel:<debug-symbols>off
+ <toolset>msvc-7.1:<debug-symbols>off
+ <toolset>msvc-8.0:<define>_SCL_SECURE_NO_DEPRECATE <define>_CRT_SECURE_NO_DEPRECATE <define>_CRT_NONSTDC_NO_DEPRECATE
+ <toolset>msvc-9.0:<define>_SCL_SECURE_NO_DEPRECATE <define>_CRT_SECURE_NO_WARNINGS <define>_CRT_NONSTDC_NO_DEPRECATE
+ <toolset>msvc-10.0:<define>_SCL_SECURE_NO_DEPRECATE <define>_CRT_SECURE_NO_WARNINGS <define>_CRT_NONSTDC_NO_DEPRECATE
+ <link>static
+ <library>/boost/test//boost_unit_test_framework
+# <library>/boost/system//boost_system
+ ;
-import testing ;
+test-suite "gil"
+ :
+ [ run
+ # sources
+ test.cpp
+ error_if.cpp
+ image.cpp
+ performance.cpp
+ pixel.cpp
+ pixel_iterator.cpp
+ sample_image.cpp
+ : # args
+ : # input-files
+ : # requirements
+ : # target-name
+ gil_tests
+ : # default-build
+ ]
-test-suite gil :
- [ run image.cpp
- sample_image.cpp
- error_if.cpp
- :
- :
- : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]
- [ run channel.cpp
- error_if.cpp
- :
- :
- : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]
- [ run pixel.cpp
- error_if.cpp
- :
- :
- : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]
- [ run pixel_iterator.cpp
- error_if.cpp
- :
- :
- : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]
- [ run image_io.cpp
- error_if.cpp
- :
- :
- : <include>$(BOOST_ROOT) <define>BOOST_GIL_NO_IO <define>_SCL_SECURE_NO_WARNINGS ]
-;
+ ;
Deleted: trunk/libs/gil/test/Makefile
==============================================================================
--- trunk/libs/gil/test/Makefile 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
+++ (empty file)
@@ -1,53 +0,0 @@
-# Copyright 2008 Lubomir Bourdev and Hailin Jin
-#
-# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-
-.SUFFIXES: .cpp
-#CXX=/usr/local/gcc4/bin/g++
-#CXX=/usr/local/gcc411/bin/g++
-CXX=/usr/local/gcc430/bin/g++
-#CXX=g++
-#CXX='/cygdrive/c/Program Files/Intel/Compiler/C++/10.0.027/IA32/Bin/icl.exe'
-
-CXX_FLAGS=-Wall -DBOOST_GIL_USE_CONCEPT_CHECK #-DNDEBUG
-CXX_CHECKSUM_FLAGS=-Wall -DBOOST_GIL_NO_IO -DBOOST_GIL_USE_CONCEPT_CHECK #-DNDEBUG
-
-BOOST_INCLUDE_PATH=-I../../.. -I../../../../boost_libraries
-LIBJPEG_INCLUDE_PATH=-I../../../../lib/libjpeg
-LIBJPEG_LIB_PATH=-L../../../../lib/libjpeg
-LIBTIFF_INCLUDE_PATH=-I../../../../lib/libtiff
-LIBTIFF_LIB_PATH=-L../../../../lib/libtiff
-LIBPNG_INCLUDE_PATH=-I../../../../lib/libpng
-LIBPNG_LIB_PATH=-L../../../../lib/libpng
-LIBZ_LIB_PATH=-L../../../../lib/zlib
-
-all: performance channel_test pixel_test pixel_iterator_test image_checksum_test image_io_checksum_test
-.cpp.o:
-# ${CXX} ${CXX_FLAGS} ${BOOST_INCLUDE_PATH} ${LIBJPEG_INCLUDE_PATH} ${LIBTIFF_INCLUDE_PATH} ${LIBPNG_INCLUDE_PATH} -c $<
- ${CXX} ${CXX_CHECKSUM_FLAGS} ${BOOST_INCLUDE_PATH} -c $<
-clean:
- -rm -f *.o *.exe
-performance: performance.o
- ${CXX} -o performance ${CXX_FLAGS} performance.o
-channel_test: channel.o error_if.o
- ${CXX} -o channel_test ${CXX_CHECKSUM_FLAGS} channel.o error_if.o
-pixel_test: pixel.o error_if.o
- ${CXX} -o pixel_test ${CXX_CHECKSUM_FLAGS} pixel.o error_if.o
-pixel_iterator_test: pixel_iterator.o error_if.o
- ${CXX} -o pixel_iterator_test ${CXX_CHECKSUM_FLAGS} pixel_iterator.o error_if.o
-image_checksum_test: image.o error_if.o sample_image.o
- ${CXX} -o image_checksum_test ${CXX_CHECKSUM_FLAGS} image.o error_if.o sample_image.o
-image_test: image.o error_if.o sample_image.o
- ${CXX} -o image_test ${CXX_FLAGS} image.o error_if.o sample_image.o ${LIBJPEG_LIB_PATH} -ljpeg ${LIBTIFF_LIB_PATH} -ltiff ${LIBPNG_LIB_PATH} -lpng ${LIBZ_LIB_PATH} -lz
-image_io_checksum_test: image_io.o error_if.o
- ${CXX} -o image_io_checksum_test ${CXX_CHECKSUM_FLAGS} image_io.o error_if.o
-image_io_test: image_io.o error_if.o
- ${CXX} -o image_io_test ${CXX_FLAGS} image_io.o error_if.o ${LIBJPEG_LIB_PATH} -ljpeg ${LIBTIFF_LIB_PATH} -ltiff ${LIBPNG_LIB_PATH} -lpng ${LIBZ_LIB_PATH} -lz
-run_all: channel_test pixel_test pixel_iterator_test image_checksum_test image_io_checksum_test
- channel_test
- pixel_test
- pixel_iterator_test
- image_checksum_test
- image_io_checksum_test
Modified: trunk/libs/gil/test/channel.cpp
==============================================================================
--- trunk/libs/gil/test/channel.cpp (original)
+++ trunk/libs/gil/test/channel.cpp 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
@@ -15,6 +15,14 @@
#include <boost/gil/channel_algorithm.hpp>
#include <boost/gil/gil_concept.hpp>
+#include <boost/test/unit_test.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(push)
+#pragma warning(disable:4512) //assignment operator could not be generated
+#endif
+
+
using namespace boost::gil;
using namespace std;
@@ -357,11 +365,15 @@
do_test<reference_core<const channel_archetype&> >();
}
-int main(int argc, char* argv[]) {
+BOOST_AUTO_TEST_SUITE(GIL_Tests)
+
+BOOST_AUTO_TEST_CASE(channel_test)
+{
test_channel();
- return 0;
}
+BOOST_AUTO_TEST_SUITE_END()
+
// TODO:
// - provide algorithm performance overloads for scoped channel and packed channels
// - Update concepts and documentation
@@ -370,3 +382,6 @@
// - is channel_convert the same as native?
// - is operator++ on bits32f the same as native? How about if operator++ is defined in scoped_channel to do _value++?
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(pop)
+#endif
Modified: trunk/libs/gil/test/image.cpp
==============================================================================
--- trunk/libs/gil/test/image.cpp (original)
+++ trunk/libs/gil/test/image.cpp 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
@@ -27,6 +27,8 @@
#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
#include <boost/crc.hpp>
+#include <boost/test/unit_test.hpp>
+
using namespace boost::gil;
using namespace std;
using namespace boost;
@@ -34,6 +36,12 @@
extern rgb8c_planar_view_t sample_view;
void error_if(bool condition);
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(push)
+#pragma warning(disable:4127) //conditional expression is constant
+#endif
+
+
// When BOOST_GIL_GENERATE_REFERENCE_DATA is defined, the reference data is generated and saved.
// When it is undefined, regression tests are checked against it
//#define BOOST_GIL_GENERATE_REFERENCE_DATA
@@ -456,41 +464,6 @@
const string out_dir=in_dir+"image-out/"; // directory where to write output
const string ref_dir=in_dir+"image-ref/"; // reference directory to compare written with actual output
-#ifndef BOOST_GIL_NO_IO
-
-#include <boost/gil/extension/io/jpeg_io.hpp>
-
-class file_image_mgr : public image_test {};
-
-class file_image_test : public file_image_mgr {
-public:
- file_image_test(const char*) {}
-protected:
- void check_view_impl(const boost::gil::rgb8c_view_t& img_view,const string& name) {
- jpeg_write_view(out_dir+name+".jpg",img_view);
- rgb8_image_t img1, img2;
- jpeg_read_and_convert_image(out_dir+name+".jpg",img1);
- cerr << "Testing "<<name<<"\n";
-
- jpeg_read_and_convert_image(ref_dir+name+".jpg",img2);
- if (img1!=img2) {
- cerr << "Error with "<<name<<"\n";
- error_if(true);
- }
- }
-};
-
-class file_image_generate : public file_image_mgr {
-public:
- file_image_generate(const char*) {}
-protected:
- void check_view_impl(const boost::gil::rgb8c_view_t& img_view,const string& name) {
- jpeg_write_view(ref_dir+name+".jpg",img_view);
- cerr << "Writing "<<name<<"\n";
- }
-};
-#endif
-
void static_checks() {
gil_function_requires<ImageConcept<rgb8_image_t> >();
@@ -530,13 +503,8 @@
}
}
-#ifdef BOOST_GIL_NO_IO
typedef checksum_image_test image_test_t;
typedef checksum_image_generate image_generate_t;
-#else
-typedef file_image_test image_test_t;
-typedef file_image_generate image_generate_t;
-#endif
#ifdef BOOST_GIL_GENERATE_REFERENCE_DATA
typedef image_generate_t image_mgr_t;
@@ -551,22 +519,28 @@
static_checks();
}
-int main(int argc, char* argv[]) {
- const char* local_name = "gil_reference_checksums.txt";
- const char* name_from_status = "../libs/gil/test/gil_reference_checksums.txt";
-
- std::ifstream file_is_there(local_name);
- if (file_is_there) {
- test_image(local_name);
- } else {
- std::ifstream file_is_there(name_from_status);
- if (file_is_there)
- test_image(name_from_status);
- else {
- std::cerr << "Unable to open gil_reference_checksums.txt"<<std::endl;
- return 1;
- }
- }
+BOOST_AUTO_TEST_SUITE(GIL_Tests)
- return 0;
-}
\ No newline at end of file
+BOOST_AUTO_TEST_CASE(image_test)
+{
+ //const char* local_name = "gil_reference_checksums.txt";
+ //const char* name_from_status = "../libs/gil/test/gil_reference_checksums.txt";
+
+ //std::ifstream file_is_there(local_name);
+ //if (file_is_there) {
+ // test_image(local_name);
+ //} else {
+ // std::ifstream file_is_there(name_from_status);
+ // if (file_is_there)
+ // test_image(name_from_status);
+ // else {
+ // throw std::runtime_error( "Unable to open gil_reference_checksums.txt" );
+ // }
+ //}
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(pop)
+#endif
Deleted: trunk/libs/gil/test/image_io.cpp
==============================================================================
--- trunk/libs/gil/test/image_io.cpp 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
+++ (empty file)
@@ -1,191 +0,0 @@
-/*
- Copyright 2005-2007 Adobe Systems Incorporated
-
- Use, modification and distribution are subject to the Boost Software License,
- Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-
- See http://opensource.adobe.com/gil for most recent version including documentation.
-*/
-
-#include <boost/mpl/vector.hpp>
-#include <boost/gil/typedefs.hpp>
-#include <boost/gil/extension/dynamic_image/any_image.hpp>
-#include <boost/gil/image_view.hpp>
-#include <boost/gil/planar_pixel_reference.hpp>
-#include <boost/gil/color_convert.hpp>
-#include <boost/gil/typedefs.hpp>
-#include <boost/gil/image_view_factory.hpp>
-#ifndef BOOST_GIL_NO_IO
-#include <boost/gil/extension/io/tiff_io.hpp>
-#include <boost/gil/extension/io/jpeg_io.hpp>
-#include <boost/gil/extension/io/png_io.hpp>
-#include <boost/gil/extension/io/tiff_dynamic_io.hpp>
-#include <boost/gil/extension/io/jpeg_dynamic_io.hpp>
-#include <boost/gil/extension/io/png_dynamic_io.hpp>
-#endif
-
-using namespace boost::gil;
-
-typedef any_image<boost::mpl::vector<gray8_image_t, bgr8_image_t, argb8_image_t,
- rgb8_image_t, rgb8_planar_image_t,
- cmyk8_image_t, cmyk8_planar_image_t,
- rgba8_image_t, rgba8_planar_image_t> > any_image_t;
-
-#ifdef BOOST_GIL_NO_IO
-void test_image_io() {} // IO is not tested when BOOST_GIL_NO_IO is enabled
-#else
-void test_image_io() {
- const std::string in_dir=""; // directory of source images
- const std::string out_dir=in_dir+"image_io-out\\";
-// ***********************************
-// ************************ GRAY IMAGE
-// ***********************************
- gray8_image_t imgGray;
-// TIFF
- // load gray tiff into gray image
- tiff_read_image(in_dir+"gray.tif",imgGray);
- // save gray image to tiff
- tiff_write_view(out_dir+"grayFromGray.tif",view(imgGray));
-
- // load RGB tiff into gray image
- tiff_read_and_convert_image(in_dir+"RGB.tif",imgGray);
-
- // save gray image to tiff (again!)
- tiff_write_view(out_dir+"grayFromRGB.tif",view(imgGray));
-
-// JPEG
- // load gray jpeg into gray image
- jpeg_read_image(in_dir+"gray.jpg",imgGray);
- // save gray image to gray jpeg
- jpeg_write_view(out_dir+"grayFromGray.jpg",view(imgGray));
-
- // load RGB jpeg into gray image
- jpeg_read_and_convert_image(in_dir+"RGB.jpg",imgGray);
- // save gray image to RGB jpeg
- jpeg_write_view(out_dir+"grayFromRGB.jpg",color_converted_view<rgb8_pixel_t>(view(imgGray)));
-
-// PNG
- // load gray png into gray image
- png_read_image(in_dir+"gray.png",imgGray);
- // save gray image to gray png
- png_write_view(out_dir+"grayFromGray.png",view(imgGray));
-
- // load RGB png into gray image
- png_read_and_convert_image(in_dir+"RGB.png",imgGray);
- // save gray image to RGB png
- png_write_view(out_dir+"grayFromRGB.png",color_converted_view<rgb8_pixel_t>(view(imgGray)));
-
-// ***********************************
-// ************************* RGB Planar
-// ***********************************
-
- rgb8_image_t imgRGB;
-
-// TIFF
-
- // load gray tiff into RGB image
- tiff_read_and_convert_image(in_dir+"gray.tif",imgRGB);
- // save RGB image to tiff
- tiff_write_view(out_dir+"RGBFromGray.tif",view(imgRGB));
-
- // load RGB tiff into RGB image
- tiff_read_image(in_dir+"RGB.tif",imgRGB);
- // save RGB image to tiff (again!)
- tiff_write_view(out_dir+"RGBFromRGB.tif",view(imgRGB));
-
-// JPEG
- // load gray jpeg into RGB image
- jpeg_read_and_convert_image(in_dir+"gray.jpg",imgRGB);
- // save RGB image to gray jpeg
- jpeg_write_view(out_dir+"RGBFromGray.jpg",view(imgRGB));
-
- // load RGB jpeg into RGB image
- jpeg_read_image(in_dir+"RGB.jpg",imgRGB);
- // save RGB image to RGB jpeg
- jpeg_write_view(out_dir+"RGBFromRGB.jpg",view(imgRGB));
-
-// PNG
- // load gray png into RGB image
- png_read_and_convert_image(in_dir+"gray.png",imgRGB);
- // save RGB image to gray png
- png_write_view(out_dir+"RGBFromGray.png",view(imgRGB));
-
- // load RGB png into RGB image
- png_read_image(in_dir+"RGB.png",imgRGB);
- // save RGB image to RGB png
- png_write_view(out_dir+"RGBFromRGB.png",view(imgRGB));
-
-// ***********************************
-// ************************ GRAY32 Planar
-// ***********************************
- gray32f_image_t imgGray32;
-// TIFF
- // load gray tiff into gray image
- tiff_read_and_convert_image(in_dir+"gray.tif",imgGray32);
- // save gray image to tiff
- tiff_write_view(out_dir+"gray32FromGray.tif",view(imgGray32));
-
- // load RGB tiff into gray image
- tiff_read_and_convert_image(in_dir+"RGB.tif",imgGray32);
-
- // save gray image to tiff (again!)
- tiff_write_view(out_dir+"gray32FromRGB.tif",view(imgGray32));
-
-// JPEG
- tiff_read_and_convert_image(in_dir+"gray.tif",imgGray32); // again TIF (jpeg load not supported)
- // save RGB image to gray jpeg
- tiff_write_view(out_dir+"gray32FromGray.jpg",view(imgGray32));
-
- // load RGB jpeg into RGB image
- tiff_read_and_convert_image(in_dir+"RGB.tif",imgGray32); // again TIF (jpeg load not supported)
- // save RGB image to RGB jpeg
- tiff_write_view(out_dir+"gray32FromRGB.jpg",color_converted_view<rgb32f_pixel_t>(view(imgGray32)));
-
-// ***********************************
-// ************************ NATIVE Planar
-// ***********************************
- any_image_t anyImg;
-
-// TIFF
- // load RGB tiff into any image
- tiff_read_image(in_dir+"RGB.tif",anyImg);
-
- // save any image to tiff
- tiff_write_view(out_dir+"RGBNative.tif",view(anyImg));
-
- // load gray tiff into any image
- tiff_read_image(in_dir+"gray.tif",anyImg);
-
- // save any image to tiff
- tiff_write_view(out_dir+"grayNative.tif",view(anyImg));
-
-// JPEG
- // load gray jpeg into any image
- jpeg_read_image(in_dir+"gray.jpg",anyImg);
- // save any image to jpeg
- jpeg_write_view(out_dir+"grayNative.jpg",view(anyImg));
-
- // load RGB jpeg into any image
- jpeg_read_image(in_dir+"RGB.jpg",anyImg);
- // save any image to jpeg
- jpeg_write_view(out_dir+"RGBNative.jpg",view(anyImg));
-
-// PNG
- // load gray png into any image
- png_read_image(in_dir+"gray.png",anyImg);
- // save any image to png
- png_write_view(out_dir+"grayNative.png",view(anyImg));
-
- // load RGB png into any image
- png_read_image(in_dir+"RGB.png",anyImg);
- // save any image to png
- png_write_view(out_dir+"RGBNative.png",view(anyImg));
-}
-#endif
-
-int main(int argc, char* argv[]) {
- test_image_io();
- return 0;
-}
-
Deleted: trunk/libs/gil/test/main.cpp
==============================================================================
--- trunk/libs/gil/test/main.cpp 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
+++ (empty file)
@@ -1,70 +0,0 @@
-/*
- Copyright 2005-2007 Adobe Systems Incorporated
-
- Use, modification and distribution are subject to the Boost Software License,
- Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-
- See http://stlab.adobe.com/gil for most recent version including documentation.
-*/
-// main.cpp : Runs all GIL tests.
-//
-
-#include <fstream>
-#include <iostream>
-
-#define main main1
-#include "channel.cpp"
-#undef main
-
-#define main main2
-#define value_core pixel_value_core
-#define reference_core pixel_reference_core
-#include "pixel.cpp"
-#undef value_core
-#undef reference_core
-#undef main
-
-#define main main3
-#include "pixel_iterator.cpp"
-#undef main
-
-#define main main4
-#include "image.cpp"
-#undef main
-
-#define main main5
-#include "image_io.cpp"
-#undef main
-
-void test_channel();
-void test_pixel();
-void test_pixel_iterator();
-void test_image(const char*);
-void test_image_io();
-void test_gimage();
-
-int main(int argc, char* argv[]) {
- test_pixel();
- test_channel();
- test_pixel_iterator();
- test_image_io();
-
- const char* local_name = "gil_reference_checksums.txt";
- const char* name_from_status = "../libs/gil/test/gil_reference_checksums.txt";
-
- std::ifstream file_is_there(local_name);
- if (file_is_there) {
- test_image(local_name);
- } else {
- std::ifstream file_is_there(name_from_status);
- if (file_is_there)
- test_image(name_from_status);
- else {
- std::cerr << "Unable to open gil_reference_checksums.txt"<<std::endl;
- return 1;
- }
- }
-
- return 0;
-}
Modified: trunk/libs/gil/test/performance.cpp
==============================================================================
--- trunk/libs/gil/test/performance.cpp (original)
+++ trunk/libs/gil/test/performance.cpp 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
@@ -45,6 +45,9 @@
#include <boost/gil/typedefs.hpp>
#include <boost/gil/algorithm.hpp>
+#include <boost/test/unit_test.hpp>
+
+
using namespace boost::gil;
// returns time in milliseconds per call
@@ -436,7 +439,10 @@
std::cout << "Non-GIL: "<<measure_time(transform_nongil_t<View1,View2,F>(view(im1),view(im2),F()),trials) << std::endl;
}
-int main() {
+BOOST_AUTO_TEST_SUITE(GIL_Tests)
+
+BOOST_AUTO_TEST_CASE(performance_test)
+{
#ifdef NDEBUG
std::size_t num_trials=1000;
#else
@@ -506,6 +512,6 @@
std::cout<<"test transform_pixels() between rgb8_planar_image_t and rgb8_image_t"<<std::endl;
test_transform<rgb8_planar_view_t,rgb8_view_t,bgr_to_rgb_t<bits8,planar_pixel_reference<bits8,rgb_t> > >(num_trials);
std::cout<<std::endl;
-
- return 0;
}
+
+BOOST_AUTO_TEST_SUITE_END()
Modified: trunk/libs/gil/test/pixel.cpp
==============================================================================
--- trunk/libs/gil/test/pixel.cpp (original)
+++ trunk/libs/gil/test/pixel.cpp 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
@@ -31,6 +31,8 @@
#include <boost/gil/metafunctions.hpp>
#include <boost/gil/bit_aligned_pixel_reference.hpp>
+#include <boost/test/unit_test.hpp>
+
// Testing pixel references and values, pixel operations, color conversion
using namespace boost::gil;
@@ -234,7 +236,7 @@
struct ccv1 {
template <typename Pixel>
void operator()(Pixel) {
- for_each<representative_pixels_t>(ccv2<Pixel>());
+ mpl::for_each<representative_pixels_t>(ccv2<Pixel>());
}
};
@@ -326,8 +328,12 @@
error_if(g16 != 8);
}
-int main(int argc, char* argv[]) {
+
+BOOST_AUTO_TEST_SUITE(GIL_Tests)
+
+BOOST_AUTO_TEST_CASE(pixel_test)
+{
test_pixel();
- return 0;
}
+BOOST_AUTO_TEST_SUITE_END()
Modified: trunk/libs/gil/test/pixel_iterator.cpp
==============================================================================
--- trunk/libs/gil/test/pixel_iterator.cpp (original)
+++ trunk/libs/gil/test/pixel_iterator.cpp 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
@@ -27,6 +27,8 @@
#include <boost/gil/image_view_factory.hpp>
#include <boost/mpl/vector.hpp>
+#include <boost/test/unit_test.hpp>
+
using namespace boost::gil;
using namespace std;
@@ -330,7 +332,11 @@
}
*/
-int main(int argc, char* argv[]) {
+BOOST_AUTO_TEST_SUITE(GIL_Tests)
+
+BOOST_AUTO_TEST_CASE(pixel_iterator_test)
+{
test_pixel_iterator();
- return 0;
-}
\ No newline at end of file
+}
+
+BOOST_AUTO_TEST_SUITE_END()
Added: trunk/libs/gil/test/test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/gil/test/test.cpp 2013-03-25 20:48:39 EDT (Mon, 25 Mar 2013)
@@ -0,0 +1,2 @@
+#define BOOST_TEST_MAIN
+#include <boost/test/unit_test.hpp>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk