build: remove waf files, tests and references

This commit is contained in:
Gabriel Ferreira
2022-01-31 19:43:21 -03:00
parent 3b90d12335
commit e32c177e45
137 changed files with 51 additions and 11666 deletions

View File

@@ -49,14 +49,14 @@ function doo ()
say $(date)
blank
doo ./waf clean
doo ./ns3 clean
blank
doo ./waf configure $NS3CONFIG
doo ./ns3 configure $NS3CONFIG
blank
cov=coverity/cov-int
doo cov-build --dir $cov ./waf build
doo cov-build --dir $cov ./ns3 build
blank
tarf=coverity/ns-3.tgz

View File

@@ -33,7 +33,7 @@ do
if [[ "$line" == example* ]]
then
name=${line#example }
NS_LOG="*" ./waf --run "$name" >& /dev/null
NS_LOG="*" ./ns3 --run "$name" >& /dev/null
status="$?"
echo "program $name status $status"
fi

View File

@@ -42,7 +42,7 @@ def print_cmds(cmds):
def set_workdir():
dir_files = [ f for f in os.listdir('.') if os.path.exists(f) ]
if not 'VERSION' in dir_files and not 'waf' in dir_files:
if not 'VERSION' in dir_files and not 'ns3' in dir_files:
if os.path.split(os.path.abspath('.'))[1] == 'tests' and os.path.split(os.path.abspath(os.pardir))[1] == 'utils':
os.chdir('../../')
else:

View File

@@ -14,8 +14,8 @@
# script:
# - git clone https://github.com/afq984/python-cxxfilt.git
# - mv python-cxxfilt/cxxfilt bindings/python
# - CXX="g++" ./waf configure --disable-examples --disable-tests -d debug
# - ./waf --apiscan=$MODULE
# - CXX="g++" ./ns3 configure --disable-examples --disable-tests -d debug
# - ./ns3 --apiscan=$MODULE
# - git diff src > pybindgen_new.patch
# artifacts:
# paths:

View File

@@ -165,109 +165,6 @@ def get_enabled_modules():
return read_c4che_entry("NS3_ENABLED_MODULES")
class NS3RunWafTargets(unittest.TestCase):
"""!
ns3 tests related to compatibility with Waf-produced binaries
"""
## when cleaned_once is False, clean up build artifacts and reconfigure
cleaned_once = False
def setUp(self):
"""!
Clean the default build directory, then configure and build ns-3 with waf
@return None
"""
if not NS3RunWafTargets.cleaned_once:
NS3RunWafTargets.cleaned_once = True
run_ns3("clean")
return_code, stdout, stderr = run_program("waf", "configure --enable-examples --enable-tests", python=True)
self.assertEqual(return_code, 0)
self.assertIn("finished successfully", stdout)
return_code, stdout, stderr = run_program("waf", "build", python=True)
self.assertEqual(return_code, 0)
self.assertIn("finished successfully", stdout)
def test_01_loadExecutables(self):
"""!
Try to load executables built by waf
@return None
"""
# Check if build-status.py exists, then read to get list of executables.
self.assertTrue(os.path.exists(usual_build_status_script))
## ns3_executables holds a list of executables in build-status.py
self.ns3_executables = get_programs_list()
self.assertGreater(len(self.ns3_executables), 0)
def test_02_loadModules(self):
"""!
Try to load modules built by waf
@return None
"""
# Check if c4che.py exists than read to get the list of enabled modules.
self.assertTrue(os.path.exists(usual_c4che_script))
## ns3_modules holds a list to the modules enabled stored in c4che.py
self.ns3_modules = get_enabled_modules()
self.assertGreater(len(self.ns3_modules), 0)
def test_03_runNobuildScratchSim(self):
"""!
Try to run an executable built by waf
@return None
"""
return_code, stdout, stderr = run_ns3("run scratch-simulator --no-build")
self.assertEqual(return_code, 0)
self.assertIn("Scratch Simulator", stderr)
def test_04_runNobuildExample(self):
"""!
Try to run a different executable built by waf
@return None
"""
return_code, stdout, stderr = run_ns3("run command-line-example --verbose --no-build")
self.assertEqual(return_code, 0)
self.assertIn("command-line-example", stdout)
def test_05_runTestCaseCoreExampleSimulator(self):
"""!
Try to run a test case built by waf that calls the ns3 wrapper script
@return None
"""
return_code, stdout, stderr = run_program("test.py", "--no-build -s core-example-simulator", True)
self.assertEqual(return_code, 0)
self.assertIn("PASS", stdout)
def test_06_runTestCaseExamplesAsTestsTestSuite(self):
"""!
Try to run a different test case built by waf that calls the ns3 wrapper script
@return None
"""
return_code, stdout, stderr = run_program("test.py", "--no-build -s examples-as-tests-test-suite", True)
self.assertEqual(return_code, 0)
self.assertIn("PASS", stdout)
def test_07_runCoreExampleSimulator(self):
"""!
Try to run test cases built by waf that calls the ns3 wrapper script
when the output directory is set to a different path
@return None
"""
run_ns3("clean")
return_code, stdout, stderr = run_program("waf",
"configure --enable-examples --enable-tests --out build/debug",
python=True)
self.assertEqual(return_code, 0)
self.assertIn("finished successfully", stdout)
return_code, stdout, stderr = run_program("waf",
'--run "test-runner --suite=core-example-simulator --verbose"',
True)
self.assertEqual(return_code, 0)
self.assertIn("PASS", stdout)
class NS3CommonSettingsTestCase(unittest.TestCase):
"""!
ns3 tests related to generic options
@@ -1831,7 +1728,6 @@ if __name__ == '__main__':
suite = unittest.TestSuite()
# Put tests cases in order
suite.addTests(loader.loadTestsFromTestCase(NS3RunWafTargets))
suite.addTests(loader.loadTestsFromTestCase(NS3CommonSettingsTestCase))
suite.addTests(loader.loadTestsFromTestCase(NS3ConfigureBuildProfileTestCase))
suite.addTests(loader.loadTestsFromTestCase(NS3ConfigureTestCase))

View File

@@ -45,7 +45,7 @@
# -l, --list print the list of known tests
# -m, --multiple report multiple failures from test suites and test
# cases
# -n, --no-build do not run waf before starting testing
# -n, --no-build do not run ns3 before starting testing
# -p PYEXAMPLE, --pyexample=PYEXAMPLE
# specify a single python example to run (with relative
# path)
@@ -111,8 +111,8 @@ def main(argv):
'--xml=t_opt.xml && rm -rf t_opt.xml',
]
configure_string = sys.executable + ' waf configure --enable-tests --enable-examples'
clean_string = sys.executable + ' waf clean'
configure_string = sys.executable + ' ns3 configure --enable-tests --enable-examples'
clean_string = sys.executable + ' ns3 clean'
cmd_execute_list = [ '%s && %s test.py %s && %s' % (configure_string, sys.executable, option, clean_string) for option in test_cases]
runner = TestBaseClass(argv[1:], "Test suite for the ns-3 unit test runner" , 'test-py')
return runner.runtests(cmd_execute_list)

View File

@@ -1,193 +0,0 @@
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014 Siddharth Santurkar
#
# 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
#
# NOTE: Run this script with the Python3 interpreter if the python3 compatibility
# of the ns-3 unit test runner needs to be tested.
# The following options of waf are being tested for poratability by this script.
# To see the options supported by this script, run with the -h option on the command line
#
# build : executes the build (pre: configure, post: clean)
# check : run the equivalent of the old ns-3 unit tests using test.py
# clean : cleans the project
# configure: configures the project (pore: None, post: distclean)
# dist : makes a tarball for redistributing the sources (pre:none )
# distcheck: checks if the project compiles (tarball from 'dist') (pre: dist, post: rm -rf ns-3*.tar.bz2)
# docs : build all the documentation: doxygen, manual, tutorial, models (pre: configure; post: distclean)
# doxygen : do a full build, generate the introspected doxygen and then the doxygen
# install : installs the targets on the system (pre: configure, post: uninstall )
# list : lists the targets to execute (pre: configure)
# shell : run a shell with an environment suitably modified to run locally built programs (pre:configure)
# sphinx : build the Sphinx documentation: manual, tutorial, models
# step : executes tasks in a step-by-step fashion, for debugging (pre: configure)
# uninstall: removes the targets installed (pre: install, post uninstall)
# *update : updates the plugins from the *waflib/extras* directory
from __future__ import print_function
from TestBase import TestBaseClass
import sys
def replace(pre, post, main_cmd_list):
if pre:
pre = pre + ' && '
else:
pre = ''
if post:
post = ' && ' + post
else:
post = ''
return [ pre + main_cmd + post for main_cmd in main_cmd_list ]
def main(argv):
"""
Prepares test cases and executes
"""
runner = TestBaseClass(argv[1:], "Test suite for the ns-3 Waf build system", 'waf')
in_cmds = runner.override_cmds()
if in_cmds:
cmds = in_cmds.split(',')
else:
cmds = ['basic', 'build', 'configure', 'step', 'clean', 'dist', 'list']
config_test_cases = [
"--enable-gcov",
"--enable-sudo",
"--enable-tests",
"--disable-tests",
"--enable-examples",
"--disable-examples",
"--doxygen-no-build",
"--enable-static",
"--enable-mpi",
"--enable-rpath",
"--enable-modules=build/utils/test-runner.cc.1.o",
"--boost-static",
"--boost-mt",
"--boost-linkage_autodetect",
"--boost-python=33",
"--disable-gtk",
"--int64x64=cairo",
"--disable-pthread",
"--force-planetlab",
"--nopyc",
"--nopyo",
"--disable-python",
"--apiscan=all",
"--with-python=/usr/bin/python2.7",
"-o test_out && rm -rf test_out",
"--out=test_out && rm -rf test_out",
"-t test_top && rm -rf test_top",
"--top=test_top && rm -rf test_top",
"--download",
"--check-c-compiler=gc",
"--check-cxx-compiler=g++",
]
basic_test_cases = [
"--version",
"-h",
"--help",
]
build_test_cases = [
"-j10",
"--jobs=10",
"-d optimized",
"-d debug",
"-d release",
"--build-profile optimized",
"--build-profile debug",
"--build-profile release",
"-p",
"--progress",
]
step_test_cases = [
"--files=\"*/main.c,*/test/main.o\"",
]
install_test_cases = [
"-f",
"--force",
"--prefix=./test-prefix && rm -rf ./test-prefix",
"--exec-prefix=.",
"--bindir=./test-prefix/bin --sbindir=./test-prefix/sbin --libexecdir=./test-prefix/libexec --sysconfdir=./test-prefix/etc --sharedstatedir=./test-prefix/com --localstatedir=./test-prefix/var --libdir=./test-prefix/lib --includedir=./test-prefix/include --oldincludedir=./test-prefix/usr/include --datarootdir=./test-prefix/share --datadir=./test-prefix/share_root --infodir=./test-prefix/info --localedir=./test-prefix/locale --mandir=./test-prefix/man --docdir=./test-prefix/doc/package --htmldir=./test-prefix/doc --dvidir=./test-prefix/doc --pdfdir=./test-prefix/doc --psdir=./test-prefix/doc && rm -rf ./test-prefix",
]
common_test_cases = [
"",
"-k",
"--keep",
"-v",
"--verbose",
"--nocache",
"--zones=task_gen",
"--zones=deps",
"--zones=tasks",
"--no-task-lines",
]
test_case_mappings = {
'basic' : basic_test_cases,
'configure' : config_test_cases,
'build' : build_test_cases,
'step' : step_test_cases,
'install' : install_test_cases,
}
waf_string = sys.executable + ' waf'
cmd_execute_list = []
for cmd in cmds:
if cmd == 'basic':
cmd_list = []
else:
cmd_list = ['%s %s %s' % (waf_string, cmd, option) for option in common_test_cases ]
if cmd in test_case_mappings:
cmd_list += ['%s %s %s' % (waf_string, cmd, option) for option in test_case_mappings[cmd] ]
if cmd == 'basic':
cmd_list.append('%s configure && %s build && %s --run scratch/myfirst' % tuple([waf_string]*3))
cmd_list.append('%s configure && %s build && %s --pyrun scratch/myfirst.py' % tuple([waf_string]*3))
if cmd == 'build':
cmd_list = replace(waf_string+' configure', waf_string+' clean', cmd_list)
cmd_list.append('%s configure --enable-gcov && %s build --lcov-report && %s clean' % tuple([waf_string]*3))
elif cmd == 'configure':
cmd_list = replace(None, waf_string+' distclean', cmd_list)
elif cmd == 'distcheck':
cmd_list = replace(waf_string+' dist', 'rm -rf ns-3*.tar.bz2', cmd_list)
elif cmd == 'docs':
cmd_list = replace(waf_string+' configure', waf_string+' distclean', cmd_list)
elif cmd == 'install':
cmd_list = replace(waf_string+' configure', waf_string+' uninstall', cmd_list)
elif cmd == 'list':
cmd_list = replace(waf_string+' configure', waf_string +' distclean', cmd_list)
elif cmd == 'shell':
cmd_list = replace(waf_string+' configure', waf_string+' distclean', cmd_list)
elif cmd == 'step':
cmd_list = replace(waf_string+' configure', waf_string+' distclean', cmd_list)
elif cmd == 'uninstall':
cmd_list = replace(waf_string+' install', None, cmd_list)
cmd_execute_list += cmd_list
return runner.runtests(cmd_execute_list)
if __name__ == '__main__':
sys.exit(main(sys.argv))

View File

@@ -1,37 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os.path
def build(bld):
env = bld.env
test_runner = bld.create_ns3_program('test-runner', ['core'])
test_runner.install_path = None # do not install
test_runner.source = 'test-runner.cc'
# Set the libraries the testrunner depends on equal to the list of
# enabled modules plus the list of enabled module test libraries.
test_runner.use = [mod for mod in (env['NS3_ENABLED_MODULES'] + env['NS3_ENABLED_MODULE_TEST_LIBRARIES'])]
obj = bld.create_ns3_program('bench-simulator', ['core'])
obj.source = 'bench-simulator.cc'
# Because the list of enabled modules must be set before
# test-runner can be built, this diretory is parsed by the top
# level wscript file after all of the other program module
# dependencies have been handled.
#
# So, make sure that the network module is enabled before building
# these programs.
if 'ns3-network' in env['NS3_ENABLED_MODULES']:
obj = bld.create_ns3_program('bench-packets', ['network'])
obj.source = 'bench-packets.cc'
# Make sure that the csma module is enabled before building
# this program.
# if 'ns3-csma' in env['NS3_ENABLED_MODULES']:
obj = bld.create_ns3_program('print-introspected-doxygen', ['network'])
obj.source = 'print-introspected-doxygen.cc'
obj.use = [mod for mod in env['NS3_ENABLED_MODULES']]
obj = bld.create_ns3_program('perf-io', ['core'])
obj.source = 'perf/perf-io.cc'