Giter Club home page Giter Club logo

kovacs's Introduction

Kovacs - A simple ExUnit test runner

Installation

Download the latest release (or clone) the repository and build Kovacs with:

MIX_ENV=prod mix escript.build

Install the application into a directory on your path

    /usr/local/bin

The easiest way to do this is to create a symbolic link to kovacs in the directory where you have downloaded the project too.

    ln -s ~/{project path}/kovacs /usr/local/bin/kovacs

Dependencies

You will also need fswatch installed as Kovacs uses this to monitor the file system. Please download fswatch for your OS from its github repository.

Quick start

kovacs can then be run in any directory by typing the following:

    kovacs

By default it will monitor the lib and test directories.

Due to problems closing down external applications when exiting Elixir command line applications, please enter q<cr> to quit Kovacs.

Important: Failure to do this will leave instances of fswatch running on your system and you will need to manually tidy them up.

When you save a file, Kovacs will run the corresponding test file. The runner will look for a test file in the same directory structure as the tested file.

If you have a file in:

    lib/parser/filter.ex

then it will expect the test file:

    test/parser/filter_test.exs

When running Kovacs, the colour output from ExUnit will not be shown. If you want to have colour output then update the projects test_helper.ex file to the following:

    ExUnit.start([colors: [enabled: true]])

Kovacs will exclude any tests that are tagged with @pending or @ignore.

    @tag :pending
    test "It will add" do
        assert 2 == 1 + 1
    end

Integration tests

If a all tests pass for the last run file, Kovacs will attempt to run a file named after the directory the test file is in. This allows for targeted integration tests for all files that collaborate within a directory.

If it is the root directory then Kovacs will look for a file named app_test.exs.

You can toggle the running of the integration test file at any time by entering i<cr>.

Configuration

if you want to watch any custom directories then you will need to supply a configuration file.

Create a Elixir configuration file e.g. kovacs.ex with the following contents.

    defmodule Kovacs.Cfg do
      def configure do
        Kovacs.watch(["./lib/dir1", "./lib/dir2", "./test"])
      end
    end

This will watch the lib/dir1, lib/dir2 and test directories from your project root, for file changes.

Note: Do not watch sub directories of an already watched directory. Duplicate file changes may be detected if you do.

Running

Run kovacs with the following

    kovacs {optional configuration file}

Important: When exiting the application press the q key followed by carriage return. Do not exit kovacs with ctrl-c. This will leave fswatch instances running, which you will need to manually clean up -- you have been warned.

Author

Copyright © 2014 Component X Software, Antony Pinchbeck

Released under Apache 2 License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.