mirror of
https://github.com/boostorg/config.git
synced 2026-05-04 20:04:11 +02:00
Updated config test system to use new .ipp file extensions.
All dependencies on Boost.Test have also been removed for the basic tests. [SVN r23102]
This commit is contained in:
+10
-9
@@ -144,9 +144,9 @@ AC_CHECK_LIB(rt, clock)
|
||||
#
|
||||
# enumerate test files and test each one:
|
||||
#
|
||||
for file in $boost_base/libs/config/test/boost_no*.cxx; do
|
||||
for file in $boost_base/libs/config/test/boost_no*.ipp; do
|
||||
|
||||
basename=`echo $file | sed 's/.*boost_\(.*\)\.cxx/\1/'`
|
||||
basename=`echo $file | sed 's/.*boost_\(.*\)\.ipp/\1/'`
|
||||
macroname=`cat $file | grep '^//[[] []]*MACRO:' | sed 's/.*MACRO:[[] []]*\([[]_A-Z0-9[]]*\).*/\1/'`
|
||||
title=`cat $file | grep '^//[[] []]*TITLE:' | sed 's/.*TITLE:[[] []]*\([[]^ []].*\)/\1/'`
|
||||
namespace=`echo $macroname | tr [[:upper:]] [[:lower:]]`
|
||||
@@ -169,7 +169,7 @@ for file in $boost_base/libs/config/test/boost_no*.cxx; do
|
||||
#include "test.hpp"
|
||||
|
||||
#ifndef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
namespace ${namespace} = empty_boost;
|
||||
#endif
|
||||
@@ -192,7 +192,7 @@ int main(){ return ${namespace}::test(); } ]
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
@@ -212,9 +212,9 @@ done
|
||||
#
|
||||
# enumerate optional test files and test each one:
|
||||
#
|
||||
for file in $boost_base/libs/config/test/boost_has*.cxx; do
|
||||
for file in $boost_base/libs/config/test/boost_has*.ipp; do
|
||||
|
||||
basename=`echo $file | sed 's/.*boost_\(.*\)\.cxx/\1/'`
|
||||
basename=`echo $file | sed 's/.*boost_\(.*\)\.ipp/\1/'`
|
||||
macroname=`cat $file | grep '^//[[] []]*MACRO:' | sed 's/.*MACRO:[[] []]*\([[]_A-Z0-9[]]*\).*/\1/'`
|
||||
title=`cat $file | grep '^//[[] []]*TITLE:' | sed 's/.*TITLE:[[] []]*\([[]^ []].*\)/\1/'`
|
||||
namespace=`echo $macroname | tr [[:upper:]] [[:lower:]]`
|
||||
@@ -233,7 +233,7 @@ for file in $boost_base/libs/config/test/boost_has*.cxx; do
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
namespace ${namespace} = empty_boost;
|
||||
#endif
|
||||
@@ -253,7 +253,7 @@ int main(){ return ${namespace}::test(); }]
|
||||
#include "test.hpp"
|
||||
|
||||
#ifndef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
@@ -279,7 +279,7 @@ int main(){ return ${namespace}::test(); }]
|
||||
#include <boost/config.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
|
||||
int main(){ return ${namespace}::test(); }]
|
||||
,
|
||||
@@ -437,5 +437,6 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+45
-35
@@ -36,7 +36,7 @@ subproject libs/config/test ;
|
||||
import testing ./options ;
|
||||
|
||||
run config_info.cpp <template>config_options ;
|
||||
run config_test.cpp <lib>../../test/build/boost_test_exec_monitor <template>config_options ;
|
||||
run config_test.cpp <template>config_options ;
|
||||
run limits_test.cpp <template>config_test_options ;
|
||||
run abi/abi_test.cpp abi/main.cpp <template>config_options ;
|
||||
|
||||
@@ -53,17 +53,18 @@ cat > ../test/config_test.cpp << EOF
|
||||
// Test file for config setup
|
||||
// This file should compile, if it does not then
|
||||
// one or more macros need to be defined.
|
||||
// see boost_*.cxx for more details
|
||||
// see boost_*.ipp for more details
|
||||
|
||||
// Do not edit this file, it was generated automatically by
|
||||
// ../tools/generate from boost_*.cxx on
|
||||
// ../tools/generate from boost_*.ipp on
|
||||
// $date_string
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include <boost/test/test_tools.hpp>
|
||||
#include <iostream>
|
||||
#include "test.hpp"
|
||||
|
||||
int error_count = 0;
|
||||
|
||||
EOF
|
||||
|
||||
all_no=""
|
||||
@@ -72,18 +73,19 @@ all_has=""
|
||||
#
|
||||
# enumerate through the boost_no* test files:
|
||||
#
|
||||
for file in ../test/boost_no_*.cxx; do
|
||||
for file in ../test/boost_no_*.ipp; do
|
||||
|
||||
basename=`echo $file | sed 's/.*boost_\(.*\)\.cxx/\1/'`
|
||||
basename=`echo $file | sed 's/.*boost_\(.*\)\.ipp/\1/'`
|
||||
macroname=`cat $file | grep '^//[ ]*MACRO:' | sed 's/.*MACRO:[ ]*\([_A-Z0-9]*\).*/\1/'`
|
||||
title=`cat $file | grep '^//[ ]*TITLE:' | sed 's/.*TITLE:[ ]*\([^ ].*\)/\1/'`
|
||||
namespace=`echo $macroname | tr [:upper:] [:lower:]`
|
||||
|
||||
# echo $basename
|
||||
echo "Processing $file..."
|
||||
echo
|
||||
echo "processing $macroname ..."
|
||||
# echo $title
|
||||
# echo $namespace
|
||||
echo "Basename: $basename"
|
||||
echo "Macro: $macroname"
|
||||
echo "Title: $title"
|
||||
echo "Namespace: $namespace"
|
||||
# now create positive test file:
|
||||
if test -f "../test/$basename""_pass.cpp"; then
|
||||
echo "skipping file ../test/$basename""_pass.cpp"
|
||||
@@ -100,10 +102,10 @@ for file in ../test/boost_no_*.cxx; do
|
||||
// Test file for macro $macroname
|
||||
// This file should compile, if it does not then
|
||||
// $macroname needs to be defined.
|
||||
// see boost_$basename.cxx for more details
|
||||
// see boost_$basename.ipp for more details
|
||||
|
||||
// Do not edit this file, it was generated automatically by
|
||||
// ../tools/generate from boost_$basename.cxx on
|
||||
// ../tools/generate from boost_$basename.ipp on
|
||||
// $date_string
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
@@ -116,12 +118,12 @@ for file in ../test/boost_no_*.cxx; do
|
||||
#include "test.hpp"
|
||||
|
||||
#ifndef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
namespace ${namespace} = empty_boost;
|
||||
#endif
|
||||
|
||||
int cpp_main( int, char *[] )
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return ${namespace}::test();
|
||||
}
|
||||
@@ -146,10 +148,10 @@ EOF
|
||||
// Test file for macro $macroname
|
||||
// This file should not compile, if it does then
|
||||
// $macroname need not be defined.
|
||||
// see boost_$basename.cxx for more details
|
||||
// see boost_$basename.ipp for more details
|
||||
|
||||
// Do not edit this file, it was generated automatically by
|
||||
// ../tools/generate from boost_$basename.cxx on
|
||||
// ../tools/generate from boost_$basename.ipp on
|
||||
// $date_string
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
@@ -162,12 +164,12 @@ EOF
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
|
||||
int cpp_main( int, char *[] )
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return ${namespace}::test();
|
||||
}
|
||||
@@ -178,7 +180,7 @@ EOF
|
||||
# now append to config_test.cpp:
|
||||
cat >> "../test/config_test.cpp" << EOF
|
||||
#ifndef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
namespace ${namespace} = empty_boost;
|
||||
#endif
|
||||
@@ -198,9 +200,9 @@ done
|
||||
#
|
||||
# enumerate through the boost_has* test files:
|
||||
#
|
||||
for file in ../test/boost_has_*.cxx; do
|
||||
for file in ../test/boost_has_*.ipp; do
|
||||
|
||||
basename=`echo $file | sed 's/.*boost_\(.*\)\.cxx/\1/'`
|
||||
basename=`echo $file | sed 's/.*boost_\(.*\)\.ipp/\1/'`
|
||||
macroname=`cat $file | grep '^//[ ]*MACRO:' | sed 's/.*MACRO:[ ]*\([_A-Z0-9]*\).*/\1/'`
|
||||
title=`cat $file | grep '^//[ ]*TITLE:' | sed 's/.*TITLE:[ ]*\([^ ].*\)/\1/'`
|
||||
namespace=`echo $macroname | tr [:upper:] [:lower:]`
|
||||
@@ -227,10 +229,10 @@ for file in ../test/boost_has_*.cxx; do
|
||||
// Test file for macro $macroname
|
||||
// This file should compile, if it does not then
|
||||
// $macroname should not be defined.
|
||||
// see boost_$basename.cxx for more details
|
||||
// see boost_$basename.ipp for more details
|
||||
|
||||
// Do not edit this file, it was generated automatically by
|
||||
// ../tools/generate from boost_$basename.cxx on
|
||||
// ../tools/generate from boost_$basename.ipp on
|
||||
// $date_string
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
@@ -243,12 +245,12 @@ for file in ../test/boost_has_*.cxx; do
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
namespace ${namespace} = empty_boost;
|
||||
#endif
|
||||
|
||||
int cpp_main( int, char *[] )
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return ${namespace}::test();
|
||||
}
|
||||
@@ -272,10 +274,10 @@ EOF
|
||||
// Test file for macro $macroname
|
||||
// This file should not compile, if it does then
|
||||
// $macroname may be defined.
|
||||
// see boost_$basename.cxx for more details
|
||||
// see boost_$basename.ipp for more details
|
||||
|
||||
// Do not edit this file, it was generated automatically by
|
||||
// ../tools/generate from boost_$basename.cxx on
|
||||
// ../tools/generate from boost_$basename.ipp on
|
||||
// $date_string
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
@@ -288,12 +290,12 @@ EOF
|
||||
#include "test.hpp"
|
||||
|
||||
#ifndef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
|
||||
int cpp_main( int, char *[] )
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return ${namespace}::test();
|
||||
}
|
||||
@@ -304,7 +306,7 @@ EOF
|
||||
# now append to config_test.cpp:
|
||||
cat >> "../test/config_test.cpp" << EOF
|
||||
#ifdef $macroname
|
||||
#include "boost_$basename.cxx"
|
||||
#include "boost_$basename.ipp"
|
||||
#else
|
||||
namespace ${namespace} = empty_boost;
|
||||
#endif
|
||||
@@ -328,24 +330,32 @@ done
|
||||
echo generating "../test/config_test.cpp"
|
||||
cat >> "../test/config_test.cpp" << EOF
|
||||
|
||||
int test_main( int, char *[] )
|
||||
int main( int, char *[] )
|
||||
{
|
||||
EOF
|
||||
|
||||
for macro in $all_no; do
|
||||
cat >> "../test/config_test.cpp" << EOF
|
||||
BOOST_TEST(0 == ${macro}::test());
|
||||
if(0 != ${macro}::test())
|
||||
{
|
||||
std::cerr << "Failed test for $macroname at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
EOF
|
||||
|
||||
done
|
||||
for macro in $all_has; do
|
||||
cat >> "../test/config_test.cpp" << EOF
|
||||
BOOST_TEST(0 == ${macro}::test());
|
||||
if(0 != ${macro}::test())
|
||||
{
|
||||
std::cerr << "Failed test for $macroname at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
EOF
|
||||
|
||||
done
|
||||
cat >> "../test/config_test.cpp" << EOF
|
||||
return 0;
|
||||
return error_count;
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user