diff options
author | David 'Digit' Turner <digit@google.com> | 2009-07-10 13:49:19 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-07-10 13:49:19 +0200 |
commit | b381ead492251a797d2df4b260cb01eb1f64cfad (patch) | |
tree | b895b138fe6eacde9797a855a5b1eb53841c32ce | |
parent | 360efc12dcfece46e5999505bd8042cba56a4289 (diff) | |
download | extras-b381ead492251a797d2df4b260cb01eb1f64cfad.tar.gz |
Don't build libstdc++ host tests with the Bionic headers.
This creates conflicts (e.g. <cfloat> includes <sys/limits.h> which is not
always available on the host).
Add missing using ::<function> statements to test_cstdlib.cpp.
Remove obsolete debug trace (LOCAL_MODULE=xxxxx) in Android.mk
-rw-r--r-- | tests/bionic/libstdc++/Android.mk | 14 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_cassert.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_cctype.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_climits.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_cmath.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_csetjmp.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_csignal.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_cstddef.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_cstdint.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_cstdio.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_cstdlib.cpp | 73 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_cstring.cpp | 2 | ||||
-rw-r--r-- | tests/bionic/libstdc++/test_ctime.cpp | 2 |
13 files changed, 92 insertions, 17 deletions
diff --git a/tests/bionic/libstdc++/Android.mk b/tests/bionic/libstdc++/Android.mk index 103b3274..12286622 100644 --- a/tests/bionic/libstdc++/Android.mk +++ b/tests/bionic/libstdc++/Android.mk @@ -31,7 +31,6 @@ define device-test $(eval include $(CLEAR_VARS)) \ $(eval LOCAL_SRC_FILES := $(file)) \ $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \ - $(eval $(info LOCAL_MODULE=$(LOCAL_MODULE))) \ $(eval LOCAL_CFLAGS += $(EXTRA_CFLAGS)) \ $(eval LOCAL_MODULE_TAGS := tests) \ $(eval include $(BUILD_EXECUTABLE)) \ @@ -47,7 +46,6 @@ define host-test $(eval include $(CLEAR_VARS)) \ $(eval LOCAL_SRC_FILES := $(file)) \ $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \ - $(eval $(info LOCAL_MODULE=$(LOCAL_MODULE) file=$(file))) \ $(eval LOCAL_CFLAGS += $(EXTRA_CFLAGS)) \ $(eval LOCAL_LDLIBS += $(EXTRA_LDLIBS)) \ $(eval LOCAL_MODULE_TAGS := tests) \ @@ -65,16 +63,22 @@ sources := \ test_csetjmp.cpp \ test_csignal.cpp \ test_cstddef.cpp \ - test_cstdint.cpp \ test_cstdio.cpp \ test_cstdlib.cpp \ test_cstring.cpp \ test_ctime.cpp -EXTRA_CFLAGS := -I bionic/libstdc++/include $(call host-test, $(sources)) -EXTRA_CFLAGS := -I bionic/libstdc++/include +EXTRA_CFLAGS := -DBIONIC=1 -I bionic/libstdc++/include + +# <cstdint> is not part of the C++ standard yet, and some +# host environments don't provide it unless you use specific +# compiler flags, so only build this test for device/Bionic +# builds at the moment. +# +sources += test_cstdint.cpp + $(call device-test, $(sources)) endif # BIONIC_TESTS diff --git a/tests/bionic/libstdc++/test_cassert.cpp b/tests/bionic/libstdc++/test_cassert.cpp index 67c96deb..fc669a92 100644 --- a/tests/bionic/libstdc++/test_cassert.cpp +++ b/tests/bionic/libstdc++/test_cassert.cpp @@ -28,7 +28,7 @@ #include <cassert> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CASSERT__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CASSERT__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_cctype.cpp b/tests/bionic/libstdc++/test_cctype.cpp index bedb77fb..cc641712 100644 --- a/tests/bionic/libstdc++/test_cctype.cpp +++ b/tests/bionic/libstdc++/test_cctype.cpp @@ -27,7 +27,7 @@ */ #include <cctype> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CCTYPE__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CCTYPE__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_climits.cpp b/tests/bionic/libstdc++/test_climits.cpp index f3ce0232..9fdba56c 100644 --- a/tests/bionic/libstdc++/test_climits.cpp +++ b/tests/bionic/libstdc++/test_climits.cpp @@ -28,7 +28,7 @@ #include <climits> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CLIMITS__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CLIMITS__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_cmath.cpp b/tests/bionic/libstdc++/test_cmath.cpp index 438fb649..847c9340 100644 --- a/tests/bionic/libstdc++/test_cmath.cpp +++ b/tests/bionic/libstdc++/test_cmath.cpp @@ -27,7 +27,7 @@ */ #include <cmath> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CMATH__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CMATH__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_csetjmp.cpp b/tests/bionic/libstdc++/test_csetjmp.cpp index 9b314909..79b23d88 100644 --- a/tests/bionic/libstdc++/test_csetjmp.cpp +++ b/tests/bionic/libstdc++/test_csetjmp.cpp @@ -27,7 +27,7 @@ */ #include <csetjmp> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CSETJMP__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CSETJMP__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_csignal.cpp b/tests/bionic/libstdc++/test_csignal.cpp index 22fa946f..a460e649 100644 --- a/tests/bionic/libstdc++/test_csignal.cpp +++ b/tests/bionic/libstdc++/test_csignal.cpp @@ -27,7 +27,7 @@ */ #include <csignal> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CSIGNAL__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CSIGNAL__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_cstddef.cpp b/tests/bionic/libstdc++/test_cstddef.cpp index 19f9d422..b1e280ff 100644 --- a/tests/bionic/libstdc++/test_cstddef.cpp +++ b/tests/bionic/libstdc++/test_cstddef.cpp @@ -27,7 +27,7 @@ */ #include <cstddef> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CSTDDEF__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CSTDDEF__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_cstdint.cpp b/tests/bionic/libstdc++/test_cstdint.cpp index 8753cf7d..a01164f9 100644 --- a/tests/bionic/libstdc++/test_cstdint.cpp +++ b/tests/bionic/libstdc++/test_cstdint.cpp @@ -27,7 +27,7 @@ */ #include <cstdint> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CSTDINT__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CSTDINT__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_cstdio.cpp b/tests/bionic/libstdc++/test_cstdio.cpp index 573746dc..f22250a4 100644 --- a/tests/bionic/libstdc++/test_cstdio.cpp +++ b/tests/bionic/libstdc++/test_cstdio.cpp @@ -27,7 +27,7 @@ */ #include <cstdio> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CSTDIO__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CSTDIO__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_cstdlib.cpp b/tests/bionic/libstdc++/test_cstdlib.cpp index c5c914c4..0450d066 100644 --- a/tests/bionic/libstdc++/test_cstdlib.cpp +++ b/tests/bionic/libstdc++/test_cstdlib.cpp @@ -27,7 +27,7 @@ */ #include <cstdlib> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CSTDLIB__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CSTDLIB__ #error "Wrong header file included!!" #endif @@ -40,6 +40,77 @@ const int kFailed = 1; namespace android { +using ::exit; +using ::abort; +using ::atexit; +using ::on_exit; + +using ::getenv; +using ::putenv; +using ::setenv; +using ::unsetenv; +using ::clearenv; + +using ::mktemp; +using ::mkstemp; + +using ::strtol; +using ::strtoll; +using ::strtoul; +using ::strtoull; +using ::strtod; +using ::strtof; + +using ::atoi; +using ::atol; +using ::atoll; +using ::atof; + +using ::abs; +using ::labs; +using ::llabs; + +using ::realpath; +using ::system; + +using ::bsearch; +using ::qsort; + +using ::jrand48; +using ::mrand48; +using ::nrand48; +using ::lrand48; +using ::seed48; +using ::srand48; + +using ::rand; +using ::srand; +using ::random; +using ::srandom; + +using ::malloc; +using ::free; +using ::calloc; +using ::realloc; + +using ::unlockpt; +using ::ptsname; +using ::ptsname_r; +using ::getpt; +using ::grantpt; + +using ::div_t; +using ::div; +using ::ldiv_t; +using ::ldiv; +using ::lldiv_t; +using ::lldiv; + +using ::mblen; +using ::mbstowcs; +using ::mbtowc; +using ::wctomb; +using ::wcstombs; } // namespace android int main(int argc, char **argv) diff --git a/tests/bionic/libstdc++/test_cstring.cpp b/tests/bionic/libstdc++/test_cstring.cpp index eab64a1e..f01b8a84 100644 --- a/tests/bionic/libstdc++/test_cstring.cpp +++ b/tests/bionic/libstdc++/test_cstring.cpp @@ -27,7 +27,7 @@ */ #include <cstring> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CSTRING__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CSTRING__ #error "Wrong header file included!!" #endif diff --git a/tests/bionic/libstdc++/test_ctime.cpp b/tests/bionic/libstdc++/test_ctime.cpp index 72a13cb9..9fae6837 100644 --- a/tests/bionic/libstdc++/test_ctime.cpp +++ b/tests/bionic/libstdc++/test_ctime.cpp @@ -27,7 +27,7 @@ */ #include <ctime> -#ifndef BIONIC_LIBSTDCPP_INCLUDE_CTIME__ +#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CTIME__ #error "Wrong header file included!!" #endif |