-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tizen] Run matter unit tests on QEMU (#26563)
* Run unit tests on Tizen platform under QEMU * Run all generated unit test executables * Move failing tests to XFAIL group * Manual for debugging tests on QEMU * Add "Run test (Linux x64)" to VSCode debugger * Print failed tests * Drop XFAIL since now all tests pass on Tizen * Do not duplicate example builds with QEMU tests * Do not add rootshell to the word list * Revert defines reordering * Add TODO for GN test assets --------- Co-authored-by: Andrei Litvin <[email protected]>
- Loading branch information
Showing
13 changed files
with
197 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/tizen.gni") | ||
|
||
import("${tizen_sdk_build_root}/tizen_sdk.gni") | ||
|
||
tizen_qemu_mkisofs("chip-tests-runner") { | ||
runner = "runner.sh" | ||
|
||
# Build CHIP unit tests. | ||
deps = [ "${chip_root}/src:tests" ] | ||
|
||
# Bundle all created unit tests. | ||
# TODO (arkq): Collect all unit tests in a way that we could add all targets | ||
# to the assets list. Right now QEMU runner dependencies are not | ||
# tracked properly. Changes to the unit tests will not trigger | ||
# rebuild of the ISO image, so the test will be run with old | ||
# binaries. | ||
assets_non_tracked = [ rebase_path("${root_build_dir}/tests") ] | ||
} | ||
|
||
tizen_qemu_run("chip-tests") { | ||
# Enable network support, so Tizen can obtain current date/time from the | ||
# network. Correct date/time is required for the commissioning process - | ||
# attestation will fail otherwise. | ||
virtio_net = true | ||
|
||
deps = [ ":chip-tests-runner" ] | ||
mkisofs_outputs = get_target_outputs(":chip-tests-runner") | ||
iso_image = rebase_path(mkisofs_outputs[0]) | ||
} | ||
|
||
group("check") { | ||
deps = [ ":chip-tests" ] | ||
testonly = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (c) 2021 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
set -e | ||
|
||
# Print CHIP logs on stdout | ||
dlogutil CHIP & | ||
|
||
FAILED=() | ||
STATUS=0 | ||
|
||
# Run all executables in the /mnt/chip directory except the runner.sh script | ||
while IFS= read -r TEST; do | ||
|
||
NAME=$(basename "$TEST") | ||
|
||
echo | ||
echo "RUN: $NAME" | ||
|
||
RV=0 | ||
"$TEST" || RV=$? | ||
|
||
if [ "$RV" -eq 0 ]; then | ||
echo -e "DONE: \e[32mSUCCESS\e[0m" | ||
else | ||
FAILED+=("$NAME") | ||
STATUS=$((STATUS + 1)) | ||
echo -e "DONE: \e[31mFAIL\e[0m" | ||
fi | ||
|
||
done < <(find /mnt/chip -type f -executable ! -name runner.sh) | ||
|
||
if [ ! "$STATUS" -eq 0 ]; then | ||
echo | ||
echo "### FAILED: ${FAILED[*]}" | ||
fi | ||
|
||
exit "$STATUS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters