source: trunk/bin/check_if_0.sh @ 2794

Last change on this file since 2794 was 2794, checked in by bradbell, 7 years ago
  1. Use CPPAD_NULL, intead of 0, for null pointer.

check_if_0.sh: Ignore subdirectories of new directories.
jenkins.sh: output logs when an error occurs.
acos_op.hpp: avoid use of q (will use it for an order index).
asin_op.hpp: avoid use of q (will use it for an order index).
forward_sweep.hpp: chnage d to p, use const in prototype.
div_op.hpp: minor edit of white space.
atom_usead_2.cpp: use ADFUN to compute variable/parameter information.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#! /bin/bash -e
2# $Id: check_if_0.sh 2794 2013-05-02 08:20:30Z 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 [ ! -e "bin/check_if_0.sh" ]
14then
15        echo "bin/check_if_0.sh: must be executed from its parent directory"
16        exit 1
17fi
18# -----------------------------------------------------------------------------
19# CppAD uses preprocessor '# if 0' comment blocks for temporary changes
20# that will to be removed before testing for check in.
21echo "Checking for '# if 0' comments blocks in source code"
22echo "-------------------------------------------------------" 
23ok="yes"
24for ext in .cpp .hpp
25do
26        dir_list=`find . -name "*$ext" | sed \
27                -e '/junk\.[^.]*$/d' \
28                -e '/\/build\//d' \
29                -e '/\/new\//d' \
30                -e 's|^\./||' \
31                -e 's|/[^/]*$||' | sort -u` 
32        for dir in $dir_list 
33        do
34                list=`ls $dir/*$ext`
35                for file in $list
36                do
37                        if grep '^# *if *0 *$' $file > /dev/null
38                        then
39                                echo "$file has an '# if 0' comment block"
40                                ok="no"
41                        fi
42                done
43        done
44done
45echo "-------------------------------------------------------" 
46if [ "$ok" = "no" ]
47then
48        echo "Error: nothing should be between the two dashed lines above"
49        exit 1
50else
51        echo "Ok: nothing is between the two dashed lines above"
52        exit 0
53fi
Note: See TracBrowser for help on using the repository browser.