-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.sh
More file actions
41 lines (29 loc) · 802 Bytes
/
shell.sh
File metadata and controls
41 lines (29 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
TEST_DIR=./test
OUTPUT_DIR=./output
mkdir -p $OUTPUT_DIR
count=1
for i in $(ls $TEST_DIR/*.sy); do
filename=$(basename $i)
# 生成按编号的输出文件名
output_file=test_${count}.s
# 编译
./src/mind -l 5 $TEST_DIR/$filename -o $OUTPUT_DIR/$output_file
if [ $? -ne 0 ]; then
echo "Compilation failed for file: $filename"
continue
fi
# 编译可执行文件
riscv64-unknown-elf-gcc $OUTPUT_DIR/$output_file -o $OUTPUT_DIR/test
# 运行测试
qemu-riscv64 $OUTPUT_DIR/test
echo $?
# /usr/bin/time -f "cost time:%e" qemu-riscv64 $OUTPUT_DIR/test
# if [ $? -ne 0 ]; then
# echo 1
# # /usr/bin/time -f "cost time:%e" qemu-riscv64 $OUTPUT_DIR/test
# else
# # echo "$filename return $?"
# fi
count=$((count+1))
done