Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Testing

Platonx99 edited this page Jun 4, 2018 · 2 revisions

Running tests on webchaind

All commands (unless stated otherwise) are assumed to be run from $GOPATH/src/github.com/webchain-network/webchaind/. You should have the latest Go installed (>= 1.8).

Test the full codebase locally by changing to the repository directory and running

go test ./...

Integration tests

Integration tests for Go are included in the tests directory and can be run with standard go testing (i.e. go test). To run all the integration tests simply run:

go test ./tests/

Run a specific module with:

go test ./core/...

Or a specific test file:

go test ./core/config_test.go

Bats

Webchain uses [sstephenson/bats: Bash Automated Testing System](sstephenson/bats: Bash Automated Testing System) to test command line integration.

Run the bats tests with:

cd $GOPATH/src/github.com/webchain-network/webchaind/
bats cmd/webchaind

VM

VM Test wiki

go test ./tests/vm_test.go

State

State Test wiki

go test ./tests/state_test.go

Transaction

Transaction Test wiki

go test ./tests/transaction_test.go

Blockchain

Blockchain Test wiki

go test ./tests/block_test.go