Add shell script that runs all examples with full logging turned on

This commit is contained in:
Mitch Watrous
2013-01-14 09:39:06 -08:00
parent df0417a5df
commit f986dff488
2 changed files with 53 additions and 0 deletions

10
test.py
View File

@@ -128,6 +128,7 @@ def parse_examples_to_run_file(
cpp_executable_dir,
python_script_dir,
example_tests,
example_names_original,
python_tests):
# Look for the examples-to-run file exists.
@@ -150,7 +151,9 @@ def parse_examples_to_run_file(
#
cpp_examples = get_list_from_file(examples_to_run_path, "cpp_examples")
for example_name, do_run, do_valgrind_run in cpp_examples:
# Seperate the example name from its arguments.
example_name_original = example_name
example_name_parts = example_name.split(' ', 1)
if len(example_name_parts) == 1:
example_name = example_name_parts[0]
@@ -174,6 +177,7 @@ def parse_examples_to_run_file(
# Add this example.
example_tests.append((example_path, do_run, do_valgrind_run))
example_names_original.append(example_name_original)
# Each tuple in the Python list of examples to run contains
#
@@ -1080,6 +1084,7 @@ def run_tests():
# ensure that they remain buildable and runnable over time.
#
example_tests = []
example_names_original = []
python_tests = []
for directory in EXAMPLE_DIRECTORIES:
# Set the directories and paths for this example.
@@ -1094,6 +1099,7 @@ def run_tests():
cpp_executable_dir,
python_script_dir,
example_tests,
example_names_original,
python_tests)
for module in NS3_ENABLED_MODULES:
@@ -1113,6 +1119,7 @@ def run_tests():
cpp_executable_dir,
python_script_dir,
example_tests,
example_names_original,
python_tests)
#
@@ -1146,6 +1153,9 @@ def run_tests():
for item in list_items:
if len(item.strip()):
print item
example_names_original.sort()
for item in example_names_original:
print "example ", item
print
if options.kinds or options.list:

View File

@@ -0,0 +1,43 @@
#!/bin/bash
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2012 University of Washington
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# This script calls test.py to get a list of all tests and examples.
# It then runs all of the C++ examples with full logging turned on,
# i.e. NS_LOG="*", to see if that causes any problems with the
# example.
#
cd ..
`./test.py -l >& /tmp/test.out`
while read line
do
# search for examples, strip down $line as necessary
if [[ "$line" == example* ]]
then
name=${line#example }
NS_LOG="*" ./waf --run "$name" >& /dev/null
status="$?"
echo "program $name status $status"
fi
done < "/tmp/test.out"
rm -rf /tmp/test.out
cd utils