updated RUN_TEST.GO

This commit is contained in:
AnilChinchawale 2018-05-24 15:44:23 +05:30
parent 5e07884497
commit a686a3dc05

View file

@ -27,14 +27,14 @@ import (
)
func tmpdir(t *testing.T) string {
dir, err := ioutil.TempDir("", "geth-test")
dir, err := ioutil.TempDir("", "XDC-test")
if err != nil {
t.Fatal(err)
}
return dir
}
type testgeth struct {
type testXDC struct {
*cmdtest.TestCmd
// template variables for expect
@ -43,8 +43,8 @@ type testgeth struct {
}
func init() {
// Run the app if we've been exec'd as "geth-test" in runGeth.
reexec.Register("geth-test", func() {
// Run the app if we've been exec'd as "XDC-test" in runGeth.
reexec.Register("XDC-test", func() {
if err := app.Run(os.Args); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
@ -61,10 +61,10 @@ func TestMain(m *testing.M) {
os.Exit(m.Run())
}
// spawns geth with the given command line args. If the args don't set --datadir, the
// spawns XDC with the given command line args. If the args don't set --datadir, the
// child g gets a temporary data directory.
func runGeth(t *testing.T, args ...string) *testgeth {
tt := &testgeth{}
func runXDC(t *testing.T, args ...string) *testXDC {
tt := &testXDC{}
tt.TestCmd = cmdtest.NewTestCmd(t, tt)
for i, arg := range args {
switch {
@ -90,9 +90,9 @@ func runGeth(t *testing.T, args ...string) *testgeth {
}()
}
// Boot "geth". This actually runs the test binary but the TestMain
// Boot "XDC". This actually runs the test binary but the TestMain
// function will prevent any tests from running.
tt.Run("geth-test", args...)
tt.Run("XDC-test", args...)
return tt
}