Skip to content

Restore ns-3 test-runner wiring so point-to-point suites are discoverable#236

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-issue-229
Draft

Restore ns-3 test-runner wiring so point-to-point suites are discoverable#236
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-issue-229

Conversation

Copy link

Copilot AI commented Mar 12, 2026

devices-point-to-point was already defined and registered, but python3 ./test.py --no-build -s devices-point-to-point still failed with “unknown test suite name”. The issue was not the suite name itself; this fork was missing the test-runner build path that test.py uses to enumerate and execute C++ TestSuites.

  • Re-enable ns-3 test suite discovery

    • Add the missing utils build subtree to simulation/CMakeLists.txt
    • Restore the test-runner executable target so test.py can query --print-test-name-list
    • Link test-runner against ${ns3-libs-tests} so module test libraries, including point-to-point-test, are visible at runtime
  • Restore the minimal test-runner entrypoint

    • Add the missing utils/test-runner.cc
    • Keep the implementation minimal: delegate directly to ns3::TestRunner::Run(argc, argv)
  • Unblock compilation on current toolchains

    • Add missing fixed-width integer includes in headers that are required for the test-enabled build path
    • Keep the scope limited to localized compile fixes needed to build the test discovery path
  • Direct ns-3 invocation remains the supported flow

    • The intended workflow stays:
      cd ./ns-3-alibabacloud/simulation
      ./ns3 configure --enable-tests --disable-examples
      ./ns3 build
      python3 ./test.py --no-build -s devices-point-to-point

Example of the restored entrypoint:

#include "ns3/test.h"

int
main(int argc, char* argv[])
{
    return ns3::TestRunner::Run(argc, argv);
}

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] [ISSUE-229] Fix the identified bug in SimAI Clarify ns-3 module test entrypoint and point-to-point suite usage Mar 12, 2026
Copilot AI and others added 2 commits March 12, 2026 08:08
Co-authored-by: tianhao909 <48342395+tianhao909@users.noreply.github.com>
Co-authored-by: tianhao909 <48342395+tianhao909@users.noreply.github.com>
Copilot AI changed the title Clarify ns-3 module test entrypoint and point-to-point suite usage Add a top-level ns-3 test entrypoint and document the point-to-point suite name Mar 12, 2026
@wtl0000
Copy link

wtl0000 commented Mar 12, 2026

您好,我直接运行 ./ns3 configure --enable-tests 出错运行不出来,但先 cmake -S 。 -B build -DNS3_TESTS=ON -DBUILD_TESTING=ON cmake --build build -j,build和编译没问题,再运行 ./ns3 configure --enable-tests 是可以的,但运行 python3 ./test.py -s devices-point-to-point 还是测试套件未运行,因为请求了未知的测试套件名称”。这个方案是Direct ns-3 invocation remains documented as:

cd ./ns-3-alibabacloud/simulation
./ns3 configure --enable-tests --disable-examples
./ns3 build
python3 ./test.py --no-build -s devices-point-to-point

@wtl0000
Copy link

wtl0000 commented Mar 12, 2026

.对于另一个方案./scripts/build.sh -t ns3 devices-point-to-point,我是在simai文件夹下运行,但这样无法运行,我运行的是./scripts/build.sh -c ns3 devices-point-to-point,但报错找不到mtp.h,我在github和我自己的文件上都找不到这个文件,这个方案为Example:
./scripts/build.sh -t ns3 devices-point-to-point
我将build.sh进行了更新,运行了./scripts/build.sh -t ns3 devices-point-to-point,出错
image

Copilot AI changed the title Add a top-level ns-3 test entrypoint and document the point-to-point suite name Restore ns-3 test-runner wiring so point-to-point suites are discoverable Mar 12, 2026
@tianhao909
Copy link
Collaborator

两个pr都有更新 可以再试试 , 有什么问题可以在对应pr底下继续追问看看

#236
https://github.com/aliyun/SimAI/pull/236/commits

image

#238
https://github.com/aliyun/SimAI/pull/238/commits
image
image

@wtl0000
Copy link

wtl0000 commented Mar 13, 2026

您好我不理解上面说的Add the missing utils build subtree to simulation/CMakeLists.txt
Restore the test-runner executable target so test.py can query --print-test-name-list
Link test-runner against ${ns3-libs-tests} so module test libraries, including point-to-point-test, are visible at runtime
Restore the minimal test-runner entrypoint

Add the missing utils/test-runner.cc
Keep the implementation minimal: delegate directly to ns3::TestRunner::Run(argc, argv)这些操作是什么意思,怎样操作
#include "ns3/test.h"

int
main(int argc, char* argv[])
{
return ns3::TestRunner::Run(argc, argv);
}这部分是加到哪的?
上面部分没进行,我仅按照新更新的build.sh进行了修改,报错为
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants