-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from baktrius/testing-facilities-upgrade
Testing facilities upgrade
- Loading branch information
Showing
4 changed files
with
48 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# extract solution | ||
unzip "$1" -d assignment | ||
|
||
# populate public_repo with files from assignment.zip which are allowed for change | ||
cd assignment | ||
for file in `cat ../files_allowed_for_change` | ||
do | ||
cp "$file" "../$file" | ||
done | ||
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ $# -ne 2 -o "$2" != "--force" ] | ||
then | ||
echo "Usage: ./test_assignment PATH_TO_EXPORTED_SOLUTION --force" | ||
echo | ||
echo "THIS SCRIPT WILL REMOVE ALL DATA FROM REPOSITORY - use with care!" | ||
echo | ||
echo "Zip file with solution has to be located outside of repository folder." | ||
echo "This script assumes it is invoked from folder containing repository." | ||
exit 1 | ||
fi | ||
|
||
|
||
# remove untracked files from repository | ||
git clean -fd | ||
|
||
# reset repository to known state (specified by template hash) | ||
git reset --hard HEAD | ||
git switch --detach `unzip -p "$1" template_hash || echo "origin/main"` || git switch --detach origin/main | ||
|
||
./import_assignment "$1" | ||
|
||
# build solution and run tests | ||
./test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters