-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kconfig: merge kconfig tests into single testdata file
The Go counterparts of these tests were overly-specific, checking if each individual value was set correctly. This arguably tests at the wrong level of abstraction. The data source of the values needs to be tested individually, with the C code simply checking if a non-zero value was populated. Signed-off-by: Timo Beckers <[email protected]>
- Loading branch information
Showing
8 changed files
with
26 additions
and
115 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
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,14 +1,31 @@ | ||
#include "common.h" | ||
|
||
char __license[] __section("license") = "MIT"; | ||
char __license[] __section("license") = "GPL-2.0"; | ||
|
||
/* Special cases requiring feature testing or vDSO magic. */ | ||
extern int LINUX_KERNEL_VERSION __kconfig; | ||
extern _Bool LINUX_HAS_SYSCALL_WRAPPER __kconfig; | ||
|
||
__section("socket") int kernel_version() { | ||
return LINUX_KERNEL_VERSION; | ||
} | ||
/* Values pulled from /proc/kconfig. */ | ||
extern int CONFIG_HZ __kconfig; | ||
extern enum libbpf_tristate CONFIG_BPF_SYSCALL __kconfig; | ||
extern char CONFIG_DEFAULT_HOSTNAME[1] __kconfig; | ||
|
||
__section("socket") int kconfig() { | ||
if (LINUX_KERNEL_VERSION == 0) | ||
return __LINE__; | ||
|
||
if (LINUX_HAS_SYSCALL_WRAPPER == 0) | ||
return __LINE__; | ||
|
||
if (CONFIG_HZ == 0) | ||
return __LINE__; | ||
|
||
if (CONFIG_BPF_SYSCALL == TRI_NO) | ||
return __LINE__; | ||
|
||
if (CONFIG_DEFAULT_HOSTNAME[0] == 0) | ||
return __LINE__; | ||
|
||
__section("socket") int syscall_wrapper() { | ||
return LINUX_HAS_SYSCALL_WRAPPER; | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.