utils/run-examples-with-full-logging.sh
author Sébastien Deronne <sebastien.deronne@gmail.com>
Fri, 04 Sep 2015 22:17:57 +0200
changeset 11636 d56935c679c6
parent 9220 fd38b9505eb9
permissions -rwxr-xr-x
Update RELEASE_NOTES
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9220
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
     1
#!/bin/bash
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
     2
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
     3
#
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
     4
# Copyright (c) 2012 University of Washington
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
     5
#
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
     6
# This program is free software; you can redistribute it and/or modify
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
     7
# it under the terms of the GNU General Public License version 2 as
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
     8
# published by the Free Software Foundation;
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
     9
#
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    10
# This program is distributed in the hope that it will be useful,
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    13
# GNU General Public License for more details.
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    14
#
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    16
# along with this program; if not, write to the Free Software
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    18
#
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    19
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    20
#
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    21
# This script calls test.py to get a list of all tests and examples.
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    22
# It then runs all of the C++ examples with full logging turned on,
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    23
# i.e. NS_LOG="*", to see if that causes any problems with the
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    24
# example.
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    25
#
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    26
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    27
cd ..
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    28
`./test.py -l >& /tmp/test.out`
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    29
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    30
while read line
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    31
do
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    32
  # search for examples, strip down $line as necessary
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    33
  if [[ "$line" == example* ]]
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    34
    then
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    35
      name=${line#example      }
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    36
      NS_LOG="*" ./waf --run "$name" >& /dev/null
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    37
      status="$?"
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    38
      echo "program $name status $status"
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    39
  fi
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    40
done < "/tmp/test.out"
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    41
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    42
rm -rf /tmp/test.out
fd38b9505eb9 Add shell script that runs all examples with full logging turned on
Mitch Watrous <watrous@u.washington.edu>
parents:
diff changeset
    43
cd utils