Skip to content

Commit

Permalink
Enable only core module to speedup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pagmatt committed Jan 27, 2023
1 parent ee7d343 commit 4bbb40a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "examples/ns-3"]
path = examples/ns-3
url = https://github.com/signetlabdei/sem-ns-3-dev
branch = sem-examples
url = https://gitlab.com/nsnam/ns-3-dev
branch = ns-3.35
23 changes: 9 additions & 14 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def ns_3_compiled(tmpdir):

# Relocate build by running the same command in the new directory
if subprocess.call([build_program, 'configure', '--disable-gtk',
'--build-profile=optimized',
'--build-profile=optimized', '--enable-modules=core',
'--out=build/optimized'],
cwd=ns_3_tempdir,
stdout=subprocess.DEVNULL,
Expand Down Expand Up @@ -70,7 +70,7 @@ def ns_3_compiled_debug(tmpdir):

# Relocate build by running the same command in the new directory
if subprocess.call([build_program, 'configure', '--disable-gtk',
'--build-profile=debug',
'--build-profile=debug', '--enable-modules=core',
'--out=build'],
cwd=ns_3_tempdir,
stdout=subprocess.DEVNULL,
Expand Down Expand Up @@ -150,7 +150,7 @@ def manager(ns_3_compiled, config):


def get_and_compile_ns_3():
# Clone ns-3
# Clone latest ns-3
if not os.path.exists(ns_3_test):
Repo.clone_from('https://gitlab.com/nsnam/ns-3-dev.git', ns_3_test)

Expand All @@ -164,18 +164,12 @@ def get_and_compile_ns_3():
if not os.path.exists(ns_3_test_compiled_debug):
shutil.copytree(ns_3_test, ns_3_test_compiled_debug, symlinks=True,
# Do not copy cmake's cache, as it is directory-dependant
ignore=shutil.ignore_patterns("cmake-cache"))

# Copy folder to run examples
if not os.path.exists(ns_3_examples):
shutil.copytree(ns_3_test, ns_3_examples, symlinks=True,
# Do not copy cmake's cache, as it is directory-dependant
ignore=shutil.ignore_patterns("cmake-cache"))
ignore=shutil.ignore_patterns("cmake-cache"))

build_program = get_build_program(ns_3_test_compiled)

if subprocess.call([build_program, 'configure', '--disable-gtk',
'--build-profile=optimized',
'--build-profile=optimized', '--enable-modules=core',
'--out=build/optimized'],
cwd=ns_3_test_compiled,
stdout=subprocess.DEVNULL,
Expand All @@ -191,7 +185,7 @@ def get_and_compile_ns_3():
build_program = get_build_program(ns_3_test_compiled_debug)

if subprocess.call([build_program, 'configure', '--disable-gtk',
'--build-profile=debug',
'--build-profile=debug', '--enable-modules=core',
'--out=build'],
cwd=ns_3_test_compiled_debug,
stdout=subprocess.DEVNULL,
Expand All @@ -204,10 +198,11 @@ def get_and_compile_ns_3():
stderr=subprocess.DEVNULL) > 0:
raise Exception("Debug test build failed.")

# Configure and build WAF-based ns-3
build_program = get_build_program(ns_3_examples)

if subprocess.call([build_program, 'configure', '--disable-gtk',
'--build-profile=optimized',
'--build-profile=optimized', '--enable-modules=core',
'--out=build/optimized'],
cwd=ns_3_examples,
stdout=subprocess.DEVNULL,
Expand All @@ -216,7 +211,7 @@ def get_and_compile_ns_3():
raise Exception("Examples configuration failed.")

if subprocess.call([build_program, 'build'],
cwd=ns_3_test_compiled,
cwd=ns_3_examples,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL) > 0:
raise Exception("Examples build failed.")
Expand Down

0 comments on commit 4bbb40a

Please sign in to comment.