aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2019-09-19 13:06:24 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-09-19 13:06:24 -0700
commitb6c8736c7c94839d40577de4ff401bb1e7990661 (patch)
tree078dba8803b92c564f54fa60cb4a2b0cc7af3d80
parent1be1f1158a9dac62b4728bb24433852c87dfd25e (diff)
parent2e24b85f86280607ef588816ff14b08fe8b1a09f (diff)
downloadgoogle-fruit-b6c8736c7c94839d40577de4ff401bb1e7990661.tar.gz
Merge "Upgrade google-fruit to bb1fc3b3abe3eda0f093fb1d45f9be96c6af6366" am: e75315ea1b am: f259044276 am: d5940a96a5
am: 2e24b85f86 Change-Id: Idf65bb7a8ce0b2f1bdaafd048bee9e430069cb7b
-rw-r--r--.travis.yml150
-rw-r--r--METADATA6
-rw-r--r--extras/dockerfiles/Dockerfile.ubuntu-14.049
-rw-r--r--extras/dockerfiles/Dockerfile.ubuntu-17.109
-rw-r--r--extras/dockerfiles/Dockerfile.ubuntu_arm-17.109
-rw-r--r--extras/dockerfiles/common_install.sh17
-rwxr-xr-xextras/dockerfiles/rebuild_all.sh38
-rw-r--r--extras/dockerfiles/ubuntu-14.04_custom.list10
-rw-r--r--extras/dockerfiles/ubuntu-14.04_install.sh13
-rw-r--r--extras/dockerfiles/ubuntu-17.10_custom.list8
-rw-r--r--extras/dockerfiles/ubuntu-17.10_install.sh19
-rw-r--r--extras/dockerfiles/ubuntu_arm-17.10_custom.list8
-rw-r--r--extras/dockerfiles/ubuntu_arm-17.10_install.sh18
-rwxr-xr-xextras/scripts/postsubmit-helper.sh41
-rwxr-xr-xextras/scripts/travis_ci_install_osx.sh29
-rwxr-xr-xextras/scripts/travis_yml_generator.py24
-rw-r--r--tests/util/test_type_info.py23
17 files changed, 178 insertions, 253 deletions
diff --git a/.travis.yml b/.travis.yml
index bcde127..9e1c79f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -49,17 +49,25 @@ matrix:
script: export OS=linux; export COMPILER='bazel'; export UBUNTU='18.04'; extras/scripts/postsubmit.sh
DebugPlain
- compiler: gcc
- env: COMPILER=gcc-8 TEST=DebugPlain
- install: export OS=osx; export COMPILER='gcc-8'; extras/scripts/travis_ci_install_osx.sh
+ env: COMPILER=gcc-9 TEST=DebugPlain
+ install: export OS=osx; export COMPILER='gcc-9'; extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
- script: export OS=osx; export COMPILER='gcc-8'; extras/scripts/postsubmit.sh DebugPlain
+ osx_image: xcode11.4
+ script: export OS=osx; export COMPILER='gcc-9'; extras/scripts/postsubmit.sh DebugPlain
- compiler: clang
env: COMPILER=clang-default STL=libc++ TEST=DebugPlain
install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
+ osx_image: xcode10.3
+ script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
+ DebugPlain
+ - compiler: clang
+ env: COMPILER=clang-default STL=libc++ TEST=DebugPlain
+ install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
+ extras/scripts/travis_ci_install_osx.sh
+ os: osx
+ osx_image: xcode11.4
script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
DebugPlain
- compiler: clang
@@ -76,6 +84,20 @@ matrix:
os: linux
script: export OS=linux; export COMPILER='clang-8.0'; export STL='libstdc++';
export UBUNTU='19.04'; extras/scripts/postsubmit.sh DebugAsanUbsanNoPch
+ - compiler: clang
+ env: COMPILER=clang-8.0 STL=libc++ UBUNTU=19.04 TEST=ReleasePlainNoPch
+ install: export OS=linux; export COMPILER='clang-8.0'; export STL='libc++'; export
+ UBUNTU='19.04'; extras/scripts/travis_ci_install_linux.sh
+ os: linux
+ script: export OS=linux; export COMPILER='clang-8.0'; export STL='libc++'; export
+ UBUNTU='19.04'; extras/scripts/postsubmit.sh ReleasePlainNoPch
+ - compiler: clang
+ env: COMPILER=clang-8.0 STL=libc++ UBUNTU=19.04 TEST=DebugAsanUbsanNoPch
+ install: export OS=linux; export COMPILER='clang-8.0'; export STL='libc++'; export
+ UBUNTU='19.04'; extras/scripts/travis_ci_install_linux.sh
+ os: linux
+ script: export OS=linux; export COMPILER='clang-8.0'; export STL='libc++'; export
+ UBUNTU='19.04'; extras/scripts/postsubmit.sh DebugAsanUbsanNoPch
- compiler: gcc
env: COMPILER=gcc-8 UBUNTU=18.10 TEST=ReleasePlain
install: export OS=linux; export COMPILER='gcc-8'; export UBUNTU='18.10'; extras/scripts/travis_ci_install_linux.sh
@@ -123,124 +145,96 @@ matrix:
script: export OS=linux; export COMPILER='bazel'; export UBUNTU='16.04'; extras/scripts/postsubmit.sh
DebugPlain
- compiler: gcc
- env: COMPILER=gcc-5 UBUNTU=14.04 TEST=ReleasePlain
- install: export OS=linux; export COMPILER='gcc-5'; export UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
+ env: COMPILER=gcc-5 UBUNTU=16.04 TEST=ReleasePlain
+ install: export OS=linux; export COMPILER='gcc-5'; export UBUNTU='16.04'; extras/scripts/travis_ci_install_linux.sh
os: linux
- script: export OS=linux; export COMPILER='gcc-5'; export UBUNTU='14.04'; extras/scripts/postsubmit.sh
+ script: export OS=linux; export COMPILER='gcc-5'; export UBUNTU='16.04'; extras/scripts/postsubmit.sh
ReleasePlain
- compiler: gcc
- env: COMPILER=gcc-5 UBUNTU=14.04 TEST=DebugPlain
- install: export OS=linux; export COMPILER='gcc-5'; export UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
+ env: COMPILER=gcc-5 UBUNTU=16.04 TEST=DebugPlain
+ install: export OS=linux; export COMPILER='gcc-5'; export UBUNTU='16.04'; extras/scripts/travis_ci_install_linux.sh
os: linux
- script: export OS=linux; export COMPILER='gcc-5'; export UBUNTU='14.04'; extras/scripts/postsubmit.sh
+ script: export OS=linux; export COMPILER='gcc-5'; export UBUNTU='16.04'; extras/scripts/postsubmit.sh
DebugPlain
- compiler: clang
- env: COMPILER=clang-3.5 STL=libstdc++ UBUNTU=14.04 TEST=ReleasePlain
+ env: COMPILER=clang-3.5 STL=libstdc++ UBUNTU=16.04 TEST=ReleasePlain
install: export OS=linux; export COMPILER='clang-3.5'; export STL='libstdc++';
- export UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
+ export UBUNTU='16.04'; extras/scripts/travis_ci_install_linux.sh
os: linux
script: export OS=linux; export COMPILER='clang-3.5'; export STL='libstdc++';
- export UBUNTU='14.04'; extras/scripts/postsubmit.sh ReleasePlain
+ export UBUNTU='16.04'; extras/scripts/postsubmit.sh ReleasePlain
- compiler: clang
- env: COMPILER=clang-3.5 STL=libstdc++ UBUNTU=14.04 TEST=DebugPlain
+ env: COMPILER=clang-3.5 STL=libstdc++ UBUNTU=16.04 TEST=DebugPlain
install: export OS=linux; export COMPILER='clang-3.5'; export STL='libstdc++';
- export UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
+ export UBUNTU='16.04'; extras/scripts/travis_ci_install_linux.sh
os: linux
script: export OS=linux; export COMPILER='clang-3.5'; export STL='libstdc++';
- export UBUNTU='14.04'; extras/scripts/postsubmit.sh DebugPlain
+ export UBUNTU='16.04'; extras/scripts/postsubmit.sh DebugPlain
- compiler: clang
- env: COMPILER=clang-3.9 STL=libstdc++ UBUNTU=14.04 TEST=ReleasePlain
+ env: COMPILER=clang-3.9 STL=libstdc++ UBUNTU=16.04 TEST=ReleasePlain
install: export OS=linux; export COMPILER='clang-3.9'; export STL='libstdc++';
- export UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
+ export UBUNTU='16.04'; extras/scripts/travis_ci_install_linux.sh
os: linux
script: export OS=linux; export COMPILER='clang-3.9'; export STL='libstdc++';
- export UBUNTU='14.04'; extras/scripts/postsubmit.sh ReleasePlain
+ export UBUNTU='16.04'; extras/scripts/postsubmit.sh ReleasePlain
- compiler: clang
- env: COMPILER=clang-3.9 STL=libstdc++ UBUNTU=14.04 TEST=DebugPlain
+ env: COMPILER=clang-3.9 STL=libstdc++ UBUNTU=16.04 TEST=DebugPlain
install: export OS=linux; export COMPILER='clang-3.9'; export STL='libstdc++';
- export UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
+ export UBUNTU='16.04'; extras/scripts/travis_ci_install_linux.sh
os: linux
script: export OS=linux; export COMPILER='clang-3.9'; export STL='libstdc++';
- export UBUNTU='14.04'; extras/scripts/postsubmit.sh DebugPlain
- - compiler: clang
- env: COMPILER=clang-3.5 STL=libc++ UBUNTU=14.04 TEST=ReleasePlain
- install: export OS=linux; export COMPILER='clang-3.5'; export STL='libc++'; export
- UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
- os: linux
- script: export OS=linux; export COMPILER='clang-3.5'; export STL='libc++'; export
- UBUNTU='14.04'; extras/scripts/postsubmit.sh ReleasePlain
- - compiler: clang
- env: COMPILER=clang-3.5 STL=libc++ UBUNTU=14.04 TEST=DebugPlain
- install: export OS=linux; export COMPILER='clang-3.5'; export STL='libc++'; export
- UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
- os: linux
- script: export OS=linux; export COMPILER='clang-3.5'; export STL='libc++'; export
- UBUNTU='14.04'; extras/scripts/postsubmit.sh DebugPlain
- - compiler: clang
- env: COMPILER=clang-3.9 STL=libc++ UBUNTU=14.04 TEST=ReleasePlain
- install: export OS=linux; export COMPILER='clang-3.9'; export STL='libc++'; export
- UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
- os: linux
- script: export OS=linux; export COMPILER='clang-3.9'; export STL='libc++'; export
- UBUNTU='14.04'; extras/scripts/postsubmit.sh ReleasePlain
- - compiler: clang
- env: COMPILER=clang-3.9 STL=libc++ UBUNTU=14.04 TEST=DebugPlain
- install: export OS=linux; export COMPILER='clang-3.9'; export STL='libc++'; export
- UBUNTU='14.04'; extras/scripts/travis_ci_install_linux.sh
- os: linux
- script: export OS=linux; export COMPILER='clang-3.9'; export STL='libc++'; export
- UBUNTU='14.04'; extras/scripts/postsubmit.sh DebugPlain
+ export UBUNTU='16.04'; extras/scripts/postsubmit.sh DebugPlain
- compiler: gcc
- env: COMPILER=gcc-5 TEST=ReleasePlain
- install: export OS=osx; export COMPILER='gcc-5'; extras/scripts/travis_ci_install_osx.sh
+ env: COMPILER=gcc-6 TEST=ReleasePlain
+ install: export OS=osx; export COMPILER='gcc-6'; extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
- script: export OS=osx; export COMPILER='gcc-5'; extras/scripts/postsubmit.sh ReleasePlain
+ osx_image: xcode11.4
+ script: export OS=osx; export COMPILER='gcc-6'; extras/scripts/postsubmit.sh ReleasePlain
- compiler: gcc
- env: COMPILER=gcc-5 TEST=DebugPlain
- install: export OS=osx; export COMPILER='gcc-5'; extras/scripts/travis_ci_install_osx.sh
+ env: COMPILER=gcc-6 TEST=DebugPlain
+ install: export OS=osx; export COMPILER='gcc-6'; extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
- script: export OS=osx; export COMPILER='gcc-5'; extras/scripts/postsubmit.sh DebugPlain
+ osx_image: xcode11.4
+ script: export OS=osx; export COMPILER='gcc-6'; extras/scripts/postsubmit.sh DebugPlain
- compiler: gcc
- env: COMPILER=gcc-8 TEST=ReleasePlain
- install: export OS=osx; export COMPILER='gcc-8'; extras/scripts/travis_ci_install_osx.sh
+ env: COMPILER=gcc-9 TEST=ReleasePlain
+ install: export OS=osx; export COMPILER='gcc-9'; extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
- script: export OS=osx; export COMPILER='gcc-8'; extras/scripts/postsubmit.sh ReleasePlain
+ osx_image: xcode11.4
+ script: export OS=osx; export COMPILER='gcc-9'; extras/scripts/postsubmit.sh ReleasePlain
- compiler: clang
env: COMPILER=clang-4.0 STL=libc++ TEST=ReleasePlain
install: export OS=osx; export COMPILER='clang-4.0'; export STL='libc++'; extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
+ osx_image: xcode11.4
script: export OS=osx; export COMPILER='clang-4.0'; export STL='libc++'; extras/scripts/postsubmit.sh
ReleasePlain
- compiler: clang
env: COMPILER=clang-4.0 STL=libc++ TEST=DebugAsanUbsan
install: export OS=osx; export COMPILER='clang-4.0'; export STL='libc++'; extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
+ osx_image: xcode11.4
script: export OS=osx; export COMPILER='clang-4.0'; export STL='libc++'; extras/scripts/postsubmit.sh
DebugAsanUbsan
- compiler: clang
env: COMPILER=clang-8.0 STL=libc++ TEST=ReleasePlainNoPch
install: export OS=osx; export COMPILER='clang-8.0'; export STL='libc++'; extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
+ osx_image: xcode11.4
script: export OS=osx; export COMPILER='clang-8.0'; export STL='libc++'; extras/scripts/postsubmit.sh
ReleasePlainNoPch
- compiler: clang
env: COMPILER=clang-8.0 STL=libc++ TEST=DebugAsanUbsanNoPch
install: export OS=osx; export COMPILER='clang-8.0'; export STL='libc++'; extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
+ osx_image: xcode11.4
script: export OS=osx; export COMPILER='clang-8.0'; export STL='libc++'; extras/scripts/postsubmit.sh
DebugAsanUbsanNoPch
- compiler: clang
env: COMPILER=clang-8.0 STL=libc++ TEST=DebugPlainNoPch
install: export OS=osx; export COMPILER='clang-8.0'; export STL='libc++'; extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
+ osx_image: xcode11.4
script: export OS=osx; export COMPILER='clang-8.0'; export STL='libc++'; extras/scripts/postsubmit.sh
DebugPlainNoPch
- compiler: clang
@@ -248,7 +242,7 @@ matrix:
install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode7.3
+ osx_image: xcode8.3
script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
ReleasePlain
- compiler: clang
@@ -256,7 +250,7 @@ matrix:
install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode7.3
+ osx_image: xcode8.3
script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
DebugAsan
- compiler: clang
@@ -264,23 +258,23 @@ matrix:
install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode8.3
+ osx_image: xcode9.4
script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
ReleasePlain
- compiler: clang
- env: COMPILER=clang-default STL=libc++ TEST=DebugAsan
+ env: COMPILER=clang-default STL=libc++ TEST=DebugAsanUbsan
install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode8.3
+ osx_image: xcode9.4
script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
- DebugAsan
+ DebugAsanUbsan
- compiler: clang
env: COMPILER=clang-default STL=libc++ TEST=ReleasePlain
install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode9.4
+ osx_image: xcode10.3
script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
ReleasePlain
- compiler: clang
@@ -288,7 +282,7 @@ matrix:
install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode9.4
+ osx_image: xcode10.3
script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
DebugAsanUbsan
- compiler: clang
@@ -296,7 +290,7 @@ matrix:
install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
+ osx_image: xcode11.4
script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
ReleasePlain
- compiler: clang
@@ -304,7 +298,7 @@ matrix:
install: export OS=osx; export COMPILER='clang-default'; export STL='libc++';
extras/scripts/travis_ci_install_osx.sh
os: osx
- osx_image: xcode10.2
+ osx_image: xcode11.4
script: export OS=osx; export COMPILER='clang-default'; export STL='libc++'; extras/scripts/postsubmit.sh
DebugAsanUbsan
services:
diff --git a/METADATA b/METADATA
index cf08378..2b61d1b 100644
--- a/METADATA
+++ b/METADATA
@@ -9,11 +9,11 @@ third_party {
type: GIT
value: "https://github.com/google/fruit.git"
}
- version: "4ded6e2e54e94b140d60e95cc10027a882e9c536"
+ version: "bb1fc3b3abe3eda0f093fb1d45f9be96c6af6366"
license_type: NOTICE
last_upgrade_date {
year: 2019
- month: 7
- day: 22
+ month: 9
+ day: 3
}
}
diff --git a/extras/dockerfiles/Dockerfile.ubuntu-14.04 b/extras/dockerfiles/Dockerfile.ubuntu-14.04
deleted file mode 100644
index 42acb44..0000000
--- a/extras/dockerfiles/Dockerfile.ubuntu-14.04
+++ /dev/null
@@ -1,9 +0,0 @@
-FROM ubuntu:14.04
-MAINTAINER Marco Poletti <poletti.marco@gmail.com>
-
-COPY ubuntu-14.04_custom.list /etc/apt/sources.list.d/
-COPY common_install.sh common_cleanup.sh ubuntu-14.04_install.sh /
-
-RUN bash -x /common_install.sh && \
- bash -x /ubuntu-14.04_install.sh && \
- bash -x /common_cleanup.sh
diff --git a/extras/dockerfiles/Dockerfile.ubuntu-17.10 b/extras/dockerfiles/Dockerfile.ubuntu-17.10
deleted file mode 100644
index 3dae283..0000000
--- a/extras/dockerfiles/Dockerfile.ubuntu-17.10
+++ /dev/null
@@ -1,9 +0,0 @@
-FROM ubuntu:17.10
-MAINTAINER Marco Poletti <poletti.marco@gmail.com>
-
-COPY ubuntu-17.10_custom.list /etc/apt/sources.list.d/
-COPY common_install.sh common_cleanup.sh ubuntu-17.10_install.sh /
-
-RUN bash -x /common_install.sh && \
- bash -x /ubuntu-17.10_install.sh && \
- bash -x /common_cleanup.sh
diff --git a/extras/dockerfiles/Dockerfile.ubuntu_arm-17.10 b/extras/dockerfiles/Dockerfile.ubuntu_arm-17.10
deleted file mode 100644
index f2d8b30..0000000
--- a/extras/dockerfiles/Dockerfile.ubuntu_arm-17.10
+++ /dev/null
@@ -1,9 +0,0 @@
-FROM multiarch/ubuntu-core:arm64-artful
-MAINTAINER Marco Poletti <poletti.marco@gmail.com>
-
-COPY ubuntu_arm-17.10_custom.list /etc/apt/sources.list.d/
-COPY common_install.sh common_cleanup.sh ubuntu_arm-17.10_install.sh /
-
-RUN bash -x /common_install.sh && \
- bash -x /ubuntu_arm-17.10_install.sh && \
- bash -x /common_cleanup.sh
diff --git a/extras/dockerfiles/common_install.sh b/extras/dockerfiles/common_install.sh
index f92136c..ba63b2c 100644
--- a/extras/dockerfiles/common_install.sh
+++ b/extras/dockerfiles/common_install.sh
@@ -20,14 +20,19 @@ apt-get install -y --allow-unauthenticated --no-install-recommends \
make \
cmake \
libboost-dev \
+ libc++1 \
libc++-dev \
+ libc++abi1 \
+ libc++abi-dev \
python3-pip \
python3-setuptools \
python3-networkx \
dirmngr
-
-pip3 install wheel
-pip3 install pytest
-pip3 install pytest-xdist
-pip3 install sh
-pip3 install bidict
+
+pip3 install --upgrade pip
+python3 -m pip install absl-py
+python3 -m pip install bidict
+python3 -m pip install pytest
+python3 -m pip install pytest-xdist
+python3 -m pip install sh
+python3 -m pip install wheel
diff --git a/extras/dockerfiles/rebuild_all.sh b/extras/dockerfiles/rebuild_all.sh
new file mode 100755
index 0000000..545df07
--- /dev/null
+++ b/extras/dockerfiles/rebuild_all.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+cd extras/dockerfiles/ || exit 1
+
+# Setup for ARM
+docker run --rm --privileged multiarch/qemu-user-static:register --reset
+
+COMMANDS=()
+
+for V in 16.04 17.04 18.04 18.10 19.04 16.04
+do
+ C="docker build -t polettimarco/fruit-basesystem:ubuntu-$V -f Dockerfile.ubuntu-$V ."
+ COMMANDS+=("$C || { echo; echo FAILED: '$C'; echo; exit 1; }")
+done
+
+for V in 16.04 18.04
+do
+ C="docker build -t polettimarco/fruit-basesystem:ubuntu_arm-$V -f Dockerfile.ubuntu_arm-$V ."
+ COMMANDS+=("$C || { echo; echo FAILED: '$C'; echo; exit 1; }")
+done
+
+for C in "${COMMANDS[@]}"
+do
+ echo "$C"
+done | xargs -P 0 -L 1 -d '\n' bash -c || {
+
+ # The successful ones should all be no-ops at this point, the failing ones won't be.
+ # This way we get better diagnostics.
+ for C in "${COMMANDS[@]}"
+ do
+ $C || {
+ echo "Failed: $C"
+ exit 1
+ }
+ done
+}
+
+docker push polettimarco/fruit-basesystem
diff --git a/extras/dockerfiles/ubuntu-14.04_custom.list b/extras/dockerfiles/ubuntu-14.04_custom.list
deleted file mode 100644
index b45b5b3..0000000
--- a/extras/dockerfiles/ubuntu-14.04_custom.list
+++ /dev/null
@@ -1,10 +0,0 @@
-deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main
-deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main
-deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.7 main
-deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.7 main
-deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.8 main
-deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.8 main
-deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main
-deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main
-deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main
-deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main
diff --git a/extras/dockerfiles/ubuntu-14.04_install.sh b/extras/dockerfiles/ubuntu-14.04_install.sh
deleted file mode 100644
index 3e643f8..0000000
--- a/extras/dockerfiles/ubuntu-14.04_install.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-set -e
-
-apt-get install -y --allow-unauthenticated --no-install-recommends \
- clang-3.5 \
- clang-3.6 \
- clang-3.7 \
- clang-3.8 \
- clang-3.9 \
- clang-4.0 \
- g++-5 \
- g++-4.9
diff --git a/extras/dockerfiles/ubuntu-17.10_custom.list b/extras/dockerfiles/ubuntu-17.10_custom.list
deleted file mode 100644
index e72d24a..0000000
--- a/extras/dockerfiles/ubuntu-17.10_custom.list
+++ /dev/null
@@ -1,8 +0,0 @@
-deb [trusted=yes] http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu artful main
-deb-src [trusted=yes] http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu artful main
-deb [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful main
-deb-src [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful main
-deb [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful-4.0 main
-deb-src [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful-4.0 main
-deb [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful-5.0 main
-deb-src [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful-5.0 main
diff --git a/extras/dockerfiles/ubuntu-17.10_install.sh b/extras/dockerfiles/ubuntu-17.10_install.sh
deleted file mode 100644
index 07147aa..0000000
--- a/extras/dockerfiles/ubuntu-17.10_install.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-set -e
-
-apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
-
-apt-get install -y --allow-unauthenticated --no-install-recommends \
- g++-7 \
- g++-5 \
- clang-3.9 \
- clang-4.0 \
- clang-3.8 \
- clang-5.0 \
- python \
- python3-sh \
- python3-typed-ast \
- clang-format
-
-pip3 install typed_ast
diff --git a/extras/dockerfiles/ubuntu_arm-17.10_custom.list b/extras/dockerfiles/ubuntu_arm-17.10_custom.list
deleted file mode 100644
index 69c660b..0000000
--- a/extras/dockerfiles/ubuntu_arm-17.10_custom.list
+++ /dev/null
@@ -1,8 +0,0 @@
-#deb [trusted=yes] http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu artful main
-#deb-src [trusted=yes] http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu artful main
-#deb [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful main
-#deb-src [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful main
-#deb [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful-4.0 main
-#deb-src [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful-4.0 main
-#deb [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful-5.0 main
-#deb-src [trusted=yes] http://apt.llvm.org/artful/ llvm-toolchain-artful-5.0 main
diff --git a/extras/dockerfiles/ubuntu_arm-17.10_install.sh b/extras/dockerfiles/ubuntu_arm-17.10_install.sh
deleted file mode 100644
index 9c09139..0000000
--- a/extras/dockerfiles/ubuntu_arm-17.10_install.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-set -e
-
-#apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
-
-apt-get install -y --allow-unauthenticated --no-install-recommends \
- g++-7 \
- g++-5 \
- clang-3.9 \
- clang-4.0 \
- clang-5.0 \
- python \
- python3-sh \
- python3-typed-ast \
- clang-format
-
-pip3 install typed_ast
diff --git a/extras/scripts/postsubmit-helper.sh b/extras/scripts/postsubmit-helper.sh
index 6d361a9..36169bb 100755
--- a/extras/scripts/postsubmit-helper.sh
+++ b/extras/scripts/postsubmit-helper.sh
@@ -63,17 +63,8 @@ clang-3.9)
;;
clang-4.0)
- case "$OS" in
- linux)
- export CC=clang-4.0
- export CXX=clang++-4.0
- ;;
- osx)
- export CC=/usr/local/opt/llvm/bin/clang
- export CXX=/usr/local/opt/llvm/bin/clang++
- ;;
- *) echo "Error: unexpected OS: $OS"; exit 1 ;;
- esac
+ export CC=clang-4.0
+ export CXX=clang++-4.0
;;
clang-5.0)
@@ -115,23 +106,27 @@ run_make() {
if [[ "${COMPILER}" != "bazel" ]]
then
+ # This is only needed in OS X but it has no effect on Linux so we can add it unconditionally.
+ BOOST_INCLUDE_FLAG="-I /usr/local/include/boost"
+ COMMON_CXX_FLAGS="$STLARG $BOOST_INCLUDE_FLAG -Werror -pedantic"
+
echo CXX version: $($CXX --version)
echo C++ Standard library location: $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1)
echo Normalized C++ Standard library location: $(readlink -f $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1))
case "$1" in
- DebugPlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O2") ;;
- DebugPlainNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O2" -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
- DebugAsan) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O0 -fsanitize=address") ;;
- DebugAsanNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O0 -fsanitize=address" -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
- DebugAsanUbsan) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O0 -fsanitize=address,undefined") ;;
- DebugAsanUbsanNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O0 -fsanitize=address,undefined" -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
- DebugValgrind) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O2" -DRUN_TESTS_UNDER_VALGRIND=TRUE) ;;
- DebugValgrindNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O2" -DRUN_TESTS_UNDER_VALGRIND=TRUE -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
- ReleasePlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic") ;;
- ReleasePlainNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic" -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
- ReleaseValgrind) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic" -DRUN_TESTS_UNDER_VALGRIND=TRUE) ;;
- ReleaseValgrindNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG -Werror -pedantic" -DRUN_TESTS_UNDER_VALGRIND=TRUE -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
+ DebugPlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O2") ;;
+ DebugPlainNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O2" -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
+ DebugAsan) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O0 -fsanitize=address") ;;
+ DebugAsanNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O0 -fsanitize=address" -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
+ DebugAsanUbsan) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O0 -fsanitize=address,undefined") ;;
+ DebugAsanUbsanNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O0 -fsanitize=address,undefined" -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
+ DebugValgrind) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O2" -DRUN_TESTS_UNDER_VALGRIND=TRUE) ;;
+ DebugValgrindNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1 -O2" -DRUN_TESTS_UNDER_VALGRIND=TRUE -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
+ ReleasePlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS") ;;
+ ReleasePlainNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS" -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
+ ReleaseValgrind) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS" -DRUN_TESTS_UNDER_VALGRIND=TRUE) ;;
+ ReleaseValgrindNoPch) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$COMMON_CXX_FLAGS" -DRUN_TESTS_UNDER_VALGRIND=TRUE -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF) ;;
*) echo "Error: you need to specify one of the supported postsubmit modes (see postsubmit.sh)."; exit 1 ;;
esac
diff --git a/extras/scripts/travis_ci_install_osx.sh b/extras/scripts/travis_ci_install_osx.sh
index 3d86634..0bef2b1 100755
--- a/extras/scripts/travis_ci_install_osx.sh
+++ b/extras/scripts/travis_ci_install_osx.sh
@@ -3,18 +3,9 @@
set -e
install_brew_package() {
- if brew list -1 | grep -q "^$1\$"; then
- # Package is installed, upgrade if needed
- time (brew outdated "$1" || brew upgrade "$@")
- else
- # Package not installed yet, install.
- # If there are issues, try upgrading instead.
- time (brew install "$@" || brew upgrade "$@")
- fi
+ time (brew install "$@" || brew outdated "$1" || brew upgrade "$@")
}
-time brew update
-
# For md5sum, timeout
install_brew_package coreutils
@@ -31,25 +22,23 @@ gcc-5) install_brew_package gcc@5 ;;
gcc-6) install_brew_package gcc@6 ;;
gcc-7) install_brew_package gcc@7 ;;
gcc-8) install_brew_package gcc@8 ;;
+gcc-9) install_brew_package gcc@9 ;;
clang-default) ;;
-clang-3.9) install_brew_package llvm@3.9 --with-clang --with-libcxx;;
-clang-4.0) install_brew_package llvm@4 --with-clang --with-libcxx;;
-clang-5.0) install_brew_package llvm@5 --with-clang --with-libcxx;;
-clang-6.0) install_brew_package llvm@6 --with-clang --with-libcxx;;
-clang-7.0) install_brew_package llvm@7 --with-clang --with-libcxx;;
-clang-8.0) install_brew_package llvm@8 --with-clang --with-libcxx;;
+clang-3.9) install_brew_package llvm@3.9 ;;
+clang-4.0) install_brew_package llvm@4 ;;
+clang-5.0) install_brew_package llvm@5 ;;
+clang-6.0) install_brew_package llvm@6 ;;
+clang-7.0) install_brew_package llvm@7 ;;
+clang-8.0) install_brew_package llvm@8 ;;
*) echo "Compiler not supported: ${COMPILER}. See travis_ci_install_osx.sh"; exit 1 ;;
esac
install_brew_package boost
install_brew_package python
+time pip3 install absl-py
time pip3 install pytest
time pip3 install pytest-xdist
time pip3 install sh
-# TODO: remove this.
-ls -l /usr/local/include
-find /usr/local/include/boost*
-
# This adds python-installed executables to PATH (notably py.test).
export PATH="$(brew --prefix)/bin:$PATH"
diff --git a/extras/scripts/travis_yml_generator.py b/extras/scripts/travis_yml_generator.py
index ddaaedf..e2f5581 100755
--- a/extras/scripts/travis_yml_generator.py
+++ b/extras/scripts/travis_yml_generator.py
@@ -151,6 +151,9 @@ add_ubuntu_tests(ubuntu_version='19.04', compiler='clang-6.0', stl='libstdc++',
add_ubuntu_tests(ubuntu_version='19.04', compiler='clang-8.0', stl='libstdc++',
# Disabled due to https://bugs.llvm.org/show_bug.cgi?id=41625.
use_precompiled_headers_in_tests=False)
+add_ubuntu_tests(ubuntu_version='19.04', compiler='clang-8.0', stl='libc++',
+ # Disabled due to https://bugs.llvm.org/show_bug.cgi?id=41625.
+ use_precompiled_headers_in_tests=False)
add_ubuntu_tests(ubuntu_version='18.10', compiler='gcc-8', asan=False, ubsan=False)
add_ubuntu_tests(ubuntu_version='18.10', compiler='clang-4.0', stl='libstdc++')
@@ -163,31 +166,28 @@ add_bazel_tests(ubuntu_version='16.04')
# ASan/UBSan are disabled for all these, the analysis on later versions is better anyway.
# Also, in some combinations they wouldn't work.
-add_ubuntu_tests(ubuntu_version='14.04', compiler='gcc-5', asan=False, ubsan=False)
-add_ubuntu_tests(ubuntu_version='14.04', compiler='clang-3.5', stl='libstdc++', asan=False, ubsan=False)
-add_ubuntu_tests(ubuntu_version='14.04', compiler='clang-3.9', stl='libstdc++', asan=False, ubsan=False)
-add_ubuntu_tests(ubuntu_version='14.04', compiler='clang-3.5', stl='libc++', asan=False, ubsan=False)
-add_ubuntu_tests(ubuntu_version='14.04', compiler='clang-3.9', stl='libc++', asan=False, ubsan=False)
+add_ubuntu_tests(ubuntu_version='16.04', compiler='gcc-5', asan=False, ubsan=False)
+add_ubuntu_tests(ubuntu_version='16.04', compiler='clang-3.5', stl='libstdc++', asan=False, ubsan=False)
+add_ubuntu_tests(ubuntu_version='16.04', compiler='clang-3.9', stl='libstdc++', asan=False, ubsan=False)
# Asan/Ubsan are disabled because it generates lots of warnings like:
# warning: direct access in [...] to global weak symbol guard variable for [...] means the weak symbol cannot be
# overridden at runtime. This was likely caused by different translation units being compiled with different
# visibility settings.
# and the build eventually fails or times out.
-add_osx_tests(compiler='gcc-5', xcode_version='10.2', asan=False, ubsan=False)
-add_osx_tests(compiler='gcc-8', xcode_version='10.2', asan=False, ubsan=False, smoke_tests=['DebugPlain'])
-add_osx_tests(compiler='clang-4.0', xcode_version='10.2', stl='libc++')
-add_osx_tests(compiler='clang-8.0', xcode_version='10.2', stl='libc++', smoke_tests=['DebugPlain'],
+add_osx_tests(compiler='gcc-6', xcode_version='11.4', asan=False, ubsan=False)
+add_osx_tests(compiler='gcc-9', xcode_version='11.4', asan=False, ubsan=False, smoke_tests=['DebugPlain'])
+add_osx_tests(compiler='clang-4.0', xcode_version='11.4', stl='libc++')
+add_osx_tests(compiler='clang-8.0', xcode_version='11.4', stl='libc++', smoke_tests=['DebugPlain'],
# Disabled due to https://bugs.llvm.org/show_bug.cgi?id=41625.
use_precompiled_headers_in_tests=False)
# UBSan is disabled because AppleClang does not support -fsanitize=undefined.
-add_osx_tests(compiler='clang-default', xcode_version='7.3', stl='libc++', ubsan=False)
-# UBSan is disabled because AppleClang does not support -fsanitize=undefined.
add_osx_tests(compiler='clang-default', xcode_version='8.3', stl='libc++', ubsan=False)
add_osx_tests(compiler='clang-default', xcode_version='9.4', stl='libc++')
-add_osx_tests(compiler='clang-default', xcode_version='10.2', stl='libc++', smoke_tests=['DebugPlain'])
+add_osx_tests(compiler='clang-default', xcode_version='10.3', stl='libc++', smoke_tests=['DebugPlain'])
+add_osx_tests(compiler='clang-default', xcode_version='11.4', stl='libc++', smoke_tests=['DebugPlain'])
# ** Disabled combinations **
#
diff --git a/tests/util/test_type_info.py b/tests/util/test_type_info.py
index 1eb1806..b67f197 100644
--- a/tests/util/test_type_info.py
+++ b/tests/util/test_type_info.py
@@ -49,20 +49,27 @@ class TestTypeInfo(parameterized.TestCase):
source,
locals())
- def test_name(self):
+ @parameterized.parameters([
+ ('MyStruct', '{"MyStruct", "struct MyStruct"}'),
+ ('std::pair<MyStruct, int>', '{"std::pair<MyStruct, int>", "std::__1::pair<MyStruct, int>"}'),
+ ])
+ def test_name(self, T, Expected):
source = '''
struct MyStruct {
};
int main() {
- std::string result = getTypeId<MyStruct>().type_info->name();
- if (result != "MyStruct" && result != "struct MyStruct") {
- std::cerr << "Demangling failed." << std::endl;
- std::cerr << "typeid(MyStruct).name() == " << typeid(MyStruct).name() << std::endl;
- std::cerr << "getTypeId<MyStruct>().type_info->name() == " << result << std::endl;
- abort();
+ std::string result = getTypeId<T>().type_info->name();
+ Assert(std::string(getTypeId<T>()) == getTypeId<T>().type_info->name());
+ for (std::string expected : Expected) {
+ if (result == expected) {
+ return 0;
+ }
}
- Assert(std::string(getTypeId<MyStruct>()) == "MyStruct" || std::string(getTypeId<MyStruct>()) == "struct MyStruct");
+ std::cerr << "Unexpected demangled name." << std::endl;
+ std::cerr << "typeid(T).name() == " << typeid(T).name() << std::endl;
+ std::cerr << "getTypeId<T>().type_info->name() == " << result << std::endl;
+ abort();
}
'''
expect_success(