source: rtems/testsuites/libtests/dl06/init.c @ 86e79d7

Last change on this file since 86e79d7 was 86e79d7, checked in by Chris Johns <chrisj@…>, on Apr 12, 2018 at 4:52:36 AM

testsuites/dl06: Add a test for RAP format.

This test loads a RAP format file that contains calls that are not
in the kernel and linked from libm. It uses and test rtems-ld.

Update #2769

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>.  All rights reserved.
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9#ifdef HAVE_CONFIG_H
10  #include "config.h"
11#endif
12
13#include "tmacros.h"
14
15#include <errno.h>
16#include <string.h>
17#include <stdint.h>
18#include <unistd.h>
19
20#include <rtems/rtl/rtl.h>
21#include <rtems/untar.h>
22
23#include "dl-load.h"
24
25const char rtems_test_name[] = "libdl (RTL) 6";
26
27/* forward declarations to avoid warnings */
28static rtems_task Init(rtems_task_argument argument);
29
30#if DL06_PRE
31#include "dl06-pre-tar.h"
32#else
33#include "dl06-tar.h"
34#endif
35
36#define TARFILE_START dl06_tar
37#define TARFILE_SIZE  dl06_tar_size
38
39static int test(void)
40{
41  int ret;
42  ret = dl_load_test();
43  if (ret)
44    rtems_test_exit(ret);
45  return 0;
46}
47
48static void Init(rtems_task_argument arg)
49{
50  int te;
51
52  TEST_BEGIN();
53
54  te = Untar_FromMemory((void *)TARFILE_START, (size_t)TARFILE_SIZE);
55  if (te != 0)
56  {
57    printf("untar failed: %d\n", te);
58    rtems_test_exit(1);
59    exit (1);
60  }
61
62  test();
63
64  TEST_END();
65
66  rtems_test_exit(0);
67}
68
69#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
70#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
71
72#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
73
74#define CONFIGURE_MAXIMUM_TASKS 1
75
76#define CONFIGURE_MINIMUM_TASK_STACK_SIZE (8U * 1024U)
77
78#define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024)
79
80#define CONFIGURE_MAXIMUM_SEMAPHORES 1
81
82#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
83
84#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
85#define CONFIGURE_INIT_TASK_ATTRIBUTES   (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
86
87#define CONFIGURE_INIT
88
89#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.