resolv: Add beginnings of a libresolv test suite
[platform/upstream/glibc.git] / support / Makefile
1 # Makefile for support library, used only at build and test time
2 # Copyright (C) 2016 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
4
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, see
17 # <http://www.gnu.org/licenses/>.
18
19 subdir := support
20
21 include ../Makeconfig
22
23 extra-libs := libsupport
24 extra-libs-others = $(extra-libs)
25 extra-libs-noinstall := $(extra-libs)
26
27 libsupport-routines = \
28   check \
29   check_addrinfo \
30   check_dns_packet \
31   check_hostent \
32   check_netent \
33   delayed_exit \
34   ignore_stderr \
35   oom_error \
36   resolv_test \
37   set_fortify_handler \
38   support_become_root \
39   support_enter_network_namespace \
40   support_format_address_family \
41   support_format_addrinfo \
42   support_format_dns_packet \
43   support_format_herrno \
44   support_format_hostent \
45   support_format_netent \
46   support_record_failure \
47   support_run_diff \
48   support_test_main \
49   support_test_verify_impl \
50   temp_file \
51   write_message \
52   xaccept \
53   xasprintf \
54   xbind \
55   xcalloc \
56   xconnect \
57   xfclose \
58   xfopen \
59   xfork \
60   xgetsockname \
61   xlisten \
62   xmalloc \
63   xmemstream \
64   xpoll \
65   xpthread_barrier_destroy \
66   xpthread_barrier_init \
67   xpthread_barrier_wait \
68   xpthread_cancel \
69   xpthread_check_return \
70   xpthread_cond_wait \
71   xpthread_create \
72   xpthread_detach \
73   xpthread_join \
74   xpthread_mutex_lock \
75   xpthread_mutex_unlock \
76   xpthread_once \
77   xpthread_sigmask \
78   xpthread_spin_lock \
79   xpthread_spin_unlock \
80   xrealloc \
81   xrecvfrom \
82   xsendto \
83   xsetsockopt \
84   xsocket \
85   xstrdup \
86   xwaitpid \
87   xwrite \
88
89 libsupport-static-only-routines := $(libsupport-routines)
90 # Only build one variant of the library.
91 libsupport-inhibit-o := .os
92 ifeq ($(build-shared),yes)
93 libsupport-inhibit-o += .o
94 endif
95
96 tests = \
97   README-testing \
98   tst-support-namespace \
99   tst-support_record_failure \
100
101 ifeq ($(run-built-tests),yes)
102 tests-special = \
103   $(objpfx)tst-support_record_failure-2.out
104
105 $(objpfx)tst-support_record_failure-2.out: tst-support_record_failure-2.sh \
106   $(objpfx)tst-support_record_failure
107         $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
108           '$(run-program-env)' '$(test-program-prefix-after-env)' \
109           > $@; \
110         $(evaluate-test)
111 endif
112
113 include ../Rules