Commit Graph

17 Commits

Author SHA1 Message Date
Ryan Nowak 0481cc6569 Fix travis
We were missing the newline normalization from the test base class.
2017-04-06 11:26:52 -07:00
Ryan Nowak 0cb7ae7fbf Add support for namespace tokens in extensible directives
This change adds support for accepting a namespace name in extensible
directives. This will be needed for the @namespace directive.

Implemented new parsing and codegen for namespaces using nameof().

Also fixed any issue where we were not global::-qualifying object where it
was used in the design time code for tokens.
2017-04-05 15:37:50 -07:00
Pranav K 12a502d775 Move FileSystemRazorProject into Razor.Evolution
Add tests
2017-02-28 14:15:52 -08:00
Pranav K a6d611aecd Introduce RazorCompilation 2017-02-22 10:22:18 -08:00
Doug Bunting 4861ef3391 Bump test projects up to .NET 4.5.2
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- build tests for desktop .NET only on Windows
2017-02-14 08:48:29 -08:00
Ryan Nowak 0dbf62196c Introduces RuntimeTarget and abstraction for APIs
This is a new abstraction that represents the api surface available for
codegen to target. Every kind of document should have an associated
RuntimeTarget or just use the default.

To prevent breakage, our DocumentClassifierBase class will provide a
default API set to implementors (like MVC).

I haven't fundamentally changed how codegen is done yet, I've just hidden
it behind a new abstraction. The RuntimeTarget now is also responsible for
selecting between design time and runtime.

The bulk of the noise here is from splitting a lot of the codegen stuff
into its own files.
2017-02-13 15:34:51 -08:00
Ajay Bhargav Baaskaran 7725c20c47 Enabled Razor.Evolution tests on linux 2017-01-26 12:34:35 -08:00
Ryan Nowak 4a49ee2164 Adds support for imports to IR lowering
This change adds support for 'imports' - extra source files which contain
directives that can merged with 'main' source files. The purpose of course
is to support things like global usings or addTagHelpers, like
_ViewImports in MVC does today.

Instead of a one-off this is now a feature of the Razor langugage since
things like addTagHelper have an impact on the parsing behavior. Also,
having a standard imports concept keeps out feature creep, for instance
the 'global' usings we have today could really just be an import.

Imports allow single-line directives including the fundamental directives
like addTagHelper, using, and other friends. Code, content, and block
directives are not merged and will be ignored. We can consider making
these kinds of things warnings in the future.
2017-01-20 10:43:53 -08:00
Ryan Nowak d7527d2e0a Create new way of suppressing unique Id generation
Adds a way of suppressing generation of guid ids that isn't based on a
global static.
2017-01-17 11:06:41 -08:00
Ajay Bhargav Baaskaran ffd455b77e Adds Instrumentation support
Instrumentation is added as an optional pass that can be configured by
MVC.
2017-01-11 17:27:52 -08:00
N. Taylor Mullen ead9692ab1 Disable Cross plat tests for design time code gen tests. 2017-01-09 15:25:38 -08:00
N. Taylor Mullen f47a40a4a7 Add Razor design time code generation.
- Added a common csharp rendering phase base to put shared assets of runtime and design time code gen.
- Added a new `DesignTimeIRPass` to setup the IR bits to provide accurate intellisense.
- Added a `CodeGenerationIntegrationTest` and moved the RuntimeCodeGenerationTests into it. This way we can re-use the cshtml files and it makes searching/running the tests easy..
- Updated how line mappings are calculated for some nodes.

#848
2016-12-27 11:06:58 -08:00
N. Taylor Mullen 88d99b06b3 Skip Razor.Evolution tests on Linux and Mac.
- Source ranges currently aren't normalized when they're input into the system. Due to how we serialize pieces of the code this breaks cross plat because of newline differences.
- This is a temporary work around to get the build passing cross plat.
2016-12-19 15:03:32 -08:00
Nate McMaster 705a490acb Upgrade to VS 2017 2016-12-16 16:04:22 -08:00
N. Taylor Mullen eb230e0408 Port existing CSharp code generation integration tests.
- Added code generation test infrastructure to validate ported tests.

#847
2016-12-14 11:18:31 -08:00
N. Taylor Mullen 18bb31cee4 Change IntegrationTestBase to properly locate baseline files in net451.
- Net451 tests would have their current directory set to the dll that was located in bin/debug/framework/rid/... when run via `dotnet test`.

#885
2016-12-07 16:29:50 -08:00
Ryan Nowak 853c28e568 Add integration testing
This change adds a basic framework for doing baselined integration tests.
This is very similar to what we do elsewhere with generated files and
tests that read them from resources.

What's here now is the support to do this kind of baselining with IR in a
pretty readable serialization format.

This is a building block and the intent is that we'd do something similar
in the future for syntax nodes and C# source.

Looking at the code of the tests in particular, we'll also build the
ability to capture the documents at key points (such as before/after a
targeted phase) and then verify them in the same manner.
2016-12-06 11:25:04 -08:00