This commit is contained in:
parent
a042ac01ea
commit
f9dd4e9b68
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -124,3 +124,4 @@ $RECYCLE.BIN/
|
||||||
|
|
||||||
build/
|
build/
|
||||||
!examples/**/*.out
|
!examples/**/*.out
|
||||||
|
tmp/
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -15,4 +15,5 @@ prepare-test:
|
||||||
git submodule update --init --remote
|
git submodule update --init --remote
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
./scripts/prepare_test_repos.sh
|
||||||
go test -coverprofile cover.out -v ./...
|
go test -coverprofile cover.out -v ./...
|
||||||
|
|
|
@ -63,7 +63,7 @@ func readStageResults(t *testing.T, path string) []stage.StageResult {
|
||||||
|
|
||||||
func TestMain(t *testing.T) {
|
func TestMain(t *testing.T) {
|
||||||
var tests []string
|
var tests []string
|
||||||
root := "../../examples/"
|
root := "../../tmp/submodules/JOJ3-examples"
|
||||||
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
|
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3ebebbc913534fb4c4598d3ed313d1bb3ff29020
|
Subproject commit 6cbfd9ff1ea95cd5c6c5f832e99cda6f9f2ea851
|
|
@ -1 +1 @@
|
||||||
Subproject commit 4bca6f0e4b5e263532b8410afecca615e90524e9
|
Subproject commit b1afead762d2b2704823af83847c9155c6a1422b
|
31
scripts/prepare_test_repos.sh
Executable file
31
scripts/prepare_test_repos.sh
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
declare -A repo_names
|
||||||
|
tmp_dir="./tmp"
|
||||||
|
submodules_dir="$tmp_dir/submodules"
|
||||||
|
rm -rf $submodules_dir
|
||||||
|
mkdir -p $submodules_dir
|
||||||
|
submodules=$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }')
|
||||||
|
for submodule in $submodules; do
|
||||||
|
url=$(git config --file .gitmodules --get-regexp "submodule.$submodule.url" | awk '{ print $2 }')
|
||||||
|
repo_name=$(echo $url | rev | cut -d'/' -f 1 | rev | cut -d'.' -f 1)
|
||||||
|
commit=$(git submodule status $submodule | awk '{ print $1 }' | sed 's/^[+-]//')
|
||||||
|
repo_dir="$tmp_dir/$repo_name"
|
||||||
|
if [[ ! -v repo_names["$repo_name"] ]]; then
|
||||||
|
if [ ! -d "$repo_dir" ]; then
|
||||||
|
git clone $url $repo_dir
|
||||||
|
else
|
||||||
|
cd $repo_dir
|
||||||
|
git fetch --all
|
||||||
|
cd -
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
repo_names[$repo_name]=1
|
||||||
|
cd $repo_dir
|
||||||
|
git checkout -q $commit
|
||||||
|
cd -
|
||||||
|
submodule_dir="$submodules_dir/$repo_name/$submodule"
|
||||||
|
mkdir -p $submodule_dir
|
||||||
|
cp -rT $repo_dir $submodule_dir
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user