Skip to content

Commit 93557df

Browse files
committed
use file headers to determine test name
1 parent 7d73099 commit 93557df

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

tests/run-test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -e
23

34
RULESET=$1
45
TEST_FILE=$2
@@ -13,7 +14,11 @@ if [ ! -f "$TEST_FILE" ]; then
1314
exit 1
1415
fi
1516

16-
echo "Running test: $TEST_FILE with ruleset: $RULESET"
17+
TEST_NAME=$(sed -n '3s/ \* //p' "$TEST_FILE")
18+
19+
echo ""
20+
echo "Running test: $TEST_NAME with ruleset: $RULESET"
21+
echo "$TEST_FILE"
1722

1823
# Use --basepath=. to ensure relative paths in the report.
1924
JSON_REPORT=$(phpcs --standard="./$RULESET/ruleset.xml" --report=json --basepath=. "$TEST_FILE" 2>/dev/null | sed -n '/{/,$p')

tests/test-disallow-multiline-slash-comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Disallow usage of multiline slash comments.
3+
* Multiline comments should use /* syntax.
44
*
55
* @expectedWarning[Pantheon-WP-Minimum] Pantheon_WP_Minimum.Commenting.DisallowMultilineSlashComment.Found
66
* @expectedError[Pantheon-WP] Pantheon_WP.Commenting.DisallowMultilineSlashComment.Found

tests/test-disallow-rename-function.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* DisallowRenameFunctionTest.inc
3+
* Disallow usage of the rename() function.
44
*
55
* @expectedError[Pantheon-WP-Minimum] Pantheon_WP_Minimum.Files.DisallowRenameFunction.RenameFunctionDisallowed
66
* @expectedError[Pantheon-WP] Pantheon_WP_Minimum.Files.DisallowRenameFunction.RenameFunctionDisallowed

0 commit comments

Comments
 (0)