mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
compel/tests: test binary should return error
To check test's result in travis. Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
5e0b4d0060
commit
d6cea81047
@@ -34,12 +34,16 @@ static __maybe_unused void arch_test_set_elf_hdr_machine(Ehdr_t *hdr)
|
||||
|
||||
#endif /* CONFIG_X86_32 */
|
||||
|
||||
extern void run_tests_64(void *mem, const char *msg);
|
||||
extern void run_tests_32(void *mem, const char *msg);
|
||||
extern int run_tests_64(void *mem, const char *msg);
|
||||
extern int run_tests_32(void *mem, const char *msg);
|
||||
|
||||
static __maybe_unused void arch_run_tests(void *mem)
|
||||
static __maybe_unused int arch_run_tests(void *mem)
|
||||
{
|
||||
run_tests_64(mem, "(64-bit ELF)");
|
||||
run_tests_32(mem, "(32-bit ELF)");
|
||||
int ret;
|
||||
|
||||
ret = run_tests_64(mem, "(64-bit ELF)");
|
||||
ret += run_tests_32(mem, "(32-bit ELF)");
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* __ARCH_TEST_HANDLE_BINARY__ */
|
||||
|
@@ -88,11 +88,12 @@ static int test_prepare_elf_header(void *elf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __run_tests(void *mem, const char *msg)
|
||||
int __run_tests(void *mem, const char *msg)
|
||||
{
|
||||
elf_addr = (uintptr_t)mem;
|
||||
test_bitness = msg;
|
||||
|
||||
if (test_prepare_elf_header(mem))
|
||||
return;
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@@ -56,8 +56,9 @@ int launch_test(void *mem, int expected_ret, const char *test_fmt, ...)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
void *elf_buf = malloc(test_elf_buf_size);
|
||||
int ret;
|
||||
|
||||
arch_run_tests(elf_buf);
|
||||
ret = arch_run_tests(elf_buf);
|
||||
free(elf_buf);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user