fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerMerge branch 'completions-to-use-expanded-tokens'a9618477e

master
7.2 KiB111 linesraw
1# Lists PHPUnit test suites
2function __fish_phpunit_list_suites
3    __fish_phpunit_list --list-suites
4end
5
6# Lists PHPUnit test groups
7function __fish_phpunit_list_groups
8    __fish_phpunit_list --list-groups
9end
10
11# Lists PHPUnit objects corresponding to the given option
12function __fish_phpunit_list --argument-names option
13    # Use the same PHPUnit binary as in the command being completed
14    set -l phpunit (commandline -xpc)[1]
15    test -x $phpunit
16    or return
17
18    $phpunit $option | tail -n +4 | string trim -c ' -'
19end
20
21# Code Coverage Options:
22complete -x -c phpunit -l coverage-clover -d 'Generate code coverage report in Clover XML format'
23complete -x -c phpunit -l coverage-crap4j -d 'Generate code coverage report in Crap4J XML format'
24complete -x -c phpunit -l coverage-html -d 'Generate code coverage report in HTML format'
25complete -x -c phpunit -l coverage-php -d 'Export PHP_CodeCoverage object to file'
26complete -x -c phpunit -l coverage-text -d 'Generate code coverage report in text format'
27complete -x -c phpunit -l coverage-xml -d 'Generate code coverage report in PHPUnit XML format'
28complete -x -c phpunit -l whitelist -d 'Whitelist <dir> for code coverage analysis'
29complete -f -c phpunit -l disable-coverage-ignore -d 'Disable annotations for ignoring code coverage'
30complete -f -c phpunit -l no-coverage -d 'Ignore code coverage configuration'
31complete -x -c phpunit -l dump-xdebug-filter -d 'Generate script to set Xdebug code coverage filter'
32
33# Logging Options:
34complete -x -c phpunit -l log-junit -d 'Log test execution in JUnit XML format to file'
35complete -x -c phpunit -l log-teamcity -d 'Log test execution in TeamCity format to file'
36complete -x -c phpunit -l testdox-html -d 'Write agile documentation in HTML format to file'
37complete -x -c phpunit -l testdox-text -d 'Write agile documentation in Text format to file'
38complete -x -c phpunit -l testdox-xml -d 'Write agile documentation in XML format to file'
39complete -f -c phpunit -l reverse-list -d 'Print defects in reverse order'
40
41# Test Selection Options:
42complete -x -c phpunit -l filter -d 'Filter which tests to run'
43complete -x -c phpunit -l testsuite -a '(__fish_phpunit_list_suites)' -d 'Filter which testsuite to run'
44complete -x -c phpunit -l group -a '(__fish_phpunit_list_groups)' -d 'Only runs tests from the specified group(s)'
45complete -f -c phpunit -l exclude-group -d 'Exclude tests from the specified group(s)'
46complete -f -c phpunit -l list-groups -d 'List available test groups'
47complete -f -c phpunit -l list-suites -d 'List available test suites'
48complete -f -c phpunit -l list-tests -d 'List available tests'
49complete -x -c phpunit -l list-tests-xml -d 'List available tests in XML format'
50complete -x -c phpunit -l test-suffix -d 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt'
51
52# Test Execution Options:
53complete -f -c phpunit -l dont-report-useless-tests -d 'Do not report tests that do not test anything'
54complete -f -c phpunit -l strict-coverage -d 'Be strict about @covers annotation usage'
55complete -f -c phpunit -l strict-global-state -d 'Be strict about changes to global state'
56complete -f -c phpunit -l disallow-test-output -d 'Be strict about output during tests'
57complete -f -c phpunit -l disallow-resource-usage -d 'Be strict about resource usage during small tests'
58complete -f -c phpunit -l enforce-time-limit -d 'Enforce time limit based on test size'
59complete -f -c phpunit -l default-time-limit -d 'Timeout in seconds for tests without @small, @medium or @large'
60complete -f -c phpunit -l disallow-todo-tests -d 'Disallow @todo-annotated tests'
61
62complete -f -c phpunit -l process-isolation -d 'Run each test in a separate PHP process'
63complete -f -c phpunit -l globals-backup -d 'Backup and restore $GLOBALS for each test'
64complete -f -c phpunit -l static-backup -d 'Backup and restore static attributes for each test'
65
66complete -f -c phpunit -l colors -a 'never auto always' -d 'Use colors in output'
67complete -x -c phpunit -l columns -a max -d 'Number of columns to use for progress output'
68complete -f -c phpunit -l stderr -d 'Write to STDERR instead of STDOUT'
69complete -f -c phpunit -l stop-on-defect -d 'Stop execution upon first not-passed test'
70complete -f -c phpunit -l stop-on-error -d 'Stop execution upon first error'
71complete -f -c phpunit -l stop-on-failure -d 'Stop execution upon first error or failure'
72complete -f -c phpunit -l stop-on-warning -d 'Stop execution upon first warning'
73complete -f -c phpunit -l stop-on-risky -d 'Stop execution upon first risky test'
74complete -f -c phpunit -l stop-on-skipped -d 'Stop execution upon first skipped test'
75complete -f -c phpunit -l stop-on-incomplete -d 'Stop execution upon first incomplete test'
76complete -f -c phpunit -l fail-on-warning -d 'Treat tests with warnings as failures'
77complete -f -c phpunit -l fail-on-risky -d 'Treat risky tests as failures'
78complete -f -c phpunit -s v -l verbose -d 'Output more verbose information'
79complete -f -c phpunit -l debug -d 'Display debugging information'
80
81complete -x -c phpunit -l loader -d 'TestSuiteLoader implementation to use'
82complete -x -c phpunit -l repeat -d 'Runs the test(s) repeatedly'
83complete -f -c phpunit -l teamcity -d 'Report test execution progress in TeamCity format'
84complete -f -c phpunit -l testdox -d 'Report test execution progress in TestDox format'
85complete -f -c phpunit -l testdox-group -d 'Only include tests from the specified group(s)'
86complete -f -c phpunit -l testdox-exclude-group -d 'Exclude tests from the specified group(s)'
87complete -x -c phpunit -l no-interaction -d 'Disable TestDox progress animation'
88complete -x -c phpunit -l printer -d 'TestListener implementation to use'
89
90complete -x -c phpunit -l order-by -a 'default defects duration no-depends random reverse size' -d 'Run tests in order'
91complete -x -c phpunit -l random-order-seed -d 'Use a specific random seed for random order'
92complete -f -c phpunit -l cache-result -d 'Write test results to cache file'
93complete -f -c phpunit -l do-not-cache-result -d 'Do not write test results to cache file'
94
95# Configuration Options:
96complete -x -c phpunit -l prepend -d 'A PHP script that is included as early as possible'
97complete -x -c phpunit -l bootstrap -d 'A PHP script that is included before the tests run'
98complete -x -c phpunit -s c -l configuration -k -a '(__fish_complete_suffix .xml .xml.dist)' -d 'Read configuration from XML file'
99complete -f -c phpunit -l no-configuration -d 'Ignore default configuration file (phpunit.xml)'
100complete -f -c phpunit -l no-logging -d 'Ignore logging configuration'
101complete -f -c phpunit -l no-extensions -d 'Do not load PHPUnit extensions'
102complete -f -c phpunit -l include-path -d 'Prepend PHP\'s include_path with given path(s)'
103complete -x -c phpunit -s d -d 'Sets a php.ini value in the format key[=value]'
104complete -f -c phpunit -l generate-configuration -d 'Generate configuration file with suggested settings'
105complete -x -c phpunit -l cache-result-file -d 'Specify result cache path and filename'
106
107# Miscellaneous Options:
108complete -f -c phpunit -s h -l help -d 'Prints usage information'
109complete -f -c phpunit -l version -d 'Prints the version and exits'
110complete -x -c phpunit -l atleast-version -d 'Checks that version is greater than min and exits'
111complete -f -c phpunit -l check-version -d 'Check whether PHPUnit is the latest version'