From 63b9f3ebb4dc67746dc1cd8882412e48932b39f7 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Thu, 3 Dec 2020 14:55:10 +0800 Subject: [PATCH] [style] simplify build paths (#5888) This commit simplifies the build paths: * remove cmake prefix from `script/test` * use fixed name for simulation and posix platforms just like others --- .github/workflows/posix.yml | 18 +++++------ .github/workflows/simulation.yml | 14 ++++----- examples/Makefile-simulation | 2 +- script/check-ncp-rcp-migrate | 12 ++++---- script/check-posix-pty | 10 +++--- script/test | 52 ++++++++++++++++---------------- src/posix/Makefile-posix | 6 ++-- src/posix/README.md | 20 ++++++------ 8 files changed, 67 insertions(+), 67 deletions(-) diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index ea68ed4b8..5ccb37571 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -64,12 +64,12 @@ jobs: make -f src/posix/Makefile-posix - name: Run run: | - VERBOSE=1 OT_CLI_PATH="$(pwd)/$(ls output/posix/*/bin/ot-cli) -v" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" make -f src/posix/Makefile-posix check + VERBOSE=1 OT_CLI_PATH="$PWD/output/posix/bin/ot-cli -v" RADIO_DEVICE="$PWD/output/simulation/bin/ot-rcp" make -f src/posix/Makefile-posix check - uses: actions/upload-artifact@v2 if: ${{ failure() }} with: name: posix-cli-thread-cert - path: build/posix/x86_64-unknown-linux-gnu/tests/scripts/thread-cert + path: build/posix/tests/scripts/thread-cert - name: Keep Simulation Only run: | tar -cf build/posix.tar -C build/ posix/ @@ -83,7 +83,7 @@ jobs: path: tmp/coverage.info - name: Keep POSIX Only run: | - rm -rf build/x86_64-unknown-linux-gnu/ + rm -rf build/simulation/ tar -xf build/posix.tar -C build/ - name: Generate Coverage run: | @@ -118,12 +118,12 @@ jobs: make -f src/posix/Makefile-posix - name: Run run: | - VERBOSE=1 OT_NCP_PATH="$(pwd)/$(ls output/posix/*/bin/ot-ncp)" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" make -f src/posix/Makefile-posix check + VERBOSE=1 OT_NCP_PATH="$PWD/output/posix/bin/ot-ncp" RADIO_DEVICE="$PWD/output/simulation/bin/ot-rcp" make -f src/posix/Makefile-posix check - uses: actions/upload-artifact@v2 if: ${{ failure() }} with: name: posix-ncp-thread-cert - path: build/posix/x86_64-unknown-linux-gnu/tests/scripts/thread-cert + path: build/posix/tests/scripts/thread-cert - name: Keep Simulation Only run: | tar -cf build/posix.tar -C build/ posix/ @@ -137,7 +137,7 @@ jobs: path: tmp/coverage.info - name: Keep POSIX Only run: | - rm -rf build/x86_64-unknown-linux-gnu/ + rm -rf build/simulation/ tar -xf build/posix.tar -C build/ - name: Generate Coverage run: | @@ -177,7 +177,7 @@ jobs: path: tmp/coverage.info - name: Keep POSIX Only run: | - rm -rf build/x86_64-unknown-linux-gnu/ + rm -rf build/simulation/ tar -xf build/posix.tar -C build/ - name: Generate Coverage run: | @@ -225,7 +225,7 @@ jobs: path: tmp/coverage.info - name: Keep POSIX Only run: | - rm -rf build/x86_64-unknown-linux-gnu/ + rm -rf build/simulation/ tar -xf build/posix.tar -C build/ - name: Generate Coverage run: | @@ -274,7 +274,7 @@ jobs: path: tmp/coverage.info - name: Keep POSIX Only run: | - rm -rf build/x86_64-unknown-linux-gnu/ + rm -rf build/simulation/ tar -xf build/posix.tar -C build/ - name: Generate Coverage run: | diff --git a/.github/workflows/simulation.yml b/.github/workflows/simulation.yml index b9727685b..408c50ccf 100644 --- a/.github/workflows/simulation.yml +++ b/.github/workflows/simulation.yml @@ -89,7 +89,7 @@ jobs: ./bootstrap - name: Run OTNS Tests env: - OTNS_COMMIT: "632503d7ccbadcbdc49c6245eafc2425c80bbf04" # Sep 29, 2020 + OTNS_COMMIT: "2d57478d9e748d09cad65cf5374942e9d96719ed" # openthread/ot-ns#112 run: | export OT_DIR=$PWD mkdir -p /tmp/otns @@ -183,7 +183,7 @@ jobs: if: ${{ failure() }} with: name: cli-ftd-thread-cert - path: build/x86_64-unknown-linux-gnu/tests/scripts/thread-cert + path: build/simulation/tests/scripts/thread-cert - name: Generate Coverage run: | ./script/test generate_coverage gcc @@ -224,7 +224,7 @@ jobs: if: ${{ failure() }} with: name: cli-mtd-thread-cert - path: build/x86_64-unknown-linux-gnu/tests/scripts/thread-cert + path: build/simulation/tests/scripts/thread-cert - name: Generate Coverage run: | ./script/test generate_coverage gcc @@ -261,7 +261,7 @@ jobs: if: ${{ failure() }} with: name: cli-time-sync-thread-cert - path: build/x86_64-unknown-linux-gnu/tests/scripts/thread-cert + path: build/simulation/tests/scripts/thread-cert - name: Generate Coverage run: | ./script/test generate_coverage gcc @@ -408,7 +408,7 @@ jobs: if: ${{ failure() }} with: name: multiple-instance-thread-cert - path: build/x86_64-unknown-linux-gnu/tests/scripts/thread-cert + path: build/simulation/tests/scripts/thread-cert - name: Generate Coverage run: | ./script/test generate_coverage gcc @@ -447,7 +447,7 @@ jobs: if: ${{ failure() }} with: name: ncp-gcc-m32-thread-cert - path: build/x86_64-unknown-linux-gnu/tests/scripts/thread-cert + path: build/simulation/tests/scripts/thread-cert - name: Generate Coverage run: | ./script/test generate_coverage gcc @@ -485,7 +485,7 @@ jobs: if: ${{ failure() }} with: name: cli-clang-thread-cert - path: build/x86_64-unknown-linux-gnu/tests/scripts/thread-cert + path: build/simulation/tests/scripts/thread-cert - name: Generate Coverage run: | ./script/test generate_coverage llvm diff --git a/examples/Makefile-simulation b/examples/Makefile-simulation index 5eca36cb0..755e2c650 100644 --- a/examples/Makefile-simulation +++ b/examples/Makefile-simulation @@ -152,7 +152,7 @@ ResultPath = output TopResultDir = $(ResultPath) AbsTopResultDir = $(PWD)/$(TopResultDir) -TargetTuple = $(shell ${AbsTopSourceDir}/third_party/nlbuild-autotools/repo/third_party/autoconf/config.guess | sed -e 's/[[:digit:].]*$$//g') +TargetTuple = simulation ifndef BuildJobs BuildJobs := $(shell getconf _NPROCESSORS_ONLN) diff --git a/script/check-ncp-rcp-migrate b/script/check-ncp-rcp-migrate index a52836d4c..878d71346 100755 --- a/script/check-ncp-rcp-migrate +++ b/script/check-ncp-rcp-migrate @@ -61,7 +61,7 @@ check() MASTER_KEY="0123456789abcdef0123456789abcdef" echo "Step 1. Start NCP platform and form a PAN..." - RADIO_NCP_CMD="$(pwd)/$(ls output/*linux*/bin/ot-cli-ftd)" + RADIO_NCP_CMD="$PWD/output/simulation/bin/ot-cli-ftd" expect <"$RADIO_PTY" <"$RADIO_PTY" & @@ -86,9 +86,9 @@ check() RADIO_URL="spinel+hdlc+uart://${CORE_PTY}?max-power-table=11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26" if [[ ${DAEMON} == 1 ]]; then - sudo "$(pwd)/$(ls output/posix/*linux*/bin/ot-daemon)" -I "${VALID_NETIF_NAME}" "${RADIO_URL}" & + sudo "$PWD/output/posix/bin/ot-daemon" -I "${VALID_NETIF_NAME}" "${RADIO_URL}" & sleep 1 - OT_CLI_CMD="$(pwd)/$(ls output/posix/*linux*/bin/ot-ctl)" + OT_CLI_CMD="$PWD/output/posix/bin/ot-ctl" sudo "${OT_CLI_CMD}" panid 0xface | grep 'Done' || die 'failed to set panid with ot-ctl' # verify this reset and factoryreset end immediately @@ -97,7 +97,7 @@ check() sleep 2 sudo "${OT_CLI_CMD}" factoryreset else - OT_CLI="$(pwd)/$(ls output/posix/*linux*/bin/ot-cli)" + OT_CLI="$PWD/output/posix/bin/ot-cli" sudo "${OT_CLI}" -I "${VALID_NETIF_NAME}" -n "${RADIO_URL}" # Cover setting a too long(max is 15 characters) network interface name. @@ -105,7 +105,7 @@ check() readonly INVALID_NETIF_NAME="wan0123456789123" sudo "${OT_CLI}" -I "${INVALID_NETIF_NAME}" -n "${RADIO_URL}" || test $? = 2 - OT_CLI_CMD="$(pwd)/$(ls output/posix/*linux*/bin/ot-cli) ${RADIO_URL}" + OT_CLI_CMD="$PWD/output/posix/bin/ot-cli ${RADIO_URL}" fi sudo expect <