How does one write software tests for DrRacket plugins? Considering that a plugin is essentially a unit in Racket, it cannot simply be called like a function.
There are a few options you can use here.
Create a dummy unit to link with -- basically a "mock". Then test using that.
Use DrRacket's test infrastructure to test the whole of DrRacket with your plugin. There's not much documentation for that, but you can see the source here: https://github.com/racket/drracket/tree/master/drracket-test/tests/drracket
Related
I am trying to write e2e integration tests for a vscode extension. I didn't find any ui integration tests. Can you please provide me the links if any
I recommend using extensions/vscode-api-tests/src/singlefolder-tests/editor.test.ts in the vscode sources as a starting point for integration tests. If that particular test isn't quite what you want, there are a bunch of tests adjacent to it that might be.
See also this answer I gave to a related question about using the API from within tests.
I am working on an Eclipse Plug-in which provides property auto-completions with a ICompletionProposalComputer contributed via the org.eclipse.wst.sse.ui.completionProposal.
I'd like to create automated tests for the functionality but have no idea where to start. How can I write automated tests for my proposal computer?
Some time ago a colleague and I had a similar problem while implementing a IContentAssistProcessor for a SourceViewer based editor in a console view.
We started with an integration test that simulated a Ctrl+Space key stroke within the console editor and expected a shell with a table that holds the proposal(s) to show up.
Here is such a test case: ConsoleContentAssistPDETest. It uses a ConsoleBot that encapusulates the key stroke simulation and a custom AssertJ assertion that hides the details of waiting for the shell to open and finding the table, etc. (ConsoleAssert)
With such a test in place we were able to implement a walking skeleton. We developed individual parts of the content proposal code test-driven with unit tests.
Instead of writing your own bot you may also look into SWTBot which provides an API to write UI/functional tests.
I ended up writing a simple SWTBot test. Once I have the editor open, it's pretty simple to get a list of autocompletions:
bot.editorByTitle("index.html").toTextEditor();
editor.insertText("<html>\n<div ></div>\n</html>");
editor.navigateTo(1, 5);
editor.getAutoCompleteProposals("")
When developing a Node.js application in Eclipse, you usually import your own modules with functionality tied to exports (append functions) or module.exports (allows popular object literal notation).
But how do you set this up for code completion in files where you import your module?
Module
As you can see in the outliner, Eclipse is "aware" of the function:
Yet importing the module as tools doesn't make it's functions available:
I also tried the oldskool //#import tools.js but it doesn't seem to work like this.
How do I get code completion for my own functions in my project?
#Jey Keu: this question has some suggestions towards our mutual dream of code completion, namely:
Amateras plugin
JSDT editor
Aptana Plugin
SPKET plugin
VJET plugin
But it was closed by a bunch of people who know nothing about Eclipse. Profiling is the basis of code completion. But they think profiling is unicorns and rainbows and therefore not constructive.
I think, depending on your specific development needs, that VJET is your best bet. If you can get it to work without destroying every other function within Eclipse, please share your wizardry in this question.
http://eclipse.org/vjet/
Do scala has a wrapper similar to http://antwrap.rubyforge.org/. I understand it would be quick easy to call ant methods directly from the REPL of as a script but was wondering if there is a DSL or wrapper around ant?
I think SBT is what yo are looking for essentially. It uses Scala 2.7 syntax but most of the time you barely need to write any script at all as long as you stick to a directory structure. It uses Ant and Ivy underneath and has excellent integration with Ant+Ivy and Maven based projects. You should definitely check it out. It's super easy to get started.
Update:
So I didn't read closely enough of the question it seems. I believe Gradle can do what you want. Gradle also has a Scala plugin. The downside is that this requires learning yet another language just to be able to write a build script. In the end you'll be using Groovy to write a Gradle build script that invokes an Ant build.xml that calls into Java to build a Scala project for you. This sounds like a lot of work.
BTW, you always have the choice to use JRuby and antwrap together. I don't want to know how slow this will be though.
As far as I have checked: No, there isn't.
Most people seem to use SBT, which has a slightly different feature set, but does an excellent job at building/running/deploying/testing/packaging.
I use Eclipse mainly for LSL (linden Scripting language). The plug-in for this language does not provide things like templates or task-tag recognition. Is there any way that these kind of features in LSL-files (or any other generic file/code for that matter) can be used?
Take look at the XText project. If you can define the grammar of LSL there it will generate full Eclipse plugin for it, complete with syntax Highlighting, code Completion, validation and quick Fixes and more.
Another one to try (one i use myself) is LSL Editor
Full Syntax highlighting, code suggest, and even a off world run time environment. plus able to test multiple scripts by building test objects with prims.
Take a Look :)
LSLForge is being actively maintained, and has most of what you describe. If there's something missing, the developer is always looking for new challenges.