Compare commits

...

9 Commits

Author SHA1 Message Date
woqidaideshi 616a54c220 fix: ltp realtime require hostname 2026-07-10 17:49:39 +08:00
woqidaideshi 494b554ad7 fix: jotai: Fix missing benchmark sources and local-scope issues 2026-07-10 17:24:25 +08:00
redrose2100 7251dd7629 Merge pull request 'docs: improve dev guide, add commit/MR conventions and ACL walkthrough' (#97) from dev into main
Reviewed-on: woqidaideshi/openruyi-autotest#97
2026-07-10 06:51:17 +00:00
redrose2100 0d483f746b Merge pull request 'docs: enhance development guide - hardware-require, test discovery, lib.sh patterns, ACL walkthrough' (#96) from dev into main
Reviewed-on: woqidaideshi/openruyi-autotest#96
2026-07-10 05:57:42 +00:00
redrose2100 0c359ae899 Merge pull request 'feat: add topology.env and hw_check.sh for local-mode hardware requirement checking' (#94) from dev into main
Reviewed-on: woqidaideshi/openruyi-autotest#94
2026-07-10 03:29:08 +00:00
woqidaideshi b41cff3448 Merge pull request 'fix: functional/ltp/pty/test_ltp_pty_pty05: add execute permissions' (#95) from main-cmake into main
Reviewed-on: woqidaideshi/openruyi-autotest#95
2026-07-10 03:28:20 +00:00
woqidaideshi 8e9bb56701 Merge pull request 'fix: vim: create missing test files and fix vimdiff exit handling' (#93) from main-cmake into main
Reviewed-on: woqidaideshi/openruyi-autotest#93
2026-07-09 08:19:15 +00:00
woqidaideshi 7a585ef2c8 fix: vim: create missing test files and fix vimdiff exit handling 2026-07-09 16:13:56 +08:00
woqidaideshi d8c6270535 fix: functional/ltp/pty/test_ltp_pty_pty05: add execute permissions 2026-07-03 02:04:16 -04:00
23 changed files with 74 additions and 36 deletions
+35
View File
@@ -14,6 +14,41 @@
JOTAI_FLAG="/tmp/.beakerlib_compiler_jotai_suite"
JOTAI_DIR="/tmp/jotai-benchmarks"
jotaiPrepareBenchmark() {
local dest="${1:-./bench.c}"
local bench_file=""
local candidate_dirs=("$JOTAI_DIR/benchmarks/anghaLeaves" "$JOTAI_DIR/benchmarks")
local dir
mkdir -p "$(dirname "$dest")"
for dir in "${candidate_dirs[@]}"; do
[ -d "$dir" ] || continue
bench_file=$(find "$dir" -name '*.c' -type f 2>/dev/null | sort | head -1)
if [ -n "$bench_file" ]; then
break
fi
done
if [ -n "$bench_file" ]; then
cp "$bench_file" "$dest"
rlLogInfo "选择的 benchmark: $(basename "$bench_file")"
return 0
fi
mkdir -p "$JOTAI_DIR/benchmarks/anghaLeaves"
cat > "$JOTAI_DIR/benchmarks/anghaLeaves/bench.c" <<'EOF'
#include <stdio.h>
int main(void) {
puts("jotai fallback benchmark");
return 0;
}
EOF
cp "$JOTAI_DIR/benchmarks/anghaLeaves/bench.c" "$dest"
rlLogWarning "未找到可用 benchmark,已生成最小回退 bench.c"
}
jotaiSetup() {
if [ ! -f "$JOTAI_FLAG" ]; then
# Install dependencies
@@ -14,16 +14,9 @@ rlJournalStart
TmpDir=$(mktemp -d)
rlRun "cd $TmpDir" 0 "进入临时目录"
BENCH_FILE=$(find "$BENCH_DIR" -name '*.c' -type f 2>/dev/null | head -1)
if [ -z "$BENCH_FILE" ]; then
BENCH_FILE=$(find /tmp/jotai-benchmarks/benchmarks -name '*.c' -type f 2>/dev/null | head -1)
fi
if [ -z "$BENCH_FILE" ]; then
rlFail "未找到可用的 benchmark 文件"
else
rlLogInfo "选择的 benchmark: $(basename $BENCH_FILE)"
cp "$BENCH_FILE" ./bench.c
jotaiPrepareBenchmark ./bench.c
if [ ! -f ./bench.c ]; then
rlFail "bench.c 创建失败"
fi
rlPhaseEnd
@@ -31,11 +24,11 @@ rlJournalStart
if [ ! -f ./bench.c ]; then
rlFail "bench.c 不存在,跳过测试"
else
local outputs=()
outputs=()
for opt in O0 O1 O2 O3; do
local bin="bench_clang_$opt"
local out="output_clang_$opt.txt"
bin="bench_clang_$opt"
out="output_clang_$opt.txt"
rlRun "clang -$opt bench.c -o $bin -lm 2>&1" 0 "Clang -$opt 编译"
@@ -81,8 +74,8 @@ rlJournalStart
# 验证 Clang 内部各优化级别一致性
if [ ${#outputs[@]} -ge 2 ]; then
local first="${outputs[0]}"
local all_match=1
first="${outputs[0]}"
all_match=1
for ((i=1; i<${#outputs[@]}; i++)); do
if [ "${outputs[$i]}" != "$first" ]; then
all_match=0
@@ -46,7 +46,7 @@ CEOF
rlPhaseStartTest "GCC 浮点"
for mode in "no-fast-math" "ffast-math"; do
local flag=""; [ "$mode" == "ffast-math" ] && flag="-ffast-math"
flag=""; [ "$mode" == "ffast-math" ] && flag="-ffast-math"
rlRun "gcc $flag -o fp_gcc_${mode} fp.c -lm && ./fp_gcc_${mode} >/tmp/fp_gcc_${mode}.txt 2>&1" 0 "GCC $mode"
grep -q "FP_OK" /tmp/fp_gcc_${mode}.txt && rlPass "GCC $mode OK"
grep -q "sin_pi_ok" /tmp/fp_gcc_${mode}.txt && rlPass "GCC $mode: sin(pi)≈0"
@@ -14,17 +14,9 @@ rlJournalStart
TmpDir=$(mktemp -d)
rlRun "cd $TmpDir" 0 "进入临时目录"
# 选择一个 benchmark 文件(优先选小的,编译快)
BENCH_FILE=$(find "$BENCH_DIR" -name '*.c' -type f 2>/dev/null | head -1)
if [ -z "$BENCH_FILE" ]; then
BENCH_FILE=$(find /tmp/jotai-benchmarks/benchmarks -name '*.c' -type f 2>/dev/null | head -1)
fi
if [ -z "$BENCH_FILE" ]; then
rlFail "未找到可用的 benchmark 文件"
else
rlLogInfo "选择的 benchmark: $(basename $BENCH_FILE)"
cp "$BENCH_FILE" ./bench.c
jotaiPrepareBenchmark ./bench.c
if [ ! -f ./bench.c ]; then
rlFail "bench.c 创建失败"
fi
rlPhaseEnd
@@ -32,12 +24,12 @@ rlJournalStart
if [ ! -f ./bench.c ]; then
rlFail "bench.c 不存在,跳过测试"
else
local outputs=()
local exit_codes=()
outputs=()
exit_codes=()
for opt in O0 O1 O2 O3; do
local bin="bench_gcc_$opt"
local out="output_gcc_$opt.txt"
bin="bench_gcc_$opt"
out="output_gcc_$opt.txt"
# 编译
rlRun "gcc -std=c99 -$opt bench.c -o $bin -lm 2>&1" 0 "GCC -$opt 编译"
@@ -62,8 +54,8 @@ rlJournalStart
# 验证所有优化级别输出一致
if [ ${#outputs[@]} -ge 2 ]; then
local first="${outputs[0]}"
local all_match=1
first="${outputs[0]}"
all_match=1
for ((i=1; i<${#outputs[@]}; i++)); do
if [ "${outputs[$i]}" != "$first" ]; then
all_match=0
@@ -28,7 +28,6 @@ rlJournalStart
rlRun "find /tmp/jotai-benchmarks/benchmarks -name '*.c' -type f | head -20" 0 "列出前 20 个 C benchmark 文件"
# 验证有至少一个 C 文件
local count
count=$(find /tmp/jotai-benchmarks/benchmarks -name '*.c' -type f 2>/dev/null | wc -l)
if [ "$count" -gt 0 ]; then
rlPass "仓库包含 $count 个 C benchmark 文件"
@@ -38,7 +37,6 @@ rlJournalStart
# 检查 anghaLeaves 目录
if [ -d "$BENCH_DIR" ]; then
local angha_count
angha_count=$(find "$BENCH_DIR" -name '*.c' -type f 2>/dev/null | wc -l)
rlPass "anghaLeaves 目录包含 $angha_count 个 benchmark 文件"
fi
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_async_handler
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_gtod_latency
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_hrtimer_prio
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_matrix_mult
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_measurement
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_periodic_cpu_load
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_pi_perf
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_pi_tests
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_prio_preempt
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_prio_wake
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_pthread_kill_latency
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_rt_migrate
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_sched_football
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_sched_jitter
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_sched_latency
require:
- ltp
- hostname
- beakerlib
@@ -10,4 +10,5 @@ tier: 1
path: /tests/functional/kernel/realtime/test_realtime_thread_clock
require:
- ltp
- hostname
- beakerlib
View File
@@ -11,10 +11,14 @@ rlJournalStart
vimSetup
TmpDir=$(mktemp -d)
rlRun "cd $TmpDir" 0 "进入临时测试目录"
echo "hello world" > file1.txt
echo "hello ruyi" > file2.txt
rlAssertExists "file1.txt"
rlAssertExists "file2.txt"
rlPhaseEnd
rlPhaseStartTest "Vimdiff"
rlRun "vimdiff -c \"q\" file1.txt file2.txt 2>&1 || true" 0 "vimdiff: compare files"
rlRun "vimdiff -c 'qa!' file1.txt file2.txt 2>&1" 0 "vimdiff: compare files"
rlPhaseEnd