## processor unit tests
##

Import('env')
Import('env_cpp11')
Import('boostlibs')
Import('platform_libs')
Import('polyfill_libs')

env = env.Clone ()
env_cpp11 = env_cpp11.Clone ()

BOOST_LIBS = boostlibs(['unit_test_framework','system'],env) + [platform_libs] + ['z']

objs = env.Object('test_processor_boost.o', ["processor.cpp"], LIBS = BOOST_LIBS)
objs += env.Object('test_hybi13_boost.o', ["hybi13.cpp"], LIBS = BOOST_LIBS)
objs += env.Object('test_hybi08_boost.o', ["hybi08.cpp"], LIBS = BOOST_LIBS)
objs += env.Object('test_hybi07_boost.o', ["hybi07.cpp"], LIBS = BOOST_LIBS)
objs += env.Object('test_hybi00_boost.o', ["hybi00.cpp"], LIBS = BOOST_LIBS)
objs += env.Object('test_extension_permessage_compress_boost.o', ["extension_permessage_compress.cpp"], LIBS = BOOST_LIBS)

prgs = env.Program('test_processor_boost', ["test_processor_boost.o"], LIBS = BOOST_LIBS)
prgs += env.Program('test_hybi13_boost', ["test_hybi13_boost.o"], LIBS = BOOST_LIBS)
prgs += env.Program('test_hybi08_boost', ["test_hybi08_boost.o"], LIBS = BOOST_LIBS)
prgs += env.Program('test_hybi07_boost', ["test_hybi07_boost.o"], LIBS = BOOST_LIBS)
prgs += env.Program('test_hybi00_boost', ["test_hybi00_boost.o"], LIBS = BOOST_LIBS)
prgs += env.Program('test_extension_permessage_compress_boost', ["test_extension_permessage_compress_boost.o"], LIBS = BOOST_LIBS + ['z'])

if env_cpp11.has_key('WSPP_CPP11_ENABLED'):
   BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework'],env_cpp11) + [platform_libs] + [polyfill_libs] + ['z']
   # no C++11 features are used in processor so there are no C++11 versions of
   # these tests.
   objs += env_cpp11.Object('test_processor_stl.o', ["processor.cpp"], LIBS = BOOST_LIBS_CPP11)
   objs += env_cpp11.Object('test_hybi13_stl.o', ["hybi13.cpp"], LIBS = BOOST_LIBS_CPP11)
   objs += env_cpp11.Object('test_hybi08_stl.o', ["hybi08.cpp"], LIBS = BOOST_LIBS_CPP11)
   objs += env_cpp11.Object('test_hybi07_stl.o', ["hybi07.cpp"], LIBS = BOOST_LIBS_CPP11)
   objs += env_cpp11.Object('test_hybi00_stl.o', ["hybi00.cpp"], LIBS = BOOST_LIBS_CPP11)
   objs += env_cpp11.Object('test_extension_permessage_compress_stl.o', ["extension_permessage_compress.cpp"], LIBS = BOOST_LIBS_CPP11 + ['z'])

   prgs += env_cpp11.Program('test_processor_stl', ["test_processor_stl.o"], LIBS = BOOST_LIBS_CPP11)
   prgs += env_cpp11.Program('test_hybi13_stl', ["test_hybi13_stl.o"], LIBS = BOOST_LIBS_CPP11)
   prgs += env_cpp11.Program('test_hybi08_stl', ["test_hybi08_stl.o"], LIBS = BOOST_LIBS_CPP11)
   prgs += env_cpp11.Program('test_hybi07_stl', ["test_hybi07_stl.o"], LIBS = BOOST_LIBS_CPP11)
   prgs += env_cpp11.Program('test_hybi00_stl', ["test_hybi00_stl.o"], LIBS = BOOST_LIBS_CPP11)
   prgs += env_cpp11.Program('test_extension_permessage_compress_stl', ["test_extension_permessage_compress_stl.o"], LIBS = BOOST_LIBS_CPP11 + ['z'])

Return('prgs')
