8000 GitHub - JeffFaer/gotests at v1.3.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JeffFaer/gotests

Folders and files

8D9B
NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gotests License godoc Build Status Coverage Status codebeat badge

gotests makes writing Go tests easy. It's a Golang commandline tool that generates table driven tests based on its target source files' function and method signatures. Any new dependencies in the test files are automatically imported.

Demo

The following shows gotests in action using the official Sublime Text 3 plugin.

demo

There's a plugin for Emacs too.

Installation

Use go get to install and update:

$ go get -u github.com/cweill/gotests/...

Usage

From the commandline, gotests can generate tests for specific Go source files or an entire directory. By default, it prints its output to stdout.

$ gotests [options] PATH ...

Available options:

  -all         generate tests for all functions and methods
  
  -excl        regexp. generate tests for functions and methods that don't 
               match. Takes precedence over -only, -exported, and -all
    	   
  -exported    generate tests for exported functions and methods. Takes 
               precedence over -only and -all

  -i	       print test inputs in error messages
  
  -only        regexp. generate tests for functions and methods that match only.
               Takes precedence over -all
  
  -w           write output to (test) files instead of stdout

Contributions

Contributing guidelines are in CONTRIBUTING.md.

License

gotests is released under the Apache 2.0 License.

About

Automatically generate Go test boilerplate from your source code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%
0