提交 1c02e162 编写于 作者: L limeng151

fix multimedia testcase

Signed-off-by: Nlimeng151 <limeng151@huawei.com>
Change-Id: Ia178cf9215157fed1c7e273597ee26bf47e7a168
上级 a2683855
...@@ -61,7 +61,8 @@ lite_component("acts_component") { ...@@ -61,7 +61,8 @@ lite_component("acts_component") {
"//test/xts/acts/multimedia_lite/camera_lite_posix/camera_native:ActsMediaCameraTest", "//test/xts/acts/multimedia_lite/camera_lite_posix/camera_native:ActsMediaCameraTest",
"//test/xts/acts/open_posix_testsuite/conformance/interfaces:ActsOpenPosixTest", "//test/xts/acts/open_posix_testsuite/conformance/interfaces:ActsOpenPosixTest",
#"//test/xts/acts/multimedia_lite/media_lite_posix/player_native:ActsMediaPlayerTest", "//test/xts/acts/multimedia_lite/media_lite_posix/player_native:ActsMediaPlayerTest",
"//test/xts/acts/multimedia_lite/media_lite_posix/audio_native:ActsMediaAudioTest",
"//test/xts/acts/distributed_schedule_lite/system_ability_manager_posix:ActsSamgrTest", "//test/xts/acts/distributed_schedule_lite/system_ability_manager_posix:ActsSamgrTest",
#"//test/xts/acts/distributedschedule_lite/distributed_schedule_posix:ActsDMSTest", #"//test/xts/acts/distributedschedule_lite/distributed_schedule_posix:ActsDMSTest",
......
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsMediaAudioTest") {
suite_name = "acts"
sources = [ "src/ActsMediaAudioTest.cpp" ]
ldflags = [ "-lstdc++" ]
ldflags += [ "-lm" ]
if (ohos_kernel_type == "linux") {
ldflags += [ "-lpthread" ]
}
ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ]
include_dirs = [
"src",
"//test/xts/acts/multimedia_lite/utils_posix/common/include",
"//foundation/multimedia/audio_lite/frameworks/audio_encoder/include",
"//foundation/multimedia/audio_lite/frameworks/audio_source/include",
"//foundation/multimedia/audio_lite/interfaces/kits",
"//foundation/multimedia/utils/lite/include",
"//drivers/peripheral/audio/interfaces/include",
"//drivers/peripheral/codec/interfaces/include",
"//drivers/peripheral/format/interfaces/include",
"//foundation/multimedia/audio_lite/test/unittest",
]
deps = [
"//foundation/multimedia/audio_lite/frameworks:audio_capturer_lite",
"//foundation/multimedia/utils/lite:media_common",
"//third_party/bounds_checking_function:libsec_shared",
]
cflags = [ "-Wno-error" ]
}
{
"description": "Config for hcpptest demo test cases",
"environment": [
{
"type": "device",
"label": "ipcamera"
}
],
"kits": [
{
"type": "MountKit",
"server": "NfsServer",
"mount": [
{
"source": "testcases/multimedia",
"target": "/test_root/multimedia"
}
]
}
],
"driver": {
"type": "CppTestLite",
"execute": "/test_root/multimedia/ActsMediaAudioTest.bin"
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef AUDIOLITETEST_H
#define AUDIOLITETEST_H
#include <sys/time.h>
#include "gtest/gtest.h"
#include "audio_capturer.h"
namespace OHOS {
const int RET_SUCCESS = 0;
const int RET_FAILURE = -1;
struct OHOS::Audio::AudioCapturerInfo audioCapInfo;
class AudioliteTest : public testing::Test {
public:
// SetUpTestCase: before all testcasee
static void SetUpTestCase(void);
// TearDownTestCase: after all testcase
static void TearDownTestCase(void);
// SetUp
void SetUp(void);
// TearDown
void TearDown(void);
};
} // namespace OHOS
#endif // AUDIOLITETEST_H
...@@ -11,27 +11,33 @@ ...@@ -11,27 +11,33 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//build/lite/config/subsystem/aafwk/config.gni")
import("//test/xts/tools/lite/build/suite_lite.gni") import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsMediaPlayerTest") { hcpptest_suite("ActsMediaPlayerTest") {
suite_name = "acts" suite_name = "acts"
sources = [ "src/ActsAudioPlayerTest.cpp" ] sources = [ "src/ActsMediaPlayerTest.cpp" ]
if (ohos_kernel_type == "liteos_a" &&
enable_ohos_appexecfwk_feature_ability == true) {
sources += [ "src/ActsVideoPlayerTest.cpp" ]
}
include_dirs = [ "src" ]
ldflags = [ "-lstdc++" ] ldflags = [ "-lstdc++" ]
ldflags += [ "-lm" ] ldflags += [ "-lm" ]
if (ohos_kernel_type == "linux") { if (ohos_kernel_type == "linux") {
ldflags += [ "-lpthread" ] ldflags += [ "-lpthread" ]
} }
ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ] ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ]
include_dirs = [
"src",
"//test/xts/acts/multimedia_lite/utils_posix/common/include",
"//third_party/bounds_checking_function/include",
"//foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/base",
"//foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/async",
"//foundation/multimedia/media_lite/interfaces/kits/player_lite",
"//foundation/multimedia/utils/lite/include",
"//foundation/multimedia/media_lite/test/unittest/player_lite",
]
deps = [ deps = [
"//foundation/multimedia/media_lite/frameworks/player_lite:player_lite", "//foundation/multimedia/media_lite/frameworks/player_lite:player_lite",
#"//foundation/multimedia/camera_lite/frameworks:camera_lite", "//foundation/multimedia/utils/lite:media_common",
#"//foundation/multimedia/media_lite/frameworks/recorder_lite:recorder_lite", "//third_party/bounds_checking_function:libsec_shared",
] ]
cflags = [ "-Wno-error" ] cflags = [ "-Wno-error" ]
......
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
{ {
"source": "testcases/multimedia", "source": "testcases/multimedia",
"target": "/test_root/multimedia" "target": "/test_root/multimedia"
},{
"source": "resource/multimedia",
"target": "/test_root/multimedia"
} }
] ]
} }
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef PLAYER_LITE_TEST_H
#define PLAYER_LITE_TEST_H
#include "gtest/gtest.h"
#include "player.h"
namespace OHOS {
using OHOS::Media::Player;
using OHOS::Media::PlayerSeekMode;
using OHOS::Media::Source;
using OHOS::Media::Format;
using OHOS::Media::StreamSource;
using OHOS::Media::StreamCallback;
using OHOS::Media::SourceType;
using OHOS::Media::PlayerCallback;
using namespace std;
using namespace OHOS::Media;
using namespace testing::ext;
const int FILE_PATH_LEN = 2048;
using TestSample = struct TagTestSample {
std::shared_ptr<Player> adaptr;
char filePath[FILE_PATH_LEN];
};
static TagTestSample g_tagTestSample;
static Surface *g_surface = Surface::CreateSurface();
} // namespace OHOS
#endif // PLAYER_LITE_TEST_H
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册