提交 48e42f91 编写于 作者: T Tim Bird 提交者: Shuah Khan

kselftest: convert get_size to use stricter TAP13 format

1. Add the TAP13 header
2. remove variable data from the test description line
3. move the plan count to the end of the file, for consistency with
other kselftests
4. convert memory data from diagnostic (comment) format, to a YAML block
Signed-off-by: NTim Bird <tim.bird@sony.com>
Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
上级 b9012164
...@@ -75,26 +75,31 @@ void _start(void) ...@@ -75,26 +75,31 @@ void _start(void)
int ccode; int ccode;
struct sysinfo info; struct sysinfo info;
unsigned long used; unsigned long used;
static const char *test_name = " get runtime memory use\n";
print("Testing system size.\n"); print("TAP version 13\n");
print("1..1\n"); print("# Testing system size.\n");
ccode = sysinfo(&info); ccode = sysinfo(&info);
if (ccode < 0) { if (ccode < 0) {
print("not ok 1 get runtime memory use\n"); print("not ok 1");
print("# could not get sysinfo\n"); print(test_name);
print(" ---\n reason: \"could not get sysinfo\"\n ...\n");
_exit(ccode); _exit(ccode);
} }
print("ok 1");
print(test_name);
/* ignore cache complexities for now */ /* ignore cache complexities for now */
used = info.totalram - info.freeram - info.bufferram; used = info.totalram - info.freeram - info.bufferram;
print_k_value("ok 1 get runtime memory use # size = ", used,
info.mem_unit);
print("# System runtime memory report (units in Kilobytes):\n"); print("# System runtime memory report (units in Kilobytes):\n");
print_k_value("# Total: ", info.totalram, info.mem_unit); print(" ---\n");
print_k_value("# Free: ", info.freeram, info.mem_unit); print_k_value(" Total: ", info.totalram, info.mem_unit);
print_k_value("# Buffer: ", info.bufferram, info.mem_unit); print_k_value(" Free: ", info.freeram, info.mem_unit);
print_k_value("# In use: ", used, info.mem_unit); print_k_value(" Buffer: ", info.bufferram, info.mem_unit);
print_k_value(" In use: ", used, info.mem_unit);
print(" ...\n");
print("1..1\n");
_exit(0); _exit(0);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册