File: testinternalheaders.sh

package info (click to toggle)
icu 78.2-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 123,988 kB
  • sloc: cpp: 527,891; ansic: 112,789; sh: 4,983; makefile: 4,657; perl: 3,199; python: 2,933; xml: 749; sed: 36; lisp: 12
file content (137 lines) | stat: -rwxr-xr-x 4,233 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Copyright (C) 2016 International Business Machines Corporation
# and others. All rights reserved.
#
# Run this script from $ICU_ROOT/src/source/
# ~/svn.icu/trunk/src/source$  test/hdrtst/testinternalheaders.sh

CC=clang
CXX=clang++

ERROR_EXIT=0

# Runtime libraries

for file in `ls common/*.h`; do
    echo $file
    echo '#include "'$file'"' > ht_temp.cpp ;
    echo 'void noop() {}' >> ht_temp.cpp ;
    $CXX -c -std=c++17 -I common -DU_COMMON_IMPLEMENTATION -O0 ht_temp.cpp ;
    if [ $? != 0 ] ; then
        ERROR_EXIT=1
    fi
done ;

for file in `ls i18n/*.h`; do
    echo $file
    echo '#include "'$file'"' > ht_temp.cpp ;
    echo 'void noop() {}' >> ht_temp.cpp ;
    $CXX -c -std=c++17 -I common -I i18n -DU_I18N_IMPLEMENTATION -O0 ht_temp.cpp ;
    if [ $? != 0 ] ; then
        ERROR_EXIT=1
    fi
done ;

for file in `ls io/*.h`; do
    echo $file
    echo '#include "'$file'"' > ht_temp.cpp ;
    echo 'void noop() {}' >> ht_temp.cpp ;
    $CXX -c -std=c++17 -I common -I i18n -I io -DU_IO_IMPLEMENTATION -O0 ht_temp.cpp ;
    if [ $? != 0 ] ; then
        ERROR_EXIT=1
    fi
done ;

# layout is removed.

# layoutex now depends on external additions such as HarfBuzz, skip here

# -I .  for includes of layout/*.h
#for file in `ls layoutex/*.h`; do
#    echo $file
#    echo '#include "'$file'"' > ht_temp.cpp ;
#    echo 'void noop() {}' >> ht_temp.cpp ;
#    $CXX -c -I common -I i18n -I io -I layout -I . -I layoutex -O0 ht_temp.cpp ;
#done ;

# Tools

for file in `ls tools/toolutil/*.h`; do
    echo $file
    echo '#include "'$file'"' > ht_temp.cpp ;
    echo 'void noop() {}' >> ht_temp.cpp ;
    $CXX -c -std=c++17 -I common -I i18n -I io -I tools/toolutil -O0 ht_temp.cpp ;
    if [ $? != 0 ] ; then
        ERROR_EXIT=1
    fi
done ;

# Exclude tzcode: tools/tzcode/private.h uses an argument "new" in a function declaration.
# Markus sent an email to the tz list on 20160307 requesting that it be renamed.
# We don't want to patch it, and don't want to spend the time for this script here
# to know about C-only header files.

for tool in escapesrc genccode gencmn gencolusb gennorm2 genren gentest icupkg icuswap \
        pkgdata genbrk gencfu gencnval gendict genrb gensprep icuinfo makeconv memcheck; do
    for file in `ls tools/$tool/*.h`; do
        echo $file
        echo '#include "'$file'"' > ht_temp.cpp ;
        echo 'void noop() {}' >> ht_temp.cpp ;
        $CXX -c -std=c++17 -I common -I i18n -I io -I tools/toolutil -I tools/$tool -O0 ht_temp.cpp ;
        if [ $? != 0 ] ; then
            ERROR_EXIT=1
        fi
    done ;
done ;

# Tests

for file in `ls tools/ctestfw/unicode/*.h`; do
    echo $file
    echo '#include "'$file'"' > ht_temp.cpp ;
    echo 'void noop() {}' >> ht_temp.cpp ;
    $CXX -c -std=c++17 -I common -I i18n -I io -I tools/toolutil -I tools/ctestfw -O0 ht_temp.cpp ;
    if [ $? != 0 ] ; then
        ERROR_EXIT=1
    fi
done ;

# C not C++ for cintltst
for file in `ls test/cintltst/*.h`; do
    echo $file
    echo '#include "'$file'"' > ht_temp.c ;
    echo 'void noop() {}' >> ht_temp.c ;
    $CC -c -std=c11 -I common -I i18n -I io -I tools/toolutil -I tools/ctestfw -I test/cintltst -O0 ht_temp.c ;
    if [ $? != 0 ] ; then
        ERROR_EXIT=1
    fi
done ;

for test in intltest iotest testmap thaitest fuzzer; do
    for file in `ls test/$test/*.h`; do
        echo $file
        echo '#include "'$file'"' > ht_temp.cpp ;
        echo 'void noop() {}' >> ht_temp.cpp ;
        $CXX -c -std=c++17 -I common -I i18n -I io -I tools/toolutil -I tools/ctestfw -I test/$test -O0 ht_temp.cpp ;
        if [ $? != 0 ] ; then
            ERROR_EXIT=1
        fi
    done ;
done ;

# layoutex now depends on external additions such as HarfBuzz, skip here

#for file in `ls test/letest/*.h`; do
#    echo $file
#    echo '#include "'$file'"' > ht_temp.cpp ;
#    echo 'void noop() {}' >> ht_temp.cpp ;
#    $CXX -c -I common -I i18n -I io -I layout -I . -I layoutex -I tools/toolutil -I tools/ctestfw -I test/letest -O0 ht_temp.cpp ;
#done ;

# TODO: perf/*/*.h

rm ht_temp.cpp ht_temp.c ht_temp.o

echo $ERROR_EXIT
exit $ERROR_EXIT