From f986dff4885480075bac26fb00747bbef47c43a3 Mon Sep 17 00:00:00 2001 From: Mitch Watrous Date: Mon, 14 Jan 2013 09:39:06 -0800 Subject: [PATCH] Add shell script that runs all examples with full logging turned on --- test.py | 10 ++++++ utils/run-examples-with-full-logging.sh | 43 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 utils/run-examples-with-full-logging.sh diff --git a/test.py b/test.py index 63f8a8994..8a7fc3b59 100755 --- a/test.py +++ b/test.py @@ -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: diff --git a/utils/run-examples-with-full-logging.sh b/utils/run-examples-with-full-logging.sh new file mode 100755 index 000000000..9260a8b6b --- /dev/null +++ b/utils/run-examples-with-full-logging.sh @@ -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