From 9c653b5afafca699d84169f234a64c30bee12816 Mon Sep 17 00:00:00 2001 From: Craig Dowell Date: Wed, 18 Feb 2009 22:32:09 -0800 Subject: [PATCH] quiet second.cc and third.cc when running as regression tests --- examples/second.cc | 11 +++++++++-- examples/third.cc | 12 ++++++++++-- regression/tests/test-second.py | 4 +++- regression/tests/test-third.py | 4 +++- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/examples/second.cc b/examples/second.cc index 7bfbea698..2bc3ceb67 100644 --- a/examples/second.cc +++ b/examples/second.cc @@ -36,16 +36,23 @@ NS_LOG_COMPONENT_DEFINE ("SecondScriptExample"); int main (int argc, char *argv[]) { - LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); - LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); + bool verbose = true; RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); uint32_t nCsma = 3; CommandLine cmd; cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma); + cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose); + cmd.Parse (argc,argv); + if (verbose) + { + LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); + LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); + } + NodeContainer p2pNodes; p2pNodes.Create (2); diff --git a/examples/third.cc b/examples/third.cc index dbf652f29..7f7a98249 100644 --- a/examples/third.cc +++ b/examples/third.cc @@ -40,8 +40,8 @@ NS_LOG_COMPONENT_DEFINE ("ThirdScriptExample"); int main (int argc, char *argv[]) { - LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); - LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); + + bool verbose = true; RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); @@ -50,8 +50,16 @@ main (int argc, char *argv[]) CommandLine cmd; cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma); cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi); + cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose); + cmd.Parse (argc,argv); + if (verbose) + { + LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); + LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); + } + NodeContainer p2pNodes; p2pNodes.Create (2); diff --git a/regression/tests/test-second.py b/regression/tests/test-second.py index 4c77bc125..9009f007c 100644 --- a/regression/tests/test-second.py +++ b/regression/tests/test-second.py @@ -1,4 +1,6 @@ #! /usr/bin/env python -"""Generic trace-comparison-type regression test.""" +"""Compare that Second generates correct traces.""" + +arguments = ["--verbose=0"] diff --git a/regression/tests/test-third.py b/regression/tests/test-third.py index 4c77bc125..73a96ee74 100644 --- a/regression/tests/test-third.py +++ b/regression/tests/test-third.py @@ -1,4 +1,6 @@ #! /usr/bin/env python -"""Generic trace-comparison-type regression test.""" +"""Compare that Third generates correct traces.""" + +arguments = ["--verbose=0"]