-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1274 from stan-dev/fix/printed-filename
More consistently print requested file name in errors
- Loading branch information
Showing
11 changed files
with
95 additions
and
65 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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
(rule | ||
(targets filename_error.output) | ||
(deps | ||
(package stanc) | ||
(:stanfiles filename_error.stan filename_syntax_error.stan includes.stan)) | ||
(action | ||
(with-stdout-to | ||
%{targets} | ||
(run | ||
%{bin:run_bin_on_args} | ||
"%{bin:stanc} --filename-in-msg=foo.stan --include-paths=. " | ||
%{stanfiles})))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff filename_error.expected filename_error.output))) | ||
|
||
(rule | ||
(targets filename_good.output) | ||
(deps | ||
(package stanc) | ||
filename_good.stan) | ||
(action | ||
(with-stdout-to | ||
%{targets} | ||
(run | ||
%{bin:run_bin_on_args} | ||
"%{bin:stanc} --filename-in-msg=foo.stan --print-cpp " | ||
filename_good.stan)))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff filename_good.expected filename_good.output))) |
30 changes: 30 additions & 0 deletions
30
test/integration/cli-args/filename-in-msg/filename_error.expected
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,30 @@ | ||
$ ../../../../../install/default/bin/stanc --filename-in-msg=foo.stan --include-paths=. filename_error.stan | ||
Semantic error in 'foo.stan', line 3, column 17 to column 18: | ||
------------------------------------------------- | ||
1: transformed data { | ||
2: real p; | ||
3: real q = p + a; | ||
^ | ||
4: } | ||
------------------------------------------------- | ||
|
||
Identifier 'a' not in scope. | ||
$ ../../../../../install/default/bin/stanc --filename-in-msg=foo.stan --include-paths=. filename_syntax_error.stan | ||
Syntax error in 'foo.stan', line 2, column 4 to column 5, parsing error: | ||
------------------------------------------------- | ||
1: model { | ||
2: rea x = 3; | ||
^ | ||
------------------------------------------------- | ||
|
||
Ill-formed statement or expression. A statement or expression could be expected here. | ||
$ ../../../../../install/default/bin/stanc --filename-in-msg=foo.stan --include-paths=. includes.stan | ||
Syntax error in './filename_syntax_error.stan', line 2, column 4, included from | ||
'foo.stan', line 6, column 0, parsing error: | ||
------------------------------------------------- | ||
1: model { | ||
2: rea x = 3; | ||
^ | ||
------------------------------------------------- | ||
|
||
Ill-formed statement or expression. A statement or expression could be expected here. |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...tegration/cli-args/filename_good.expected → ...gs/filename-in-msg/filename_good.expected
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
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
test/integration/cli-args/filename-in-msg/filename_syntax_error.stan
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,2 @@ | ||
model { | ||
rea x = 3; |
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,6 @@ | ||
|
||
data { | ||
|
||
} | ||
|
||
#include "filename_syntax_error.stan" |
This file was deleted.
Oops, something went wrong.