test(simple): 重构测试文件结构并添加新的测试用例

将原有的测试文件移动到专门的返回值测试目录(return_val_cases)中,
同时添加了标准输出测试目录(stdout_val_cases),新增了参数传递测试用例
和标准输出测试用例,使测试结构更加清晰和模块化。
This commit is contained in:
zzy
2026-04-13 11:40:23 +08:00
parent ffb23afaf4
commit 8054f20375
22 changed files with 33 additions and 22 deletions

View File

@@ -2,20 +2,22 @@
# windows powershell: echo $LASTEXITCODE # windows powershell: echo $LASTEXITCODE
# nushell: echo $env.LAST_EXIT_CODE # nushell: echo $env.LAST_EXIT_CODE
# bash: echo $? # bash: echo $?
"./01_return.c" = 65536 "./return_val_cases/01_return.c" = 65536
"./02_decl_expr.c" = 1 "./return_val_cases/02_decl_expr.c" = 1
"./03_decl_init.c" = 11 "./return_val_cases/03_decl_init.c" = 11
"./04_if.c" = 1 "./return_val_cases/04_if.c" = 1
"./05_else.c" = 2 "./return_val_cases/05_else.c" = 2
"./06_fcall.c" = 3 "./return_val_cases/06_fcall.c" = 3
"./07_while.c" = 10 "./return_val_cases/07_while.c" = 10
"./08_do_while.c" = 128 "./return_val_cases/08_do_while.c" = 128
"./09_for.c" = 10 "./return_val_cases/09_for.c" = 10
"./10_main.c" = 3 "./return_val_cases/10_main.c" = 3
"./11_recursive.c" = 120 "./return_val_cases/11_recursive.c" = 120
"./12_logic.c" = 10 "./return_val_cases/12_logic.c" = 10
"./13_array.c" = 1198 "./return_val_cases/13_array.c" = 1198
"./14_pointer.c" = 2 "./return_val_cases/14_pointer.c" = 2
"./15_array_subscript.c" = 1198 "./return_val_cases/15_array_subscript.c" = 1198
"./16_enum.c" = 5 "./return_val_cases/16_enum.c" = 5
"./return_val_cases/17_more_arg.c" = 45
[stdout_val_cases] [stdout_val_cases]
"./stdout_val_cases/01_include.c" = "Hello World!\n"

View File

@@ -1,6 +0,0 @@
int main() {
int a, b;
a = 1;
b = 2;
return a + b;
}

View File

@@ -0,0 +1,9 @@
int add(int a, int b, int c, int d, int e, int f, int g, int h, int i) {
return a + b + c + d + e + f + g + h + i;
}
int main(void) {
int result = add(1, 2, 3, 4, 5, 6, 7, 8, 9);
return result;
}

View File

@@ -0,0 +1,6 @@
#include "stdio.h"
int main(void) {
puts("hello world");
return 0;
}