aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/size
diff options
context:
space:
mode:
authorTim Bird <tbird20d@gmail.com>2017-06-14 15:28:02 -0700
committerShuah Khan <shuahkh@osg.samsung.com>2017-06-14 18:23:27 -0600
commit48e42f91c10482992b474cc0874c0e33d76cb509 (patch)
tree149272d0c6147b417db7d4cb7b41010df7c3ea04 /tools/testing/selftests/size
parentkselftest: breakpoints: convert step_after_suspend_test to TAP13 output (diff)
downloadlinux-dev-48e42f91c10482992b474cc0874c0e33d76cb509.tar.xz
linux-dev-48e42f91c10482992b474cc0874c0e33d76cb509.zip
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>
Diffstat (limited to 'tools/testing/selftests/size')
-rw-r--r--tools/testing/selftests/size/get_size.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/tools/testing/selftests/size/get_size.c b/tools/testing/selftests/size/get_size.c
index 2d1af7cca463..d4b59ab979a0 100644
--- a/tools/testing/selftests/size/get_size.c
+++ b/tools/testing/selftests/size/get_size.c
@@ -75,26 +75,31 @@ void _start(void)
int ccode;
struct sysinfo info;
unsigned long used;
+ static const char *test_name = " get runtime memory use\n";
- print("Testing system size.\n");
- print("1..1\n");
+ print("TAP version 13\n");
+ print("# Testing system size.\n");
ccode = sysinfo(&info);
if (ccode < 0) {
- print("not ok 1 get runtime memory use\n");
- print("# could not get sysinfo\n");
+ print("not ok 1");
+ print(test_name);
+ print(" ---\n reason: \"could not get sysinfo\"\n ...\n");
_exit(ccode);
}
+ print("ok 1");
+ print(test_name);
+
/* ignore cache complexities for now */
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_k_value("# Total: ", info.totalram, info.mem_unit);
- print_k_value("# Free: ", info.freeram, info.mem_unit);
- print_k_value("# Buffer: ", info.bufferram, info.mem_unit);
- print_k_value("# In use: ", used, info.mem_unit);
+ print(" ---\n");
+ print_k_value(" Total: ", info.totalram, info.mem_unit);
+ print_k_value(" Free: ", info.freeram, 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);
}