-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
11 additions
and
5 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 |
---|---|---|
|
@@ -1609,11 +1609,11 @@ func TestGolangBindings(t *testing.T) { | |
t.Skip("go sdk not found for testing") | ||
} | ||
// Create a temporary workspace for the test suite | ||
ws, err := ioutil.TempDir("", "") | ||
ws, err := ioutil.TempDir("", "binding-test") | ||
if err != nil { | ||
t.Fatalf("failed to create temporary workspace: %v", err) | ||
} | ||
defer os.RemoveAll(ws) | ||
//defer os.RemoveAll(ws) | ||
|
||
pkg := filepath.Join(ws, "bindtest") | ||
if err = os.MkdirAll(pkg, 0700); err != nil { | ||
|
@@ -1659,11 +1659,16 @@ func TestGolangBindings(t *testing.T) { | |
t.Fatalf("failed to convert binding test to modules: %v\n%s", err, out) | ||
} | ||
pwd, _ := os.Getwd() | ||
replacer := exec.Command(gocmd, "mod", "edit", "-replace", "github.com/core-coin/go-core="+filepath.Join(pwd, "..", "..", "..")) // Repo root | ||
replacer := exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/core-coin/[email protected]", "-replace", "github.com/core-coin/go-core="+filepath.Join(pwd, "..", "..", "..")) // Repo root | ||
replacer.Dir = pkg | ||
if out, err := replacer.CombinedOutput(); err != nil { | ||
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out) | ||
} | ||
tidier := exec.Command(gocmd, "mod", "tidy") | ||
tidier.Dir = pkg | ||
if out, err := tidier.CombinedOutput(); err != nil { | ||
t.Fatalf("failed to tidy Go module file: %v\n%s", err, out) | ||
} | ||
// Test the entire package and report any failures | ||
cmd := exec.Command(gocmd, "test", "-v", "-count", "1") | ||
cmd.Dir = pkg | ||
|
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