source: trunk/bin/check_define.sh @ 2939

Last change on this file since 2939 was 2939, checked in by bradbell, 7 years ago
  1. Make sure all '# defines' have an '# undef' and vise-verser.
  2. Add adolc tests to jenkins.sh.

check_define.sh: New reoutine that check defines have matching undef.
package.sh: run check_define.sh.
search.sh: add missing source directory to search.
configure.hpp.in: fix bug in speed tests (name of preprocessor macro).
pow.hpp: fix comment.
thread_alloc.hpp: fix spelling in comment.
jenkins.sh: Automatically set LD_LIBRARY_PATH.
base_adolc.hpp: fix problem when using ADOL-C-2.4.1
adolc_prefix.omh: add link to get_adolc.sh.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1#! /bin/bash -e
2# $Id: check_define.sh 2939 2013-10-14 11:06:18Z bradbell $
3# -----------------------------------------------------------------------------
4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
5#
6# CppAD is distributed under multiple licenses. This distribution is under
7# the terms of the
8#                     Eclipse Public License Version 1.0.
9#
10# A copy of this license is included in the COPYING file of this distribution.
11# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
12# -----------------------------------------------------------------------------
13if [ $0 != "bin/check_define.sh" ]
14then
15        echo "bin/check_define.sh: must be executed from its parent directory"
16        exit 1
17fi
18# -----------------------------------------------------------------------------
19echo "Difference between '# define' names and '# undef' names"
20echo '-----------------------------------------------------------------------'
21list=`find cppad \( -name '*.hpp' \) -or \( -name '*.hpp.in' \)`
22#
23for cmd in define undef
24do
25        for file in $list
26        do
27                sed -n -e "/^# *$cmd /p" $file | \
28                        sed -e "s/^# *$cmd  *\([A-Za-z0-9_]*\).*/\1/" >> tmp.$$
29        done
30        if [ "$cmd" == 'define' ]
31        then
32                sed -e '/_INCLUDED$/d' -i tmp.$$
33        fi
34        sort -u tmp.$$ > $cmd.$$
35        rm tmp.$$
36done
37if ! diff define.$$ undef.$$
38then
39        echo "check_define.sh: exiting because defines and undefs do not match"
40        rm undef.$$
41        rm define.$$
42        exit 1
43fi
44echo '-----------------------------------------------------------------------'
45rm undef.$$
46rm define.$$
47exit 0
Note: See TracBrowser for help on using the repository browser.