update readme and bump version

Этот коммит содержится в:
gedi 2016-06-15 22:15:34 +03:00
родитель 337a551087
коммит 58c203d2e7
4 изменённых файлов: 17 добавлений и 18 удалений

Просмотреть файл

@ -193,7 +193,7 @@ See implementation examples:
**2016-06-14** **2016-06-14**
- godog now uses **go tool compile** and **go tool link** to support - godog now uses **go tool compile** and **go tool link** to support
vendor directory dependencies. It also compiles test executable the same vendor directory dependencies. It also compiles test executable the same
way as standard **go test** utility. With this change, go only go way as standard **go test** utility. With this change, only go
versions from **1.5** are now supported. versions from **1.5** are now supported.
**2016-06-01** **2016-06-01**

Просмотреть файл

@ -40,18 +40,18 @@ func main() {
os.Exit(status) os.Exit(status)
}`)) }`))
// Build scans clones current package into a temporary // Build creates a test package like go test command.
// godog suite test package. // If there are no go files in tested directory, then
// it simply builds a godog executable to scan features.
// //
// If there is a TestMain func in any of test.go files // If there are go test files, it first builds a test
// it removes it and all necessary unused imports related // package with standard go test command.
// to this function.
// //
// It also looks for any godog suite contexts and registers // Finally it generates godog suite executable which
// them in order to call them on execution. // registers exported godog contexts from the test files
// of tested package.
// //
// The test entry point which uses go1.4 TestMain func // Returns the path to generated executable
// is generated from the template above.
func Build() (string, error) { func Build() (string, error) {
abs, err := filepath.Abs(".") abs, err := filepath.Abs(".")
if err != nil { if err != nil {
@ -228,10 +228,9 @@ func uniqStringList(strs []string) (unique []string) {
return return
} }
// buildTestPackage clones a package and adds a godog // buildTestMain if given package is valid
// entry point with TestMain func in order to // it scans test files for contexts
// run the test suite. If TestMain func is found in tested // and produces a testmain source code.
// source, it will be removed so it can be replaced
func buildTestMain(pkg *build.Package) ([]byte, bool, error) { func buildTestMain(pkg *build.Package) ([]byte, bool, error) {
var contexts []string var contexts []string
var importPath string var importPath string
@ -261,8 +260,8 @@ func buildTestMain(pkg *build.Package) ([]byte, bool, error) {
} }
// processPackageTestFiles runs through ast of each test // processPackageTestFiles runs through ast of each test
// file pack and removes TestMain func if found. it also // file pack and looks for godog suite contexts to register
// looks for godog suite contexts to register on run // on run
func processPackageTestFiles(packs ...[]string) ([]string, error) { func processPackageTestFiles(packs ...[]string) ([]string, error) {
var ctxs []string var ctxs []string
fset := token.NewFileSet() fset := token.NewFileSet()

Просмотреть файл

@ -20,6 +20,6 @@ Feature: get version
And the response should match json: And the response should match json:
""" """
{ {
"version": "v0.4.3" "version": "v0.5.0"
} }
""" """

Просмотреть файл

@ -42,4 +42,4 @@ Godog was inspired by Behat and Cucumber the above description is taken from it'
package godog package godog
// Version of package - based on Semantic Versioning 2.0.0 http://semver.org/ // Version of package - based on Semantic Versioning 2.0.0 http://semver.org/
const Version = "v0.4.3" const Version = "v0.5.0"