Skip to content

Commit

Permalink
Tests: Add script to download assets
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 authored and carolanitz committed Jul 30, 2018
1 parent 458b355 commit 1be28e1
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
31 changes: 31 additions & 0 deletions MobileVLCKit.xcodeproj/project.pbxproj
Expand Up @@ -975,6 +975,7 @@
isa = PBXNativeTarget;
buildConfigurationList = CA0301D520ADFD2500452BB8 /* Build configuration list for PBXNativeTarget "MobileVLCKitTests" */;
buildPhases = (
CA738BF020F3487500901B26 /* ShellScript */,
CA0301C720ADFD2500452BB8 /* Sources */,
CA0301C820ADFD2500452BB8 /* Frameworks */,
CA0301C920ADFD2500452BB8 /* Resources */,
Expand All @@ -993,6 +994,7 @@
isa = PBXNativeTarget;
buildConfigurationList = CAA03D1120C8DCDB001764DA /* Build configuration list for PBXNativeTarget "TVVLCKitTests" */;
buildPhases = (
CA738BF520F34D3400901B26 /* ShellScript */,
CAA03D0320C8DCDA001764DA /* Sources */,
CAA03D0420C8DCDA001764DA /* Frameworks */,
CAA03D0520C8DCDA001764DA /* Resources */,
Expand Down Expand Up @@ -1101,6 +1103,35 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
CA738BF020F3487500901B26 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh Tests/downloadTestAssets.sh\n";
};
CA738BF520F34D3400901B26 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh Tests/downloadTestAssets.sh\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
7D1329551BA304D900BE647E /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
36 changes: 36 additions & 0 deletions Tests/downloadTestAssets.sh
@@ -0,0 +1,36 @@
#!/bin/sh
# Copyright (C) Mike JS. Choi, 2018
# Copyright (C) 2018 VLC authors and VideoLAN

set -e

error()
{
local red="\033[31m"
local normal="\033[0m"
echo "${red}error:${normal} $1"
}

ASSET_DIR="Assets"

PWD=$(pwd | xargs basename);

if [ ${PWD} = "vlckit" ] || [ ${PWD} = "project" ] ; then
cd Tests
elif [ ${PWD} != "Tests" ]; then
error "Running program from unknown directory. Please move to project's root directory; vlckit"
exit 1
fi

if [ -d ${ASSET_DIR}/.git ]; then
cd ${ASSET_DIR}
git reset --hard
git pull origin master
else
git clone https://code.videolan.org/videolan/TestAssets.git ${ASSET_DIR}

if [ $? -ne 0 ]; then
error "Please remove all files in vlckit/Tests/${ASSET_DIR} and try again"
exit 1
fi
fi
18 changes: 18 additions & 0 deletions VLCKit.xcodeproj/project.pbxproj
Expand Up @@ -621,6 +621,7 @@
isa = PBXNativeTarget;
buildConfigurationList = CA23EBC420BDF02700C0D635 /* Build configuration list for PBXNativeTarget "VLCKitTests" */;
buildPhases = (
CA738BF820F3500A00901B26 /* Run Script */,
CA23EBB820BDF02700C0D635 /* Sources */,
CA23EBB920BDF02700C0D635 /* Frameworks */,
CA23EBBA20BDF02700C0D635 /* Resources */,
Expand Down Expand Up @@ -688,6 +689,23 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
CA738BF820F3500A00901B26 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh Tests/downloadTestAssets.sh\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
7DC28D3D20194043002D05C4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down

0 comments on commit 1be28e1

Please sign in to comment.