diff -r ca451dc20c4d src/internet-stack/wscript --- a/src/internet-stack/wscript Wed Sep 22 12:42:07 2010 -0700 +++ b/src/internet-stack/wscript Wed Sep 29 10:12:26 2010 -0700 @@ -59,13 +59,14 @@ arch = None ok = False if arch in ('x86_64', 'i686', 'i586', 'i486', 'i386'): - conf.env['NSC_ENABLED'] = 'yes' + conf.env['NSC_ENABLED'] = True conf.env.append_value('CXXDEFINES', 'NETWORK_SIMULATION_CRADLE') conf.check(mandatory=True, lib='dl', define_name='HAVE_DL', uselib='DL') ok = True conf.check_message('NSC supported architecture', arch, ok) if not ok: + conf.env['NSC_ENABLED'] = False conf.report_optional_feature("nsc", "Network Simulation Cradle", False, "architecture %r not supported" % arch) return @@ -73,6 +74,7 @@ lib_to_check = 'liblinux2.6.26.so' if not os.path.exists(os.path.join(conf.env['WITH_NSC'], lib_to_check)): + conf.env['NSC_ENABLED'] = False conf.report_optional_feature("nsc", "Network Simulation Cradle", False, "NSC library %s is missing: NSC has not been built?" % lib_to_check) return diff -r ca451dc20c4d src/test/ns3tcp/wscript --- a/src/test/ns3tcp/wscript Wed Sep 22 12:42:07 2010 -0700 +++ b/src/test/ns3tcp/wscript Wed Sep 29 10:12:26 2010 -0700 @@ -12,9 +12,9 @@ ] ns3tcp.source = [ 'ns3tcp-socket-writer.cc', + 'ns3tcp-socket-test-suite.cc', 'ns3tcp-loss-test-suite.cc', ] if bld.env['NSC_ENABLED']: ns3tcp.source.append ('ns3tcp-interop-test-suite.cc') ns3tcp.source.append ('ns3tcp-cwnd-test-suite.cc') - ns3tcp.source.append ('ns3tcp-socket-test-suite.cc') diff -r ca451dc20c4d test.py --- a/test.py Wed Sep 22 12:42:07 2010 -0700 +++ b/test.py Wed Sep 29 10:12:26 2010 -0700 @@ -42,13 +42,13 @@ interesting_config_items = [ "NS3_BUILDDIR", "NS3_MODULE_PATH", - "ENABLE_NSC", + "NSC_ENABLED", "ENABLE_REAL_TIME", "ENABLE_EXAMPLES", "ENABLE_PYTHON_BINDINGS", ] -ENABLE_NSC = False +NSC_ENABLED = False ENABLE_REAL_TIME = False ENABLE_EXAMPLES = True @@ -68,6 +68,16 @@ "ns3-tcp-interoperability", ] +# +# There are some special cases for test suites that fail when NSC is +# missing. +# +core_nsc_missing_skip_tests = [ + "ns3-tcp-cwnd", + "nsc-tcp-loss", + "ns3-tcp-interoperability", +] + # # A list of examples to run as smoke tests just to ensure that they remain # buildable and runnable over time. Also a condition under which to run @@ -128,8 +138,8 @@ ("tcp/star", "True", "True"), ("tcp/tcp-large-transfer", "True", "True"), - ("tcp/tcp-nsc-lfn", "ENABLE_NSC == True", "True"), - ("tcp/tcp-nsc-zoo", "ENABLE_NSC == True", "True"), + ("tcp/tcp-nsc-lfn", "NSC_ENABLED == True", "True"), + ("tcp/tcp-nsc-zoo", "NSC_ENABLED == True", "True"), ("tcp/tcp-star-server", "True", "True"), ("topology-read/topology-read --input=../../examples/topology-read/Inet_small_toposample.txt", "True", "True"), @@ -1210,6 +1220,10 @@ if options.valgrind and test in core_valgrind_skip_tests: job.set_is_skip(True) + # Skip tests that will fail if NSC is missing. + if not NSC_ENABLED and test in core_nsc_missing_skip_tests: + job.set_is_skip(True) + if options.verbose: print "Queue %s" % test @@ -1227,10 +1241,10 @@ # on NSC being configured by waf, that example should have a condition # that evaluates to true if NSC is enabled. For example, # - # ("tcp-nsc-zoo", "ENABLE_NSC == True"), + # ("tcp-nsc-zoo", "NSC_ENABLED == True"), # # In this case, the example "tcp-nsc-zoo" will only be run if we find the - # waf configuration variable "ENABLE_NSC" to be True. + # waf configuration variable "NSC_ENABLED" to be True. # # We don't care at all how the trace files come out, so we just write them # to a single temporary directory. @@ -1650,7 +1664,7 @@ global options options = parser.parse_args()[0] signal.signal(signal.SIGINT, sigint_hook) - + return run_tests() if __name__ == '__main__':