File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,22 @@ composer test:run
4040
4141This is included in ` composer ci ` to run the CI checks locally.
4242
43+ ### Run a specific test
44+
45+ If you want to run tests for one specific exercise, you can do it with following cli command.
46+
47+ ``` shell
48+ composer test:run -- exercise-name
49+ # e.g
50+ composer test:run -- book-store
51+ ```
52+
53+ If you want to run all starting with let's say 'b' you can run
54+
55+ ``` shell
56+ composer test:run -- " b*"
57+ ```
58+
4359## Running Style Checker
4460
4561This project uses a slightly [ modified] [ local-file-phpcs-config ] version of [ PSR-12] .
Original file line number Diff line number Diff line change @@ -13,15 +13,20 @@ file_ext="php"
1313function main {
1414 has_failures=0
1515
16- all_practice_exercise_dirs=$( find ./exercises/practice -maxdepth 1 -mindepth 1 -type d | sort)
16+ name_filter=()
17+ if [ $# -ge 1 ] && [ -n " $1 " ]; then
18+ name_filter=(" -name" " $1 " )
19+ fi
20+
21+ all_practice_exercise_dirs=$( find ./exercises/practice -maxdepth 1 -mindepth 1 -type d " ${name_filter[@]} " | sort)
1722 for exercise_dir in $all_practice_exercise_dirs ; do
1823 test " ${exercise_dir} " " example"
1924 if [[ $? -ne 0 ]]; then
2025 has_failures=1
2126 fi
2227 done
2328
24- all_concept_exercise_dirs=$( find ./exercises/concept -maxdepth 1 -mindepth 1 -type d | sort)
29+ all_concept_exercise_dirs=$( find ./exercises/concept -maxdepth 1 -mindepth 1 -type d " ${name_filter[@]} " | sort)
2530 for exercise_dir in $all_concept_exercise_dirs ; do
2631 test " ${exercise_dir} " " exemplar"
2732 if [[ $? -ne 0 ]]; then
You can’t perform that action at this time.
0 commit comments