Skip to content

Commit 48e42f9

Browse files
tbird20dShuah Khan
authored andcommitted
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: Tim Bird <tim.bird@sony.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
1 parent b901216 commit 48e42f9

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

‎tools/testing/selftests/size/get_size.c‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,31 @@ void _start(void)
7575
int ccode;
7676
struct sysinfo info;
7777
unsigned long used;
78+
static const char *test_name = " get runtime memory use\n";
7879

79-
print("Testing system size.\n");
80-
print("1..1\n");
80+
print("TAP version 13\n");
81+
print("# Testing system size.\n");
8182

8283
ccode = sysinfo(&info);
8384
if (ccode < 0) {
84-
print("not ok 1 get runtime memory use\n");
85-
print("# could not get sysinfo\n");
85+
print("not ok 1");
86+
print(test_name);
87+
print(" ---\n reason: \"could not get sysinfo\"\n ...\n");
8688
_exit(ccode);
8789
}
90+
print("ok 1");
91+
print(test_name);
92+
8893
/* ignore cache complexities for now */
8994
used = info.totalram - info.freeram - info.bufferram;
90-
print_k_value("ok 1 get runtime memory use # size = ", used,
91-
info.mem_unit);
92-
9395
print("# System runtime memory report (units in Kilobytes):\n");
94-
print_k_value("# Total: ", info.totalram, info.mem_unit);
95-
print_k_value("# Free: ", info.freeram, info.mem_unit);
96-
print_k_value("# Buffer: ", info.bufferram, info.mem_unit);
97-
print_k_value("# In use: ", used, info.mem_unit);
96+
print(" ---\n");
97+
print_k_value(" Total: ", info.totalram, info.mem_unit);
98+
print_k_value(" Free: ", info.freeram, info.mem_unit);
99+
print_k_value(" Buffer: ", info.bufferram, info.mem_unit);
100+
print_k_value(" In use: ", used, info.mem_unit);
101+
print(" ...\n");
102+
print("1..1\n");
98103

99104
_exit(0);
100105
}

0 commit comments

Comments
 (0)