Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
5e324727
Commit
5e324727
authored
Feb 28, 2019
by
linj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support js auto test
parent
7f3d8602
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
0 deletions
+74
-0
case.go
plugin/dapp/js/autotest/case.go
+24
-0
js.go
plugin/dapp/js/autotest/js.go
+28
-0
js.toml
plugin/dapp/js/autotest/js.toml
+19
-0
plugin.go
plugin/dapp/js/plugin.go
+3
-0
No files found.
plugin/dapp/js/autotest/case.go
0 → 100644
View file @
5e324727
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
autotest
import
(
"github.com/33cn/chain33/cmd/autotest/types"
)
// JsCreateCase token createcase command
type
JsCreateCase
struct
{
types
.
BaseCase
}
// JsCreatePack defines create package command
type
JsCreatePack
struct
{
types
.
BaseCasePack
}
// SendCommand defines send command function of tokenprecreatecase
func
(
testCase
*
JsCreateCase
)
SendCommand
(
packID
string
)
(
types
.
PackFunc
,
error
)
{
return
types
.
DefaultSend
(
testCase
,
&
JsCreatePack
{},
packID
)
}
plugin/dapp/js/autotest/js.go
0 → 100644
View file @
5e324727
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
autotest
import
(
"reflect"
"github.com/33cn/chain33/cmd/autotest/types"
)
type
jsAutoTest
struct
{
SimpleCaseArr
[]
types
.
SimpleCase
`toml:"SimpleCase,omitempty"`
JSCreateCaseArr
[]
JsCreateCase
`toml:"jsCreateCase,omitempty"`
}
func
init
()
{
types
.
RegisterAutoTest
(
jsAutoTest
{})
}
func
(
config
jsAutoTest
)
GetName
()
string
{
return
"js"
}
func
(
config
jsAutoTest
)
GetTestConfigType
()
reflect
.
Type
{
return
reflect
.
TypeOf
(
config
)
}
plugin/dapp/js/autotest/js.toml
0 → 100644
View file @
5e324727
# 1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK manage addr
# 0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc
[[jsCreateCase]]
id
=
"create1"
command
=
"send jsvm create -c ../../../plugin/dapp/js/executor/game.js -n hello -k 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
fail
=
true
[[jsCreateCase]]
id
=
"create2"
command
=
"send jsvm create -c ../../../plugin/dapp/js/executor/game.js -n hello -k 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
dep
=
[
"create1"
,
"configJS"
]
[[SimpleCase]]
id
=
"configJS"
dep
=
["create1"]
command
=
"send config config_tx -c js-creator -o add -v 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt -k 0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc"
\ No newline at end of file
plugin/dapp/js/plugin.go
View file @
5e324727
...
...
@@ -5,6 +5,9 @@ import (
"github.com/33cn/plugin/plugin/dapp/js/cmd"
"github.com/33cn/plugin/plugin/dapp/js/executor"
ptypes
"github.com/33cn/plugin/plugin/dapp/js/types"
// init auto test
_
"github.com/33cn/plugin/plugin/dapp/js/autotest"
)
func
init
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment