加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run_swift.sh 2.21 KB
一键复制 编辑 原始数据 按行查看 历史
lixingfu1 提交于 2023-05-17 17:51 . swift benchmark跑分整理
#! /bin/bash
if [ $# -eq 0 ]; then
benchmark="ALL"
echo "all"
else
benchmark=$1
fi
benchmarkALL="ALL"
swift_path=ts-swift-workload
swift_files=""
LogDate=$(date '+%Y%m%d%H%M%S')
result_file_path=result/$LogDate
function read_dir(){
if [ "$benchmark" = "$benchmarkALL" ]; then
if [ ! -d $result_file_path ];then
mkdir -p $result_file_path
fi
# echo "----- Run $benchmark Benchmark Case -----" >> result/benchmark_result$LogDate.log
for file in `ls $swift_path`
do
if [ -d $swift_path"/"$file ]
then
if [ -d $swift_path/$file/swift ]
then
swift_files="${swift_path}/${file}/swift/*.swift"
if [ -f run ]
then
rm run
fi
swiftc ./$swift_files utils/*.swift main.swift -o run
if [ -f run ]
then
echo "----- Run ${file} Benchmark Case -----" >> $result_file_path/${file}-result.log
./run >> $result_file_path/${file}-result.log
rm run
fi
fi
fi
done
else
if [ "$benchmark" = "--help" ]; then
echo run all test files by default when there are no parameters
echo [ALL] run all swift test suites
echo [path] run the test suite in the path
else
if [ -d ts-swift-workload/$benchmark ];then
if [ ! -d $result_file_path ];then
mkdir -p $result_file_path
fi
echo "Run $benchmark Case" >> $result_file_path/${benchmark}-result.log
swift_files="${swift_path}/${benchmark}/swift/*.swift"
if [ -f run ]
then
rm run
fi
swiftc ./$swift_files utils/*.swift main.swift -o run
if [ -f run ]
then
./run >> $result_file_path/${benchmark}-result.log
rm run
fi
fi
fi
fi
}
read_dir $swift_path
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化