Commit 870ebb78 authored by henrika's avatar henrika Committed by Commit bot

Revert of Add build targets for Opus tests. (patchset #2 id:20001 of...

Revert of Add build targets for Opus tests. (patchset #2 id:20001 of https://codereview.chromium.org/894473002/)

Reason for revert:
This CL breaks WebRTC in Chrome and must be reverted. Contact tlegrand@ for more details.

Original issue's description:
> Add build targets for Opus tests.
>
> test_opus_api, test_opus_encode, test_opus_decode, and test_opus_padding
> can be run directly, with no command-line options, and they print out
> "OK" during the test and an overall status message such as
> "All API tests passed." or "Tests completed successfully." at the end.
>
> The celt component has several unit tests. I didn't add build targets
> for them because some of them don't print any output, so you'd need a
> test harness script to examine their exit status.
>
> R=henrika@chromium.org,sergeyu@chromium.org
> BUG=452984
>
> Committed: https://crrev.com/8b76b75f78ffdb9760ee7eea4f149c5d2b64bc89
> Cr-Commit-Position: refs/heads/master@{#314235}

TBR=sergeyu@chromium.org,brettw@chromium.org,wtc@chromium.org, tlegrand@chromium.org
BUG=452984

Review URL: https://codereview.chromium.org/884483005

Cr-Commit-Position: refs/heads/master@{#314308}
parent 2fa98a59
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
import("//build/config/arm.gni") import("//build/config/arm.gni")
import("//build/config/mips.gni") import("//build/config/mips.gni")
import("//testing/test.gni")
# If fixed point implementation shall be used (otherwise float). # If fixed point implementation shall be used (otherwise float).
# TODO(wtc): change "mipselx" to "mipsel" in this file when the compilation # TODO(wtc): change "mipselx" to "mipsel" in this file when the compilation
...@@ -27,23 +26,6 @@ config("opus_config") { ...@@ -27,23 +26,6 @@ config("opus_config") {
include_dirs = [ "src/include" ] 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) { if (use_opus_rtcd) {
action("convert_rtcd_assembler") { action("convert_rtcd_assembler") {
script = "convert_rtcd_assembler.py" script = "convert_rtcd_assembler.py"
...@@ -191,98 +173,50 @@ executable("opus_compare") { ...@@ -191,98 +173,50 @@ executable("opus_compare") {
] ]
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ configs += [ "//build/config/compiler:no_chromium_code" ]
"//build/config/compiler:no_chromium_code",
":opus_test_config",
]
deps = [
":opus",
]
}
executable("opus_demo") {
sources = [
"src/src/opus_demo.c",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
":opus_test_config",
]
deps = [
":opus",
]
}
test("test_opus_api") { include_dirs = [
sources = [ "src/celt",
"src/tests/test_opus_api.c", "src/silk",
] ]
configs -= [ "//build/config/compiler:chromium_code" ] if (is_win) {
configs += [ defines = [ "inline=__inline" ]
"//build/config/compiler:no_chromium_code", }
":opus_test_config", if (is_android) {
] libs = [ "log" ]
}
if (is_clang) {
cflags = [ "-Wno-absolute-value" ]
}
deps = [ deps = [
":opus", ":opus",
] ]
} }
test("test_opus_encode") { executable("opus_demo") {
sources = [ sources = [
"src/tests/test_opus_encode.c", "src/src/opus_demo.c",
] ]
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ configs += [ "//build/config/compiler:no_chromium_code" ]
"//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" ] include_dirs = [
configs += [ "src/celt",
"//build/config/compiler:no_chromium_code", "src/silk",
":opus_test_config",
] ]
# test_opus_decode passes a null pointer to opus_decode() for an argument if (is_win) {
# marked as requiring a non-null value by the nonnull function attribute, defines = [ "inline=__inline" ]
# and expects opus_decode() to fail. Disable the -Wnonnull option to avoid }
# a compilation error if -Werror is specified. if (is_android) {
if (is_posix) { libs = [ "log" ]
cflags = [ "-Wno-nonnull" ] }
if (is_clang) {
cflags = [ "-Wno-absolute-value" ]
} }
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 = [ deps = [
":opus", ":opus",
......
...@@ -31,33 +31,6 @@ ...@@ -31,33 +31,6 @@
}], }],
], ],
}, },
'target_defaults': {
'target_conditions': [
['_type=="executable"', {
# All of the executable targets depend on 'opus'. Unfortunately the
# 'dependencies' block cannot be inherited via 'target_defaults'.
'include_dirs': [
'src/celt',
'src/silk',
],
'conditions': [
['OS == "win"', {
'defines': [
'inline=__inline',
],
}],
['OS=="android"', {
'libraries': [
'-llog',
],
}],
['clang==1', {
'cflags': [ '-Wno-absolute-value' ],
}]
],
}],
],
},
'targets': [ 'targets': [
{ {
'target_name': 'opus', 'target_name': 'opus',
...@@ -178,73 +151,61 @@ ...@@ -178,73 +151,61 @@
'dependencies': [ 'dependencies': [
'opus' 'opus'
], ],
'sources': [ 'conditions': [
'src/src/opus_compare.c', ['OS == "win"', {
], 'defines': [
}, # target opus_compare 'inline=__inline',
{
'target_name': 'opus_demo',
'type': 'executable',
'dependencies': [
'opus'
], ],
'sources': [ }],
'src/src/opus_demo.c', ['OS=="android"', {
'link_settings': {
'libraries': [
'-llog',
], ],
}, # target opus_demo },
{ }],
'target_name': 'test_opus_api', ['clang==1', {
'type': 'executable', 'cflags': [ '-Wno-absolute-value' ],
'dependencies': [ }]
'opus'
], ],
'sources': [ 'sources': [
'src/tests/test_opus_api.c', 'src/src/opus_compare.c',
],
}, # target test_opus_api
{
'target_name': 'test_opus_encode',
'type': 'executable',
'dependencies': [
'opus'
], ],
'sources': [ 'include_dirs': [
'src/tests/test_opus_encode.c', 'src/celt',
'src/silk',
], ],
}, # target test_opus_encode }, # target opus_compare
{ {
'target_name': 'test_opus_decode', 'target_name': 'opus_demo',
'type': 'executable', 'type': 'executable',
'dependencies': [ 'dependencies': [
'opus' 'opus'
], ],
'sources': [
'src/tests/test_opus_decode.c',
],
# 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.
'conditions': [ 'conditions': [
['os_posix==1 and OS!="mac" and OS!="ios"', { ['OS == "win"', {
'cflags': ['-Wno-nonnull'], 'defines': [
'inline=__inline',
],
}], }],
['OS=="mac" or OS=="ios"', { ['OS=="android"', {
'xcode_settings': { 'link_settings': {
'WARNING_CFLAGS': ['-Wno-nonnull'], 'libraries': [
'-llog',
],
}, },
}], }],
], ['clang==1', {
}, # target test_opus_decode 'cflags': [ '-Wno-absolute-value' ],
{ }]
'target_name': 'test_opus_padding',
'type': 'executable',
'dependencies': [
'opus'
], ],
'sources': [ 'sources': [
'src/tests/test_opus_padding.c', 'src/src/opus_demo.c',
], ],
}, # target test_opus_padding 'include_dirs': [
'src/celt',
'src/silk',
],
}, # target opus_demo
] ]
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment