summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-07-10 09:57:06 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-07-10 09:57:06 -0700
commit885aa691269adb463c8dc133fbf3ee0ede9aa2e5 (patch)
tree3e30537333b48a71409d46f52d9bcc28b4eaf4a5
parent365aff4dc3f21d14b03633f3629f69d71b39c74e (diff)
parentb381ead492251a797d2df4b260cb01eb1f64cfad (diff)
downloadextras-885aa691269adb463c8dc133fbf3ee0ede9aa2e5.tar.gz
am b381ead4: Don\'t build libstdc++ host tests with the Bionic headers.
Merge commit 'b381ead492251a797d2df4b260cb01eb1f64cfad' * commit 'b381ead492251a797d2df4b260cb01eb1f64cfad': Don't build libstdc++ host tests with the Bionic headers.
-rw-r--r--tests/bionic/libstdc++/Android.mk14
-rw-r--r--tests/bionic/libstdc++/test_cassert.cpp2
-rw-r--r--tests/bionic/libstdc++/test_cctype.cpp2
-rw-r--r--tests/bionic/libstdc++/test_climits.cpp2
-rw-r--r--tests/bionic/libstdc++/test_cmath.cpp2
-rw-r--r--tests/bionic/libstdc++/test_csetjmp.cpp2
-rw-r--r--tests/bionic/libstdc++/test_csignal.cpp2
-rw-r--r--tests/bionic/libstdc++/test_cstddef.cpp2
-rw-r--r--tests/bionic/libstdc++/test_cstdint.cpp2
-rw-r--r--tests/bionic/libstdc++/test_cstdio.cpp2
-rw-r--r--tests/bionic/libstdc++/test_cstdlib.cpp73
-rw-r--r--tests/bionic/libstdc++/test_cstring.cpp2
-rw-r--r--tests/bionic/libstdc++/test_ctime.cpp2
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