ltp-ddt lmbench
args=''
# getopt fails, set help option
if [ $? -ne 0 ] ; then
H="help";
fi
# update the refined command line argumetn list
eval set -- $args
# parse the command line argument and update the shell variables
# so that functions above can use them
for i in $@ ; do
case "$i" in
-h) shift; H="help" ;;
--help) shift; H="help" ;;
esac
done
# update the refined command line argumetn list once more
eval set -- $args
# call appropriate functions
if [ "$H" = "help" ] ; then
$H
else
lmbench_tests
print_summary
if [ $FAIL_COUNT > 0 ]; then
exit $FAIL_COUNT
else
exit 0
fi
fi
./runltp -P fmsh-psoc-db -f ddt/lmbench
在runtest/ddt/lmbench中将
# @name LMBENCH_TESTS
# @desc Run all LMBENCH tests
# @requires armv*
LMBENCH_L_PERF_0001 lmbench_tests_script.sh
改为
# @name LMBENCH_TESTS
# @desc Run all LMBENCH tests
# @requires armv*
LMBENCH_L_PERF_0001 lmbench_tests_script.sh -h
发现运行后并没有运行help
sh -x 单独运行 lmbench_tests_script.sh -h
发现eval set -- $args 这句有嫌疑
见一段code
test.sh
#!/bin/sh
set -- a b c
echo "\$1=$1"
echo "\$2=$2"
echo "\$3=$3"
test.sh
输出
$1=a
$2=b
$3=c
test.sh 1 2 3
输出
$1=a
$2=b
$3=c
所以set -- 就是用后面的参数覆盖原位置的参数
eval set -- $args == eval set -- '',h就被覆盖了
相关文章
- 01-25ltp-ddt nand_ecc_tests
- 01-25ltp-ddt realtime_cpu_load timeout
- 01-25下载: www.bitmover.com/lmbench,最新版本3.0-a9
- 01-25ltp-ddt qspi_mtd_dd_rw error can't read superblock on /dev/mtdblock0
- 01-25ltp-ddt lmbench
- 01-25原创-性能测试篇-lmbench测试自动化脚本优化
- 01-25lmbench性能分析工具
- 01-25ltp-ddt nor qspi spi调试中需要修改的地方
- 01-25ltp-ddt wdt_test
- 01-25ltp-ddt eth_parallel_processing