#!/usr/bin/env ruby =begin ======================================================================= # TORK-MASTER 1 2012-09-26 18.2.3 ## NAME tork-master - absorbs overhead and runs tests ## SYNOPSIS `tork-master` [*OPTION*]... ## DESCRIPTION This program absorbs the test execution overhead and forks to run your tests. It reads the following single-line commands (JSON arrays) from its standard input stream and performs the respective actions as described below. `["load",` *paths*`,` *files*`]` Adds the given array of *paths* to Ruby's $LOAD_PATH, loads the given array of *files* after removing their ".rb" file extension if present, and prints the given command line to the standard output stream. `["test",` *test_file*`,` *line_numbers*`]` Runs the given *test_file* in a forked child process while instructing your chosen unit testing framework (loaded by your test execution overhead) to only run those tests that are defined on the given array of *line_numbers*. Prints the following status messages to the standard output stream. The standard output and error streams of the forked child process are captured in the *log_file* specified in these status messages. * Test is running: `["test",` *test_file*`,` *line_numbers*`,` *log_file*`,` *worker_number*`]` * Test has passed: `["pass",` *test_file*`,` *line_numbers*`,` *log_file*`,` *worker_number*`,` *exit_code*`,` *exit_info*`]` * Test has failed: `["fail",` *test_file*`,` *line_numbers*`,` *log_file*`,` *worker_number*`,` *exit_code*`,` *exit_info*`]` `["stop"]` Stops all tests that are currently running and prints the given command line to the standard output stream. `["quit"]` Stops all tests that are currently running and exits. ## OPTIONS `-h`, `--help` Show this help manual. ## FILES *.tork.rb* Optional Ruby script for configuring tork(1). ## ENVIRONMENT `TORK_CONFIGS` A single-line JSON array containing paths to actual files or names of helper libraries in the tork/config/ namespace of Ruby's load path. These configuration files are loaded just before *.tork.rb* is loaded. ## SEE ALSO tork(1), tork-herald(1), tork-driver(1), tork-engine(1), tork-master(1) =end ========================================================================= $0 = File.basename(__FILE__) # for easier identification in ps(1) output require 'binman' BinMan.help require 'tork/master' Tork::Master.new.loop raise SystemExit # prevent empty test suite from running in the master process