Lines Matching full:test

11 /* Constants for test step bitmap */
70 * Set up a test.
72 * @test the test to be executed
76 static int setup(struct efi_unit_test *test, unsigned int *failures) in setup() argument
80 if (!test->setup) in setup()
82 efi_st_printc(EFI_LIGHTBLUE, "\nSetting up '%s'\n", test->name); in setup()
83 ret = test->setup(handle, systable); in setup()
85 efi_st_error("Setting up '%s' failed\n", test->name); in setup()
89 "Setting up '%s' succeeded\n", test->name); in setup()
95 * Execute a test.
97 * @test the test to be executed
101 static int execute(struct efi_unit_test *test, unsigned int *failures) in execute() argument
105 if (!test->execute) in execute()
107 efi_st_printc(EFI_LIGHTBLUE, "\nExecuting '%s'\n", test->name); in execute()
108 ret = test->execute(); in execute()
110 efi_st_error("Executing '%s' failed\n", test->name); in execute()
114 "Executing '%s' succeeded\n", test->name); in execute()
120 * Tear down a test.
122 * @test the test to be torn down
126 static int teardown(struct efi_unit_test *test, unsigned int *failures) in teardown() argument
130 if (!test->teardown) in teardown()
132 efi_st_printc(EFI_LIGHTBLUE, "\nTearing down '%s'\n", test->name); in teardown()
133 ret = test->teardown(); in teardown()
135 efi_st_error("Tearing down '%s' failed\n", test->name); in teardown()
139 "Tearing down '%s' succeeded\n", test->name); in teardown()
145 * Check that a test exists.
147 * @testname: name of the test
148 * @return: test, or NULL if not found
152 struct efi_unit_test *test; in find_test() local
154 for (test = ll_entry_start(struct efi_unit_test, efi_unit_test); in find_test()
155 test < ll_entry_end(struct efi_unit_test, efi_unit_test); ++test) { in find_test()
156 if (!efi_st_strcmp_16_8(testname, test->name)) in find_test()
157 return test; in find_test()
168 struct efi_unit_test *test; in list_all_tests() local
172 for (test = ll_entry_start(struct efi_unit_test, efi_unit_test); in list_all_tests()
173 test < ll_entry_end(struct efi_unit_test, efi_unit_test); ++test) { in list_all_tests()
174 efi_st_printf("'%s'%s\n", test->name, in list_all_tests()
175 test->on_request ? " - on request" : ""); in list_all_tests()
180 * Execute test steps of one phase.
182 * @testname name of a single selected test or NULL
183 * @phase test phase
185 * failures returns EFI_ST_SUCCESS if all test steps succeeded
191 struct efi_unit_test *test; in efi_st_do_tests() local
193 for (test = ll_entry_start(struct efi_unit_test, efi_unit_test); in efi_st_do_tests()
194 test < ll_entry_end(struct efi_unit_test, efi_unit_test); in efi_st_do_tests()
195 ++test, ++i) { in efi_st_do_tests()
197 efi_st_strcmp_16_8(testname, test->name) : test->on_request) in efi_st_do_tests()
199 if (test->phase != phase) in efi_st_do_tests()
202 setup_status[i] = setup(test, failures); in efi_st_do_tests()
204 execute(test, failures); in efi_st_do_tests()
206 teardown(test, failures); in efi_st_do_tests()
218 * A test may be setup and executed at boottime,
271 efi_st_printc(EFI_WHITE, "\nSelected test: '%ps'\n", testname); in efi_selftest()