diff --git a/ns3 b/ns3 index 360f594f6..d19047107 100755 --- a/ns3 +++ b/ns3 @@ -1255,6 +1255,9 @@ def main(): if run_only or build_and_run: if target_to_run in ns3_programs: target_to_run = check_ambiguous_target("Run", target_to_run, ns3_programs) + elif ".py" in target_to_run and os.path.exists(target_to_run): + # We let python scripts pass to be able to run ./utils/python-unit-tests.py + pass else: raise Exception("Couldn't find the specified program: %s" % target_to_run) diff --git a/utils/tests/gitlab-ci-gcc.yml b/utils/tests/gitlab-ci-gcc.yml index e116be854..5c2df5a3a 100644 --- a/utils/tests/gitlab-ci-gcc.yml +++ b/utils/tests/gitlab-ci-gcc.yml @@ -19,6 +19,7 @@ - apt-get --quiet install gcc g++ cmake ninja-build python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev gsl-bin libgsl0-dev ssh --yes variables: COMPILER: g++ + ENABLE_MPI: --enable-mpi # GCC 8 # weekly-build-gcc-8-debug: diff --git a/utils/tests/gitlab-ci-pybindgen.yml b/utils/tests/gitlab-ci-pybindgen.yml index 325d58ba2..2fd5ee7cd 100644 --- a/utils/tests/gitlab-ci-pybindgen.yml +++ b/utils/tests/gitlab-ci-pybindgen.yml @@ -1,24 +1,86 @@ -# pybindgen: -# stage: build -# image: archlinux -# only: -# variables: -# - $PYBINDGEN == "True" -# before_script: -# - pacman -Syu --noconfirm -# - pacman -Sy base-devel python ccache gsl gtk3 boost wget git --noconfirm -# - wget --no-check-certificate https://nat.onthewifi.net/ns3/castxml-git-0.3.4.r19.g8625aed-1-x86_64.pkg.tar -# - wget --no-check-certificate https://nat.onthewifi.net/ns3/python-pybindgen-0.21.0-1-x86_64.pkg.tar -# - wget --no-check-certificate https://nat.onthewifi.net/ns3/python-pygccxml-git-1.9.0.r104.g84be336-1-any.pkg.tar -# - pacman -U --noconfirm python-pygccxml-git-1.9.0.r104.g84be336-1-any.pkg.tar python-pybindgen-0.21.0-1-x86_64.pkg.tar castxml-git-0.3.4.r19.g8625aed-1-x86_64.pkg.tar -# script: -# - git clone https://github.com/afq984/python-cxxfilt.git -# - mv python-cxxfilt/cxxfilt bindings/python -# - CXX="g++" ./ns3 configure --disable-examples --disable-tests -d debug -# - ./ns3 --apiscan=$MODULE -# - git diff src > pybindgen_new.patch -# artifacts: -# paths: -# - pybindgen_new.patch -# timeout: 9h +pybindgen-21.04: + image: ubuntu:21.04 # python 3.9 + only: + variables: + - $RELEASE == "weekly" + before_script: + - apt-get update + - DEBIAN_FRONTEND=noninteractive apt-get install -y g++ cmake ninja-build ccache libgsl-dev libgtk-3-dev libboost-dev wget git python3 python3-pip + - pip install cxxfilt pygccxml pybindgen castxml + script: + - ./ns3 configure -G Ninja -- -DNS3_SCAN_PYTHON_BINDINGS=ON + - ./ns3 build apiscan-all + - ./ns3 configure --enable-python-bindings + - ./ns3 build + - ./ns3 run first.py + - ./ns3 run second.py + - ./ns3 run third.py + - ./ns3 run ./utils/python-unit-tests.py + - git diff src > pybindgen_new2104.patch + artifacts: + paths: + - pybindgen_new2104.patch + timeout: 9h + +pybindgen-20.04: + image: ubuntu:20.04 # python 3.8 + only: + variables: + - $RELEASE == "manual" + before_script: + - apt-get update + - DEBIAN_FRONTEND=noninteractive apt-get install -y g++ cmake ninja-build ccache libgsl-dev libgtk-3-dev libboost-dev wget git python3 python3-pip + - pip install cxxfilt pygccxml pybindgen castxml + script: + - ./ns3 configure -G Ninja -- -DNS3_SCAN_PYTHON_BINDINGS=ON + - ./ns3 build apiscan-all + - ./ns3 configure --enable-python-bindings + - ./ns3 build + - ./ns3 run first.py + - ./ns3 run second.py + - ./ns3 run third.py + - ./ns3 run ./utils/python-unit-tests.py + - git diff src > pybindgen_new2004.patch + artifacts: + paths: + - pybindgen_new2004.patch + timeout: 9h + +pybindgen-18.04: + image: ubuntu:18.04 # python 3.6 + only: + variables: + - $RELEASE == "manual" + before_script: + - apt-get update + - apt-get install -y software-properties-common + - add-apt-repository ppa:ubuntu-toolchain-r/test --yes + - apt-get update + - DEBIAN_FRONTEND=noninteractive apt-get install -y cmake ninja-build ccache libgsl-dev libgtk-3-dev libboost-dev wget git g++-9 gcc-9 python3 python3-pip llvm-dev libclang-dev + - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 800 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + - pip3 install setuptools distro requests cxxfilt + - git clone https://gitlab.com/nsnam/bake.git + - export PATH=$PATH:`pwd`/bake/build/bin + - export PYTHONPATH=$PYTHONPATH:`pwd`/bake/build/lib + - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/bake/build/lib + - cd bake + - mkdir -p build/lib + - ./bake.py configure -e pygccxml -e pybindgen + - ./bake.py download + - ./bake.py build + - cd .. + script: + - CXX=g++-9 ./ns3 configure -G Ninja -- -DNS3_SCAN_PYTHON_BINDINGS=ON + - ./ns3 build apiscan-all + - ./ns3 configure --enable-python-bindings + - ./ns3 build + - ./ns3 run first.py + - ./ns3 run second.py + - ./ns3 run third.py + - ./ns3 run ./utils/python-unit-tests.py + - git diff src > pybindgen_new1804.patch + artifacts: + paths: + - pybindgen_new1804.patch + timeout: 9h diff --git a/utils/tests/gitlab-ci.yml b/utils/tests/gitlab-ci.yml index cde0a987f..329e7a532 100644 --- a/utils/tests/gitlab-ci.yml +++ b/utils/tests/gitlab-ci.yml @@ -38,7 +38,7 @@ stages: - export CCACHE_BASEDIR=${PWD} - export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE - export MPI_CI=1 - - CXX=$COMPILER ./ns3 configure -d $MODE -GNinja --enable-examples --enable-tests --enable-asserts --enable-mpi + - CXX=$COMPILER ./ns3 configure -d $MODE -GNinja --enable-examples --enable-tests --enable-asserts $ENABLE_MPI - ./ns3 build - if [ "$MODE" != "debug" ]; then ./test.py -n; fi cache: @@ -103,37 +103,6 @@ per-commit-compile-optimized: - pacman -Syu --noconfirm - pacman -Sy base-devel python ccache gsl gtk3 boost ninja cmake --noconfirm -# .cmake-build: -# stage: build -# script: -# - mkdir -p $CCACHE_BASEDIR_VALUE -# - export CCACHE_BASEDIR=${PWD} -# - export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE -# - ./ns3 configure -d $MODE -GNinja --enable-examples --enable-tests -# - ./ns3 build -# - ./test.py -n -# cache: -# paths: -# - $CCACHE_BASEDIR_VALUE/ -# timeout: 9h -# variables: -# CCACHE_BASEDIR_VALUE: ns-3-ccache-storage - -# per-commit-compile-release-cmake: -# extends: .cmake-build -# except: -# variables: -# - $PYBINDGEN == "True" -# - $RELEASE == "weekly" -# - $RELEASE == "daily" -# image: archlinux -# variables: -# COMPILER: g++ -# MODE: release -# before_script: -# - pacman -Syu --noconfirm -# - pacman -Sy base-devel python ccache gsl gtk3 boost ninja cmake --noconfirm - # Weekly jobs for other distribution and compilers include: - 'utils/tests/gitlab-ci-ubuntu.yml' @@ -142,4 +111,4 @@ include: - 'utils/tests/gitlab-ci-clang.yml' - 'utils/tests/gitlab-ci-test.yml' - 'utils/tests/gitlab-ci-doc.yml' -# - 'utils/tests/gitlab-ci-pybindgen.yml' + - 'utils/tests/gitlab-ci-pybindgen.yml'