-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes it possible to pass an arbitrary set of testscript files to be run instead of just a directory, making it possible for the testscript command to pass its command line arguments directly. In order to check that all the files are actually tested, we need to make the test harness implement independent subtest failure, and it's useful to see the name of the test too so that we can see the name disambiguation logic at work, which makes for changes to some of the other tests too. Note that the name deduping logic is somewhat improved from similar logic in cmd/testscript, in that it is always guaranteed to produce unique names even in the presence of filenames that look like deduped names.
- Loading branch information
Showing
8 changed files
with
111 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ env | |
cmpenv stdout stdout.golden | ||
|
||
-- stdout.golden -- | ||
** RUN script ** | ||
> cmp a b | ||
diff a b | ||
--- a | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,7 @@ cmpenv stdout stdout.golden | |
>a | ||
>a | ||
-- stdout.golden -- | ||
** RUN script ** | ||
> cmp a b | ||
diff a b | ||
--- a | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Check that we can pass an explicit set of files to be tested. | ||
! testscript -files foo.txtar x/bar.txtar y/bar.txtar 'y/bar#1.txtar' | ||
cmpenv stdout expect-stdout | ||
-- expect-stdout -- | ||
** RUN foo ** | ||
PASS | ||
** RUN bar ** | ||
PASS | ||
** RUN bar#1 ** | ||
> echoandexit 1 '' 'bar#1 failure' | ||
[stderr] | ||
bar#1 failure | ||
FAIL: $$WORK${/}y${/}bar.txtar:1: told to exit with code 1 | ||
** RUN bar#1#1 ** | ||
> echoandexit 1 '' 'bar#1#1 failure' | ||
[stderr] | ||
bar#1#1 failure | ||
FAIL: $$WORK${/}y${/}bar#1.txtar:1: told to exit with code 1 | ||
-- foo.txtar -- | ||
echoandexit 0 '' 'foo failure' | ||
-- x/bar.txtar -- | ||
echoandexit 0 '' 'bar failure' | ||
-- y/bar.txtar -- | ||
echoandexit 1 '' 'bar#1 failure' | ||
-- y/bar#1.txtar -- | ||
echoandexit 1 '' 'bar#1#1 failure' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters