forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'linux-kselftest-3.19-rc1' of git://git.kernel.org/pub/scm/…
…linux/kernel/git/shuah/linux-kselftest Pull kselftest update from Shuah Khan: "kselftest updates for 3.19-rc1: - kcmp test include file cleanup - kcmp change to build on all architectures - A light weight kselftest framework that provides a set of interfaces for tests to use to report results. In addition, several tests are updated to use the framework. - A new runtime system size test that prints the amount of RAM that the currently running system is using" * tag 'linux-kselftest-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftest: size: Add size test for Linux kernel selftests/kcmp: Always try to build the test selftests/kcmp: Don't include kernel headers kcmp: Move kcmp.h into uapi selftests/timers: change test to use ksft framework selftests/kcmp: change test to use ksft framework selftests/ipc: change test to use ksft framework selftests/breakpoints: change test to use ksft framework selftests: add kselftest framework for uniform test reporting selftests/user: move test out of Makefile into a shell script selftests/net: move test out of Makefile into a shell script
- Loading branch information
Showing
16 changed files
with
252 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* kselftest.h: kselftest framework return codes to include from | ||
* selftests. | ||
* | ||
* Copyright (c) 2014 Shuah Khan <[email protected]> | ||
* Copyright (c) 2014 Samsung Electronics Co., Ltd. | ||
* | ||
* This file is released under the GPLv2. | ||
*/ | ||
#ifndef __KSELFTEST_H | ||
#define __KSELFTEST_H | ||
|
||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
/* counters */ | ||
struct ksft_count { | ||
unsigned int ksft_pass; | ||
unsigned int ksft_fail; | ||
unsigned int ksft_xfail; | ||
unsigned int ksft_xpass; | ||
unsigned int ksft_xskip; | ||
}; | ||
|
||
static struct ksft_count ksft_cnt; | ||
|
||
static inline void ksft_inc_pass_cnt(void) { ksft_cnt.ksft_pass++; } | ||
static inline void ksft_inc_fail_cnt(void) { ksft_cnt.ksft_fail++; } | ||
static inline void ksft_inc_xfail_cnt(void) { ksft_cnt.ksft_xfail++; } | ||
static inline void ksft_inc_xpass_cnt(void) { ksft_cnt.ksft_xpass++; } | ||
static inline void ksft_inc_xskip_cnt(void) { ksft_cnt.ksft_xskip++; } | ||
|
||
static inline void ksft_print_cnts(void) | ||
{ | ||
printf("Pass: %d Fail: %d Xfail: %d Xpass: %d, Xskip: %d\n", | ||
ksft_cnt.ksft_pass, ksft_cnt.ksft_fail, | ||
ksft_cnt.ksft_xfail, ksft_cnt.ksft_xpass, | ||
ksft_cnt.ksft_xskip); | ||
} | ||
|
||
static inline int ksft_exit_pass(void) | ||
{ | ||
exit(0); | ||
} | ||
static inline int ksft_exit_fail(void) | ||
{ | ||
exit(1); | ||
} | ||
static inline int ksft_exit_xfail(void) | ||
{ | ||
exit(2); | ||
} | ||
static inline int ksft_exit_xpass(void) | ||
{ | ||
exit(3); | ||
} | ||
static inline int ksft_exit_skip(void) | ||
{ | ||
exit(4); | ||
} | ||
|
||
#endif /* __KSELFTEST_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
# Runs bpf test using test_bpf kernel module | ||
|
||
if /sbin/modprobe -q test_bpf ; then | ||
/sbin/modprobe -q -r test_bpf; | ||
echo "test_bpf: ok"; | ||
else | ||
echo "test_bpf: [FAIL]"; | ||
exit 1; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
get_size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CC = $(CROSS_COMPILE)gcc | ||
|
||
all: get_size | ||
|
||
get_size: get_size.c | ||
$(CC) -static -ffreestanding -nostartfiles -s $< -o $@ | ||
|
||
run_tests: all | ||
./get_size | ||
|
||
clean: | ||
$(RM) get_size |
Oops, something went wrong.