Skip to content

Conversation

@vzarytovskii
Copy link
Member

@vzarytovskii vzarytovskii commented Sep 11, 2020

F# scripts can be evaluated via

  • New framework function eval, takes CompilationUnit, returns result of evaluation (uses FSharpScript.Eval under the hood) - returns result of evaluation + diagnostics + FsiValue, which can be examined (for now, only 2 functions were added, for checking type and value, withEvalTypeEquals and withEvalValueEquals respectively. More can be added later as needed.)

  • New framework function runFsi, takes CompilationUnit, returns result of evaluation (uses FsiEvaluationSession.EvalInteractionNonThrowing under the hood) - will just run the script and return the result + output. Does not return FSharpErrorInfo, so need to check STDERR explicitly via withStdErrContains. Basically, a wrapper around CompilerAssert's RunScriptWithOptions.

Addresses #9836


function TestUsingXUnit([string] $testProject, [string] $targetFramework, [string]$testadapterpath) {
TestUsingMsBuild -testProject $testProject -targetFramework $targetFramework -testadapterpath $testadapterpath -noTestFilter $false
TestUsingMsBuild -testProject $testProject -targetFramework $targetFramework -testadapterpath $testadapterpath -noTestFilter $true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't add tests filters, since xUnit doesn't understand it.

@vzarytovskii
Copy link
Member Author

Ugh, macOS timeouts strike again. Will re-queue.

Copy link
Contributor

@TIHan TIHan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor

@KevinRansom KevinRansom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, thanks for this.

Kevin

@KevinRansom KevinRansom reopened this Sep 11, 2020
@cartermp
Copy link
Contributor

mmmmmm yeah that lovely macos timeout, yeeeehaw

@cartermp cartermp closed this Sep 12, 2020
@cartermp cartermp reopened this Sep 12, 2020
@vzarytovskii vzarytovskii merged commit 1b5d58d into dotnet:main Sep 12, 2020
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
* Added fsx evaluation via the FSharpScript.Eval as well as FsiEvaluationSession.EvalInteractionNonThrowing

* Turn off test filter for XUnit, and add to NUnit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants