Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1146)

Unified Diff: third_party/opus/BUILD.gn

Issue 894473002: Add build targets for Opus tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Specify -Wno-nonnull for the test_opus_decode target Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/opus/opus.gyp » ('j') | third_party/opus/opus.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/opus/BUILD.gn
diff --git a/third_party/opus/BUILD.gn b/third_party/opus/BUILD.gn
index 8f51d09ffd4bd6f8808bf4054fbcb919465b4795..ce9bd4e8bde5c8d22a907bfd91d5f3d1799fbec4 100644
--- a/third_party/opus/BUILD.gn
+++ b/third_party/opus/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/arm.gni")
import("//build/config/mips.gni")
+import("//testing/test.gni")
# If fixed point implementation shall be used (otherwise float).
# TODO(wtc): change "mipselx" to "mipsel" in this file when the compilation
@@ -26,6 +27,23 @@ config("opus_config") {
include_dirs = [ "src/include" ]
}
+config("opus_test_config") {
+ include_dirs = [
+ "src/celt",
+ "src/silk",
+ ]
+
+ if (is_win) {
+ defines = [ "inline=__inline" ]
+ }
+ if (is_android) {
+ libs = [ "log" ]
+ }
+ if (is_clang) {
+ cflags = [ "-Wno-absolute-value" ]
+ }
+}
+
if (use_opus_rtcd) {
action("convert_rtcd_assembler") {
script = "convert_rtcd_assembler.py"
@@ -173,23 +191,11 @@ executable("opus_compare") {
]
configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [ "//build/config/compiler:no_chromium_code" ]
-
- include_dirs = [
- "src/celt",
- "src/silk",
+ configs += [
+ "//build/config/compiler:no_chromium_code",
+ ":opus_test_config",
]
- if (is_win) {
- defines = [ "inline=__inline" ]
- }
- if (is_android) {
- libs = [ "log" ]
- }
- if (is_clang) {
- cflags = [ "-Wno-absolute-value" ]
- }
-
deps = [
":opus",
]
@@ -201,24 +207,84 @@ executable("opus_demo") {
]
configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [
+ "//build/config/compiler:no_chromium_code",
+ ":opus_test_config",
+ ]
- include_dirs = [
- "src/celt",
- "src/silk",
+ deps = [
+ ":opus",
]
+}
- if (is_win) {
- defines = [ "inline=__inline" ]
- }
- if (is_android) {
- libs = [ "log" ]
- }
- if (is_clang) {
- cflags = [ "-Wno-absolute-value" ]
+test("test_opus_api") {
+ sources = [
+ "src/tests/test_opus_api.c",
+ ]
+
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [
+ "//build/config/compiler:no_chromium_code",
+ ":opus_test_config",
+ ]
+
+ deps = [
+ ":opus",
+ ]
+}
+
+test("test_opus_encode") {
+ sources = [
+ "src/tests/test_opus_encode.c",
+ ]
+
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [
+ "//build/config/compiler:no_chromium_code",
+ ":opus_test_config",
+ ]
+
+ deps = [
+ ":opus",
+ ]
+}
+
+test("test_opus_decode") {
+ sources = [
+ "src/tests/test_opus_decode.c",
+ ]
+
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [
+ "//build/config/compiler:no_chromium_code",
+ ":opus_test_config",
+ ]
+
+ # test_opus_decode passes a null pointer to opus_decode() for an argument
+ # marked as requiring a non-null value by the nonnull function attribute,
+ # and expects opus_decode() to fail. Disable the -Wnonnull option to avoid
+ # a compilation error if -Werror is specified.
+ if (is_posix) {
+ cflags = [ "-Wno-nonnull" ]
}
deps = [
":opus",
]
}
+
+test("test_opus_padding") {
+ sources = [
+ "src/tests/test_opus_padding.c",
+ ]
+
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [
+ "//build/config/compiler:no_chromium_code",
+ ":opus_test_config",
+ ]
+
+ deps = [
+ ":opus",
+ ]
+}
« no previous file with comments | « no previous file | third_party/opus/opus.gyp » ('j') | third_party/opus/opus.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698