kapsikkum-unmanic – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 #!/bin/bash
2 # -*- coding: utf-8 -*-
3 ###################################################################################################
4 #
5 # Written by: Josh.5 <jsunnex@gmail.com>
6 # Date: Thu Jan 07 2019, (17:52:42 PM)
7 #
8 # Copyright:
9 # Copyright (C) Josh Sunnex - All Rights Reserved
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to deal
13 # in the Software without restriction, including without limitation the rights
14 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 # copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in all
19 # copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
26 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
27 # OR OTHER DEALINGS IN THE SOFTWARE.
28 #
29 #
30 ###################################################################################################
31  
32 # This script is to setup a series of tests for the application
33  
34  
35 SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
36 PROJECT_BASE=$(realpath ${SCRIPT_PATH}/../../);
37 TEST_VIDEOS_DIRECTORY="${PROJECT_BASE}/tests/support_/videos";
38  
39 ### CONFIGURE:
40 ## Sources:
41 # - https://standaloneinstaller.com/blog/big-list-of-sample-videos-for-testers-124.html
42 declare -A SMALL_TEST_VIDEOS=(
43 ['big_buck_bunny_720p_1mb.mp4']='https://drive.google.com/uc?id=1p0axETh8CKlL-oKPNaHAh786sr06hOAi&authuser=0&export=download'
44 ['big_buck_bunny_720p_1mb.mkv']='https://drive.google.com/uc?id=11Zx1h1yiTnKkZJSXj0VVvLssIBgYiHv7&authuser=0&export=download'
45 ['big_buck_bunny_720p_1mb.flv']='https://drive.google.com/uc?id=1k8um0-Hn9fOYpoR4gkYY2rRWfZZq1CGj&authuser=0&export=download'
46 ['big_buck_bunny_144p_1mb.3gp']='https://drive.google.com/uc?id=1DjGbUsuhawb3Y-a3HkD2puodu232ZA1Q&authuser=0&export=download'
47 )
48 declare -A MED_TEST_VIDEOS=(
49 ['big_buck_bunny_720p_10mb.mp4']='https://drive.google.com/uc?id=1qAYTFtEwfCcgFjLuPCoJJGWwzYki8SbG&authuser=0&export=download'
50 ['big_buck_bunny_720p_10mb.mkv']='https://drive.google.com/uc?id=1FdXRRB0TX6QMx2HmZScPW2gZqMx17Lbq&authuser=0&export=download'
51 ['big_buck_bunny_720p_10mb.flv']='https://drive.google.com/uc?id=1keev_0qoJMMNv7bzLxv_E0v1ugTjmMbB&authuser=0&export=download'
52 ['big_buck_bunny_240p_10mb.3gp']='https://drive.google.com/uc?id=1OQBGz8P-scmrefxoEWcuIm4eNhlOI6eZ&authuser=0&export=download'
53 )
54 # http://www.engr.colostate.edu/me/facil/dynamics/files/flame.avi <- single stream (not supported yet)
55 # https://github.com/Matroska-Org/matroska-test-files
56 # - test5.mkv = Multiple audio/subtitles
57 # - test8.mkv = Audio gap
58 declare -A FAULTY_TEST_VIDEOS=(
59 ['matroska-test-files-test5.mkv']='https://drive.google.com/uc?id=16vdt6FEOIeUdCG9r-3FZDq5tDD4nMtMp&authuser=0&export=download'
60 ['matroska-test-files-test8.mkv']='https://drive.google.com/uc?id=16vdt6FEOIeUdCG9r-3FZDq5tDD4nMtMp&authuser=0&export=download'
61 )
62  
63  
64 ### FUNCTIONS
65 # Fetch test media:
66 fetch_test_videos() {
67 mkdir -p \
68 ${TEST_VIDEOS_DIRECTORY}/small \
69 ${TEST_VIDEOS_DIRECTORY}/med \
70 ${TEST_VIDEOS_DIRECTORY}/faulty
71  
72 for DEST_FILE in "${!SMALL_TEST_VIDEOS[@]}"; do
73 URL=${SMALL_TEST_VIDEOS[$DEST_FILE]}
74 DEST_PATH=${TEST_VIDEOS_DIRECTORY}/small/${DEST_FILE}
75 if [[ ! -e ${DEST_PATH} ]]; then
76 echo "Downloading ${URL} -> ${DEST_PATH}"
77 curl -sSL ${URL} --output ${DEST_PATH};
78 fi
79 done
80 for DEST_FILE in "${!MED_TEST_VIDEOS[@]}"; do
81 URL=${MED_TEST_VIDEOS[$DEST_FILE]}
82 DEST_PATH=${TEST_VIDEOS_DIRECTORY}/med/${DEST_FILE}
83 if [[ ! -e ${DEST_PATH} ]]; then
84 echo "Downloading ${URL} -> ${DEST_PATH}"
85 curl -sSL ${URL} --output ${DEST_PATH};
86 fi
87 done
88 for DEST_FILE in "${!FAULTY_TEST_VIDEOS[@]}"; do
89 URL=${FAULTY_TEST_VIDEOS[$DEST_FILE]}
90 DEST_PATH=${TEST_VIDEOS_DIRECTORY}/faulty/${DEST_FILE}
91 if [[ ! -e ${DEST_PATH} ]]; then
92 echo "Downloading ${URL} -> ${DEST_PATH}"
93 curl -sSL ${URL} --output ${DEST_PATH};
94 fi
95 done
96 }
97  
98  
99 ### RUN
100 fetch_test_videos