zephyr/scripts
Marc Herbert 1c8632cfaa sanitycheck: support symbolic links in ZEPHYR_BASE
Fix issue where sanitycheck wrongly assumed tests inside ZEPHYR_BASE
to be outside ZEPHYR_BASE and dropped the prefix in their name. This
happened when:
- ZEPHYR_BASE contains symbolic link(s), and
- relative --testcase-root argument(s) are passed

To generate unique names, TestCase.get_unique(testcase_root) first
checks whether "testcase_root" starts with ZEPHYR_BASE. Either may or
may not include symbolic links so both must be canonicalized before
comparison. While fixing this method, replace explicit forward slash
"/" and string replace with os.path.relpath() and make a couple other
simplifications and minor pydoc fixes.

Add new canonical_zephyr_base = os.path.realpath(ZEPHYR_BASE) constant
and corresponding comments and guidelines.

The most visible effect of this mismatch was sanitycheck dropping the
--testcase-root prefix from the unique name of tests inside
ZEPHYR_BASE. This means some test names could be not unique anymore
and silently overwrite each other's results, example:

 bash# cd zephyr_dir_with_symlink; export ZEPHYR_BASE=$(pwd)
 ./scripts/sanitycheck -T samples/portability/cmsis_rtos_v1 \
                       -T samples/portability/cmsis_rtos_v2

The more systematic and practical consequence (and how I actually
found this) was test outputs landing in unexpected locations.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-05-07 23:19:35 -04:00
..
checkpatch scripts: cleanup scripts directory 2018-04-03 09:28:09 -04:00
ci ci: detect changes to sub-board definitions 2019-04-20 14:14:29 -04:00
coccinelle scripts/coccinelle: Add script for counting identifier length 2019-04-18 12:29:07 -04:00
dts scripts/dts: allow node to be child on one bus and parent on another 2019-05-07 22:33:06 -04:00
footprint license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
gitlint license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
kconfig kconfig: Avoid potential issue parsing generated_dts_board.conf 2019-04-18 08:49:46 -04:00
sanity_chk scripts/sanitycheck: Precompile test-time regular expressions 2019-04-18 12:21:13 -04:00
support license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
west_commands scripts: west build: propagate verbosity to cmake generator 2019-05-07 15:49:16 +02:00
.gitignore expr_parser.py: simple expression language 2016-05-04 22:57:39 +00:00
check_link_map.py scripts: Fix risky uses of non-raw regex strings in Python scripts 2019-03-28 14:41:32 -05:00
checkpatch.pl userspace: remove APPLICATION_MEMORY feature 2019-02-08 07:04:30 -05:00
checkstack.pl First commit 2015-04-10 16:44:37 -07:00
coccicheck scripts: coccicheck: Add support for SPFLAGS 2019-02-07 08:12:20 -05:00
dir_is_writeable.py license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
elf_helper.py lib: os: add sys_mutex data type 2019-04-03 13:47:45 -04:00
file2hex.py file2hex.py: new --gzip-mtime option that defaults to zero + test 2019-04-17 08:27:40 -04:00
filter-known-issues.py scripts: Fix risky uses of non-raw regex strings in Python scripts 2019-03-28 14:41:32 -05:00
gen_app_partitions.py scripts: Fix risky uses of non-raw regex strings in Python scripts 2019-03-28 14:41:32 -05:00
gen_cfb_font_header.py subsys: fb: add support for generating CFB font headers at build time 2018-11-28 11:46:00 +01:00
gen_gcov_files.py scripts: gen_gcov_files: report if data capture is not complete 2019-01-29 15:03:38 -05:00
gen_kobject_list.py scripts: gen_kobject_list: Remove redundant parentheses 2019-05-07 08:46:41 -07:00
gen_offset_header.py scripts: python: cleanup script and fix PEP8 issues 2018-01-03 19:03:41 -05:00
gen_priv_stacks.py arch: Rename reserved function names 2019-04-03 17:31:00 -04:00
gen_relocate_app.py scripts: Remove unused variables in all Python scripts 2019-03-28 11:06:20 -05:00
gen_syscall_header.py scripts: Remove unnecessary () around if/while conditions in Python 2019-03-26 07:59:59 -05:00
gen_syscalls.py userspace: properly namespace handler functions 2019-03-18 09:23:11 -07:00
mergehex.py scripts: Remove unused variables in all Python scripts 2019-03-28 11:06:20 -05:00
parse_syscalls.py userspace: add additional script documentation 2019-03-12 08:37:58 +01:00
process_gperf.py scripts: Remove unnecessary () around if/while conditions in Python 2019-03-26 07:59:59 -05:00
qemu-machine-hack.py license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
requirements.txt scripts: update pyocd in requirements.txt 2019-04-10 17:52:15 -04:00
sanitycheck sanitycheck: support symbolic links in ZEPHYR_BASE 2019-05-07 23:19:35 -04:00
series-push-hook.sh scripts: fix path issue in push-hook script 2019-03-13 11:59:38 -05:00
spelling.txt scripts: updated spelling.txt file 2017-07-14 12:57:40 +03:00
subfolder_list.py license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
tags.sh scripts: fix tags.sh to current source tree 2018-01-15 18:30:28 -05:00
valgrind.supp valgrind: Add error supression file for POSIX arch 2018-12-21 21:07:18 +01:00
waitpid sanitycheck: Let waitpid script kill Xtensa ISS if user hits ctrl+c. 2017-04-11 16:53:41 +00:00
west-commands.yml west: Add a boards command 2019-05-03 21:55:13 +02:00
zephyr_module.py cmake: zephyr_modules: Add west executable argument 2019-05-03 14:23:09 -04:00