pw_polyfill: C++11 and C++14 unit tests
Change-Id: I1a1ced2ed59a3d7dcf46c4c6a0e2e04485502fba
diff --git a/pw_build/BUILD.gn b/pw_build/BUILD.gn
index b5ad0be..9383f60 100644
--- a/pw_build/BUILD.gn
+++ b/pw_build/BUILD.gn
@@ -38,6 +38,14 @@
cflags_cc = [ "-Wnon-virtual-dtor" ]
}
+config("cpp11") {
+ cflags_cc = [ "-std=c++11" ]
+}
+
+config("cpp14") {
+ cflags_cc = [ "-std=c++14" ]
+}
+
config("cpp17") {
cflags_cc = [
"-std=c++17",
diff --git a/pw_polyfill/BUILD.gn b/pw_polyfill/BUILD.gn
index 7b0dd5d..85c1125 100644
--- a/pw_polyfill/BUILD.gn
+++ b/pw_polyfill/BUILD.gn
@@ -66,7 +66,11 @@
}
pw_test_group("tests") {
- tests = [ ":default_cpp_test" ]
+ tests = [
+ ":default_cpp_test",
+ ":cpp11_test",
+ ":cpp14_test",
+ ]
}
pw_test("default_cpp_test") {
@@ -78,6 +82,26 @@
]
}
+pw_test("cpp11_test") {
+ configs = [ "$dir_pw_build:cpp11" ]
+ sources = [
+ "test.cc",
+ ]
+ deps = [
+ ":pw_polyfill",
+ ]
+}
+
+pw_test("cpp14_test") {
+ configs = [ "$dir_pw_build:cpp14" ]
+ sources = [
+ "test.cc",
+ ]
+ deps = [
+ ":pw_polyfill",
+ ]
+}
+
pw_doc_group("docs") {
sources = [
"docs.rst",