Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Commit 3e3ced3

Browse files
authored
Merge pull request #315 from xwp/feature/run_tests
Let users supply their own test function
2 parents 420f1ba + c464950 commit 3e3ced3

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

sample-config/.dev-lib

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
function run_tests {
4+
# Run your custom checks before the default linters, tests, etc.
5+
}
6+
7+
function after_wp_install {
8+
# Run any customs code before PHPUnit checks, see `check-diff.sh`.
9+
}

scripts/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ install_tools
4343
echo "## Checking files, scope $CHECK_SCOPE:"
4444
cat "$TEMP_DIRECTORY/paths-scope"
4545

46+
# Run any custom checks by defining a run_tests function, see sample-scripts/.dev-lib
47+
if [ "$( type -t run_tests )" != '' ]; then
48+
run_tests
49+
fi
50+
4651
check_execute_bit
4752
lint_js_files
4853
lint_php_files

scripts/travis.script.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ if [[ -z $SKIP_ECHO_PATHS_SCOPE ]] && [[ $CHECK_SCOPE != "all" ]]; then
88
fi
99
echo
1010

11+
# Run any custom checks by defining a run_tests function, see sample-scripts/.dev-lib
12+
if [ "$( type -t run_tests )" != '' ]; then
13+
run_tests
14+
fi
15+
1116
check_execute_bit
1217
lint_js_files
1318
lint_php_files

0 commit comments

Comments
 (0)