From f2c00ceb3b8c2b041662f7790c8f7f63db7ac58e Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Sat, 18 Nov 2023 20:42:36 -0300 Subject: [PATCH] build: fix a test-ns3.py test-case and the bug introduced by a1a6d559 --- ns3 | 2 +- utils/tests/test-ns3.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ns3 b/ns3 index 80606bff4..69a7b61c7 100755 --- a/ns3 +++ b/ns3 @@ -722,7 +722,7 @@ def configure_cmake(cmake, args, current_cmake_cache_folder, current_cmake_gener cmake_args.extend(["-G", args.G]) if args.trace_cmake_perf: - cmake_performance_trace = os.path.join(os.path.relpath(ns3_path, current_cmake_cache_folder), + cmake_performance_trace = os.path.join(os.path.relpath(ns3_path, ns3_path), "cmake_performance_trace.log") cmake_args.extend(["--profiling-format=google-trace", "--profiling-output=" + cmake_performance_trace]) diff --git a/utils/tests/test-ns3.py b/utils/tests/test-ns3.py index 4e7ba5750..a35426616 100755 --- a/utils/tests/test-ns3.py +++ b/utils/tests/test-ns3.py @@ -1493,13 +1493,17 @@ class NS3ConfigureTestCase(NS3BaseTestCase): cmake_performance_trace.log file @return None """ + cmake_performance_trace_log = os.path.join(ns3_path, "cmake_performance_trace.log") + if os.path.exists(cmake_performance_trace_log): + os.remove(cmake_performance_trace_log) + return_code, stdout, stderr = run_ns3("configure --trace-performance") self.assertEqual(return_code, 0) if win32: self.assertIn("--profiling-format=google-trace --profiling-output=", stdout) else: - self.assertIn("--profiling-format=google-trace --profiling-output=../cmake_performance_trace.log", stdout) - self.assertTrue(os.path.exists(os.path.join(ns3_path, "cmake_performance_trace.log"))) + self.assertIn("--profiling-format=google-trace --profiling-output=./cmake_performance_trace.log", stdout) + self.assertTrue(os.path.exists(cmake_performance_trace_log)) def test_18_CheckBuildVersionAndVersionCache(self): """!