1# Copyright (C) 2016 and later: Unicode, Inc. and others. 2# License & terms of use: http://www.unicode.org/copyright.html 3# Copyright (C) 2016 International Business Machines Corporation 4# and others. All rights reserved. 5# 6# Run this script from $ICU_ROOT/src/source/ 7# ~/svn.icu/trunk/src/source$ test/hdrtst/testinternalheaders.sh 8 9CC=clang 10CXX=clang++ 11 12ERROR_EXIT=0 13 14# Runtime libraries 15 16for file in `ls common/*.h`; do 17 echo $file 18 echo '#include "'$file'"' > ht_temp.cpp ; 19 echo 'void noop() {}' >> ht_temp.cpp ; 20 $CXX -c -std=c++11 -I common -DU_COMMON_IMPLEMENTATION -O0 ht_temp.cpp ; 21 if [ $? != 0 ] ; then 22 ERROR_EXIT=1 23 fi 24done ; 25 26for file in `ls i18n/*.h`; do 27 echo $file 28 echo '#include "'$file'"' > ht_temp.cpp ; 29 echo 'void noop() {}' >> ht_temp.cpp ; 30 $CXX -c -std=c++11 -I common -I i18n -DU_I18N_IMPLEMENTATION -O0 ht_temp.cpp ; 31 if [ $? != 0 ] ; then 32 ERROR_EXIT=1 33 fi 34done ; 35 36for file in `ls io/*.h`; do 37 echo $file 38 echo '#include "'$file'"' > ht_temp.cpp ; 39 echo 'void noop() {}' >> ht_temp.cpp ; 40 $CXX -c -std=c++11 -I common -I i18n -I io -DU_IO_IMPLEMENTATION -O0 ht_temp.cpp ; 41 if [ $? != 0 ] ; then 42 ERROR_EXIT=1 43 fi 44done ; 45 46# layout is removed. 47 48# layoutex now depends on external additions such as HarfBuzz, skip here 49 50# -I . for includes of layout/*.h 51#for file in `ls layoutex/*.h`; do 52# echo $file 53# echo '#include "'$file'"' > ht_temp.cpp ; 54# echo 'void noop() {}' >> ht_temp.cpp ; 55# $CXX -c -I common -I i18n -I io -I layout -I . -I layoutex -O0 ht_temp.cpp ; 56#done ; 57 58# Tools 59 60for file in `ls tools/toolutil/*.h`; do 61 echo $file 62 echo '#include "'$file'"' > ht_temp.cpp ; 63 echo 'void noop() {}' >> ht_temp.cpp ; 64 $CXX -c -std=c++11 -I common -I i18n -I io -I tools/toolutil -O0 ht_temp.cpp ; 65 if [ $? != 0 ] ; then 66 ERROR_EXIT=1 67 fi 68done ; 69 70# Exclude tzcode: tools/tzcode/private.h uses an argument "new" in a function declaration. 71# Markus sent an email to the tz list on 20160307 requesting that it be renamed. 72# We don't want to patch it, and don't want to spend the time for this script here 73# to know about C-only header files. 74 75for tool in escapesrc genccode gencmn gencolusb gennorm2 genren gentest icupkg icuswap \ 76 pkgdata genbrk gencfu gencnval gendict genrb gensprep icuinfo makeconv memcheck; do 77 for file in `ls tools/$tool/*.h`; do 78 echo $file 79 echo '#include "'$file'"' > ht_temp.cpp ; 80 echo 'void noop() {}' >> ht_temp.cpp ; 81 $CXX -c -std=c++11 -I common -I i18n -I io -I tools/toolutil -I tools/$tool -O0 ht_temp.cpp ; 82 if [ $? != 0 ] ; then 83 ERROR_EXIT=1 84 fi 85 done ; 86done ; 87 88# Tests 89 90for file in `ls tools/ctestfw/unicode/*.h`; do 91 echo $file 92 echo '#include "'$file'"' > ht_temp.cpp ; 93 echo 'void noop() {}' >> ht_temp.cpp ; 94 $CXX -c -std=c++11 -I common -I i18n -I io -I tools/toolutil -I tools/ctestfw -O0 ht_temp.cpp ; 95 if [ $? != 0 ] ; then 96 ERROR_EXIT=1 97 fi 98done ; 99 100# C not C++ for cintltst 101for file in `ls test/cintltst/*.h`; do 102 echo $file 103 echo '#include "'$file'"' > ht_temp.c ; 104 echo 'void noop() {}' >> ht_temp.c ; 105 $CC -c -std=c11 -I common -I i18n -I io -I tools/toolutil -I tools/ctestfw -I test/cintltst -O0 ht_temp.c ; 106 if [ $? != 0 ] ; then 107 ERROR_EXIT=1 108 fi 109done ; 110 111for test in intltest iotest testmap thaitest fuzzer; do 112 for file in `ls test/$test/*.h`; do 113 echo $file 114 echo '#include "'$file'"' > ht_temp.cpp ; 115 echo 'void noop() {}' >> ht_temp.cpp ; 116 $CXX -c -std=c++11 -I common -I i18n -I io -I tools/toolutil -I tools/ctestfw -I test/$test -O0 ht_temp.cpp ; 117 if [ $? != 0 ] ; then 118 ERROR_EXIT=1 119 fi 120 done ; 121done ; 122 123# layoutex now depends on external additions such as HarfBuzz, skip here 124 125#for file in `ls test/letest/*.h`; do 126# echo $file 127# echo '#include "'$file'"' > ht_temp.cpp ; 128# echo 'void noop() {}' >> ht_temp.cpp ; 129# $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 ; 130#done ; 131 132# TODO: perf/*/*.h 133 134rm ht_temp.cpp ht_temp.c ht_temp.o 135 136echo $ERROR_EXIT 137exit $ERROR_EXIT 138