mirror of
https://github.com/boostorg/config.git
synced 2025-11-03 09:11:37 +01:00
401 lines
10 KiB
Bash
401 lines
10 KiB
Bash
#!/bin/sh
|
|
# (C) Copyright John Maddock 2001 - 2003.
|
|
# 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://www.boost.org/libs/config for the most recent version.
|
|
|
|
#get date:
|
|
date_string=`date`
|
|
|
|
# init config file:
|
|
cat > ../test/regression.cfg << EOF
|
|
//
|
|
// regression test script for boost configuration setup
|
|
//
|
|
run libs/config/test/config_info.cpp
|
|
run libs/config/test/config_test.cpp
|
|
run libs/config/test/limits_test.cpp
|
|
compile-fail threads/test_thread_fail1.cpp ;
|
|
compile-fail threads/test_thread_fail2.cpp ;
|
|
|
|
EOF
|
|
cat > ../test/Jamfile << EOF
|
|
#
|
|
# Regression test Jamfile for boost configuration setup.
|
|
# *** DO NOT EDIT THIS FILE BY HAND ***
|
|
# This file was automatically generated on $date_string,
|
|
# by libs/config/tools/generate
|
|
# Copyright John Maddock.
|
|
#
|
|
# If you need to alter build preferences then set them in
|
|
# the template defined in options.jam.
|
|
#
|
|
subproject libs/config/test ;
|
|
# bring in the rules for testing
|
|
import testing ./options ;
|
|
|
|
run config_info.cpp <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 ;
|
|
|
|
EOF
|
|
|
|
# init main config test file:
|
|
cat > ../test/config_test.cpp << EOF
|
|
// This file was automatically generated on $date_string,
|
|
// by libs/config/tools/generate
|
|
// Copyright John Maddock 2002-4.
|
|
// 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://www.boost.org/libs/config for the most recent version.
|
|
|
|
// Test file for config setup
|
|
// This file should compile, if it does not then
|
|
// one or more macros need to be defined.
|
|
// see boost_*.ipp for more details
|
|
|
|
// Do not edit this file, it was generated automatically by
|
|
// ../tools/generate from boost_*.ipp on
|
|
// $date_string
|
|
|
|
#include <boost/config.hpp>
|
|
#include <iostream>
|
|
#include "test.hpp"
|
|
|
|
int error_count = 0;
|
|
|
|
EOF
|
|
|
|
all_no=""
|
|
all_has=""
|
|
|
|
#
|
|
# enumerate through the boost_no* test files:
|
|
#
|
|
for file in ../test/boost_no_*.ipp; do
|
|
|
|
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 "Processing $file..."
|
|
echo
|
|
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"
|
|
else
|
|
echo "generating file ../test/$basename""_pass.cpp"
|
|
cat > "../test/$basename""_pass.cpp" << EOF
|
|
|
|
// This file was automatically generated on $date_string,
|
|
// by libs/config/tools/generate
|
|
// Copyright John Maddock 2002-4.
|
|
// 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://www.boost.org/libs/config for the most recent version.
|
|
|
|
// Test file for macro $macroname
|
|
// This file should compile, if it does not then
|
|
// $macroname needs to be defined.
|
|
// see boost_$basename.ipp for more details
|
|
|
|
// Do not edit this file, it was generated automatically by
|
|
// ../tools/generate from boost_$basename.ipp on
|
|
// $date_string
|
|
|
|
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
|
// the objective of this file:
|
|
#ifdef BOOST_ASSERT_CONFIG
|
|
# undef BOOST_ASSERT_CONFIG
|
|
#endif
|
|
|
|
#include <boost/config.hpp>
|
|
#include "test.hpp"
|
|
|
|
#ifndef $macroname
|
|
#include "boost_$basename.ipp"
|
|
#else
|
|
namespace ${namespace} = empty_boost;
|
|
#endif
|
|
|
|
int main( int, char *[] )
|
|
{
|
|
return ${namespace}::test();
|
|
}
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
# now create negative test file:
|
|
if test -f "../test/$basename""_fail.cpp"; then
|
|
echo "skipping file ../test/$basename""_fail.cpp"
|
|
else
|
|
echo "generating file ../test/$basename""_fail.cpp"
|
|
cat > "../test/$basename""_fail.cpp" << EOF
|
|
|
|
// This file was automatically generated on $date_string,
|
|
// by libs/config/tools/generate
|
|
// Copyright John Maddock 2002-4.
|
|
// 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://www.boost.org/libs/config for the most recent version.
|
|
|
|
// Test file for macro $macroname
|
|
// This file should not compile, if it does then
|
|
// $macroname need not be defined.
|
|
// see boost_$basename.ipp for more details
|
|
|
|
// Do not edit this file, it was generated automatically by
|
|
// ../tools/generate from boost_$basename.ipp on
|
|
// $date_string
|
|
|
|
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
|
// the objective of this file:
|
|
#ifdef BOOST_ASSERT_CONFIG
|
|
# undef BOOST_ASSERT_CONFIG
|
|
#endif
|
|
|
|
#include <boost/config.hpp>
|
|
#include "test.hpp"
|
|
|
|
#ifdef $macroname
|
|
#include "boost_$basename.ipp"
|
|
#else
|
|
#error "this file should not compile"
|
|
#endif
|
|
|
|
int main( int, char *[] )
|
|
{
|
|
return ${namespace}::test();
|
|
}
|
|
|
|
EOF
|
|
fi
|
|
|
|
# now append to config_test.cpp:
|
|
cat >> "../test/config_test.cpp" << EOF
|
|
#ifndef $macroname
|
|
#include "boost_$basename.ipp"
|
|
#else
|
|
namespace ${namespace} = empty_boost;
|
|
#endif
|
|
EOF
|
|
all_no="$namespace $all_no"
|
|
|
|
# output regression tests:
|
|
echo "run libs/config/test/$basename""_pass.cpp" >> ../test/regression.cfg
|
|
echo "compile-fail libs/config/test/$basename""_fail.cpp" >> ../test/regression.cfg
|
|
|
|
echo 'test-suite "'$macroname'" : ' >> ../test/Jamfile
|
|
echo "[ run $basename""_pass.cpp <template>config_options ]" >> ../test/Jamfile
|
|
echo "[ compile-fail $basename""_fail.cpp <template>config_options ] ;" >> ../test/Jamfile
|
|
|
|
done
|
|
|
|
#
|
|
# enumerate through the boost_has* test files:
|
|
#
|
|
for file in ../test/boost_has_*.ipp; do
|
|
|
|
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
|
|
echo "processing $macroname ..."
|
|
# echo $title
|
|
# echo $namespace
|
|
|
|
# now create positive test file:
|
|
if test -f "../test/$basename""_pass.cpp"; then
|
|
echo "skipping file ../test/$basename""_pass.cpp"
|
|
else
|
|
echo "generating file ../test/$basename""_pass.cpp"
|
|
cat > "../test/$basename""_pass.cpp" << EOF
|
|
|
|
// This file was automatically generated on $date_string,
|
|
// by libs/config/tools/generate
|
|
// Copyright John Maddock 2002-4.
|
|
// 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://www.boost.org/libs/config for the most recent version.
|
|
|
|
// Test file for macro $macroname
|
|
// This file should compile, if it does not then
|
|
// $macroname should not be defined.
|
|
// see boost_$basename.ipp for more details
|
|
|
|
// Do not edit this file, it was generated automatically by
|
|
// ../tools/generate from boost_$basename.ipp on
|
|
// $date_string
|
|
|
|
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
|
// the objective of this file:
|
|
#ifdef BOOST_ASSERT_CONFIG
|
|
# undef BOOST_ASSERT_CONFIG
|
|
#endif
|
|
|
|
#include <boost/config.hpp>
|
|
#include "test.hpp"
|
|
|
|
#ifdef $macroname
|
|
#include "boost_$basename.ipp"
|
|
#else
|
|
namespace ${namespace} = empty_boost;
|
|
#endif
|
|
|
|
int main( int, char *[] )
|
|
{
|
|
return ${namespace}::test();
|
|
}
|
|
|
|
EOF
|
|
fi
|
|
|
|
# now create negative test file:
|
|
if test -f "../test/$basename""_fail.cpp"; then
|
|
echo skipping file "../test/$basename""_fail.cpp"
|
|
else
|
|
echo generating file "../test/$basename""_fail.cpp"
|
|
cat > "../test/$basename""_fail.cpp" << EOF
|
|
|
|
// This file was automatically generated on $date_string,
|
|
// by libs/config/tools/generate
|
|
// Copyright John Maddock 2002-4.
|
|
// 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://www.boost.org/libs/config for the most recent version.
|
|
|
|
// Test file for macro $macroname
|
|
// This file should not compile, if it does then
|
|
// $macroname may be defined.
|
|
// see boost_$basename.ipp for more details
|
|
|
|
// Do not edit this file, it was generated automatically by
|
|
// ../tools/generate from boost_$basename.ipp on
|
|
// $date_string
|
|
|
|
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
|
// the objective of this file:
|
|
#ifdef BOOST_ASSERT_CONFIG
|
|
# undef BOOST_ASSERT_CONFIG
|
|
#endif
|
|
|
|
#include <boost/config.hpp>
|
|
#include "test.hpp"
|
|
|
|
#ifndef $macroname
|
|
#include "boost_$basename.ipp"
|
|
#else
|
|
#error "this file should not compile"
|
|
#endif
|
|
|
|
int main( int, char *[] )
|
|
{
|
|
return ${namespace}::test();
|
|
}
|
|
|
|
EOF
|
|
fi
|
|
|
|
# now append to config_test.cpp:
|
|
cat >> "../test/config_test.cpp" << EOF
|
|
#ifdef $macroname
|
|
#include "boost_$basename.ipp"
|
|
#else
|
|
namespace ${namespace} = empty_boost;
|
|
#endif
|
|
EOF
|
|
all_has="$namespace $all_has"
|
|
|
|
# output regression tests:
|
|
echo "run libs/config/test/$basename""_pass.cpp" >> ../test/regression.cfg
|
|
echo "compile-fail libs/config/test/$basename""_fail.cpp" >> ../test/regression.cfg
|
|
|
|
echo 'test-suite "'$macroname'" : ' >> ../test/Jamfile
|
|
echo "[ run $basename""_pass.cpp <template>config_options ]" >> ../test/Jamfile
|
|
echo "[ compile-fail $basename""_fail.cpp <template>config_options ] ;" >> ../test/Jamfile
|
|
|
|
done
|
|
|
|
|
|
#
|
|
# finish off config_test.cpp:
|
|
#
|
|
echo generating "../test/config_test.cpp"
|
|
cat >> "../test/config_test.cpp" << EOF
|
|
|
|
int main( int, char *[] )
|
|
{
|
|
EOF
|
|
|
|
for macro in $all_no; do
|
|
cat >> "../test/config_test.cpp" << EOF
|
|
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
|
|
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 error_count;
|
|
}
|
|
EOF
|
|
|
|
#rm -f ../config.*
|
|
echo "updating configure script..."
|
|
autoconf ../tools/configure.in > ../configure
|
|
echo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|