tools/testing/selftests/kvm/include/kvm_test_harness.h

Source file repositories/reference/linux-study-clean/tools/testing/selftests/kvm/include/kvm_test_harness.h

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/kvm/include/kvm_test_harness.h
Extension
.h
Size
891 bytes
Lines
37
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef SELFTEST_KVM_TEST_HARNESS_H
#define SELFTEST_KVM_TEST_HARNESS_H

#include "kselftest_harness.h"

#define KVM_ONE_VCPU_TEST_SUITE(name)					\
	FIXTURE(name) {							\
		struct kvm_vcpu *vcpu;					\
	};								\
									\
	FIXTURE_SETUP(name) {						\
		(void)vm_create_with_one_vcpu(&self->vcpu, NULL);	\
	}								\
									\
	FIXTURE_TEARDOWN(name) {					\
		kvm_vm_free(self->vcpu->vm);				\
	}

#define KVM_ONE_VCPU_TEST(suite, test, guestcode)			\
static void __suite##_##test(struct kvm_vcpu *vcpu);			\
									\
TEST_F(suite, test)							\
{									\
	vcpu_arch_set_entry_point(self->vcpu, guestcode);		\
	__suite##_##test(self->vcpu);					\
}									\
static void __suite##_##test(struct kvm_vcpu *vcpu)

#endif /* SELFTEST_KVM_TEST_HARNESS_H */

Annotation

Implementation Notes