How to: Test Domain-Specific Language Solutions 

Visual Studio 2005

When you create a domain-specific language solution, you use the Domain-Specific Language Designer Wizard. After you finish the wizard, a solution is created that is based on the solution template that you specified. For more information, see How to: Create Domain-Specific Language Solutions.

Before you begin to modify your solution, you should test it. The procedure that you use to test the initial solution is the same procedure that you use to test your solution after you begin to modify it.

Your domain-specific language solution has two projects. One is named Dsl, and the other is named DslPackage. These two projects appear in Solution Explorer. If you look at your solution in Windows Explorer, you see a third folder called Debugging. The Debugging folder contains a separate debugging solution that you use to test your domain-specific language.

NoteNote

You do not open the debugging solution alone. You launch it from your domain-specific language solution.

To test a domain-specific language solution

  1. On the Build menu, click Build Solution.

  2. On the Debug menu, click Start Debugging.

    A new instance of the Visual Studio experimental build launches and opens the debugging solution. For more information about the experimental build, see Experimental Build.

  3. (Optional) In Solution Explorer, open the file named Sample. This file contains a sample model that is based on the same solution template on which your solution is based.

    NoteNote

    The Sample file has the extension that you entered in the wizard when you created your solution.

    NoteImportant

    After you modify your underlying solution, the Sample file might not be valid.

  4. (Optional) In Solution Explorer, two files have the extension .ReportTemplate. These files are sample text templates that are based on the same solution template on which your solution is based. Click one of the files, and expand its node. The file under it is the generated text output from the text template. Right-click the generated text file, and then click View in Browser. An HTML report appears and lists the objects in the Sample file.

  5. When you finish testing, close the experimental build to return to your underlying solution.

    You can now modify your solution to change the language. To test your changes, repeat this procedure.

Adding Models to Your Debugging Project

Whether you have just created a solution or you have already started to modify one, you can test how the domain-specific language behaves from your language user's point of view. You can use the debugging solution to add a model and exercise the language to verify that it works correctly.

To add a model to your project and exercise the language

  1. On the Build menu, click Build Solution.

  2. On the Debug menu, click Start Debugging.

    A new instance of the Visual Studio experimental build launches and opens the debugging solution. For more information about the experimental build, see Experimental Build.

  3. In Solution Explorer, right-click the project node, point to Add, and then click New Item.

    The Add New Item dialog box appears.

  4. Under Templates, scroll down to the My Templates section, and click the template that has the same name as your domain-specific language.

  5. Click Add.

    A model file is added to the project.

  6. On the View menu, click Toolbox.

    The Toolbox opens and displays tools that are appropriate for the solution template on which your solution is based. You can modify your language to add tools to the Toolbox.

  7. Drag items from the Toolbox to your new model, and test whether your domain-specific language is working correctly. You are now testing your language from the point of view of your language user.

  8. When you finish testing, close the experimental build to return to your underlying solution.

    You can now modify your solution to change the language. To test your changes, repeat this procedure.

Security

For more information, see Security of Text Templates.

See Also

Community Additions

ADD
Show: