blob: b6d1d6360c8089fd29917edf10d15514087ac76a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# AvcEncTest
The AvcEncoder Test Suite validates the Avc encoder.
## Linux x86/x64
### Requirements
- cmake (3.9.1 or above)
- make
- clang (12.0 or above)
### Steps to build
Clone libavc repository
```
$ git clone https://android.googlesource.com/platform/external/libavc
```
Create a directory inside libavc and change directory
```
$ cd libavc
$ mkdir build
$ cd build
```
Build with -DENABLE_TESTS=1.
```
$ cmake .. -DENABLE_TESTS=1 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Debug
$ make
```
Optionally, enable sanitizers by passing -DSANITIZE
```
$ cmake .. -DENABLE_TESTS=1 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Debug -DSANITIZE=fuzzer-no-link,address,\
signed-integer-overflow,unsigned-integer-overflow
$ make
```
The media files for the tests are present [at](https://dl.google.com/android-unittest/media/external/libavc/tests/AvcTestRes-1.0.zip).
Download and extract these the current folder.
usage: AvcEncTest -P \<path_to_the local folder\>
```
$./AvcEncTest -P ./
```
## Android
Run the following steps to build the test suite:
```
m AvcEncTest
```
To test 64-bit binary push binaries from nativetest64.
```
adb push ${OUT}/data/nativetest64/AvcEncTest/AvcEncTest /data/local/tmp/
```
To test 32-bit binary push binaries from nativetest.
```
adb push ${OUT}/data/nativetest/AvcEncTest/AvcEncTest /data/local/tmp/
```
The resource file for the tests is taken from [here](https://dl.google.com/android-unittest/media/external/libavc/tests/AvcTestRes-1.0.zip)
Download, unzip and push these files into device for testing.
```
adb push AvcTestRes-1.0 /sdcard/test/
```
usage: AvcEncTest -P \<path_to_folder\>
```
adb shell /data/local/tmp/AvcEncTest -P /sdcard/test/AvcTestRes-1.0/
```
Alternatively, the test can also be run using atest command.
```
atest AvcEncTest
```
|