<@U8V0LGNHH> 1. IMO, it is more convenient to use...
# kontributors
d
@Gregory Golda 1. IMO, it is more convenient to use IDEA for debugging rather than launching tests from command line. All tests should have usual "Run ..."-icon in gutter (just do not forget to set "Delegate IDE build/run actions to gradle") 2. Most of our test-runners are generated automatically based on testdata files (you can find them in
compiler/testData
for compiler and in
idea/testData
for IDE). Testdata files are essentially kotlin code, with, possibly, some additional markup (e.g. indicating that some diagnostic should be reported here, etc.) 3. Generated runner-classes usually end with "Generated"-suffix, like
DiagnosticTestGenerated
. They are very simple themselves and usually consist of a bunch of one-line methods, like
doTest(...)
. Most of the test-case logic is implemented in their supertypes, like
AbstractDiagnosticTest
4. If you want to add your own test, you can create your testdata, e.g. in
compiler/testData
and run pre-defined run configuration from IDEA ("Generate Compiler Tests"). It will automatically discover new testdata and update runner (tip: it is easy to find which runner has been updated by looking at the git diff) After that, you can create your own test and start stepping through the compiler code. If you will have any further questions, don't hesitate to ask! Cheers! 🙂
👍 7
g
running "Generate Compiler Tests" returns a lot of compile errors, even in the unmodified master branch, is there some additional configuration step that is necessary? Also, are you really able to use IDEA to do anything with this project? I have 4xXeon, 24 GB RAM and SSD drive, and IDEA is unusable, everything is lagging, etc.
d
It seems like something went wrong with project importing. What IDEA and Kotlin plugin versions you're using?
g
IDEA Community 17.3, how do I check Kotlin plugin version?
I'm importing using README.md from master
I mean, instructions from README
ok, Kotlin plugin version looks like
Version: 1.2.20-release-IJ2017.3-1
d
This should be fine. I guess you did that a bunch of times -- but still, I suggest repeating everything once again from scratch (starting from the clean directory). Also, don't forget about
ant -f update_dependencies.xml
and
Refresh Gradle projects
in IDEA (and don't use gradle auto-import -- it should work fine, but let's try to eliminate that factor)
g
yeah, I've tried it ~30 times in different ways
on Windows and on Arch Linux
and can't get it to work properly
d
Also, don't use pop-up with "Configure Kotlin project" -- it should be configured by the means of Gradle.
g
will try some more then
but please confirm - when you are using IDEA, is it working fine, without constant lags, etc?
d
Oh, yes, of course, sorry for not mentioning that explicitly 🙂
g
thanks
d
FWIW, here's how I usually import our project in IDE: 1. Clone repo 2. Run
ant -f update_dependecies.xml
3. Open
kotlin
-folder in IDEA (just plain "open", not some "Import project" etc.) Here you should see that "Tree view" on the left is messed up and doesn't show whole folder tree -- this is because we haven't set up project properly yet. 4. Then, you do "File | New | Module from existing sources" and open
build.gradle.kts
just as readme suggests. Use default gradle wrapper, do not use auto-import. After that, a lot of gradle-stuff should be launched, as well as indexing. 5. After all processes are finished, just to be safe, hit "Refresh gradle projects". Then, project have to be imported properly: you should see whole tree view, modules, code highlighting, completion, etc. You may receive popups about gradle or maven projects. IRC, maven is used only for libraries, so if you're not going to work with them, you can ignore related notifications. You shouldn't receive any "Configure Kotlin in project"-suggestion, if they appear, then something went wrong.
g
Thanks. Yeah, I do it like this and receive "Configure Kotlin..." suggestions. Lot of files are red-underlined. Don't know how to diagnoze what the problem is, but will look into it more.
I've managed to get it working. Needed to purge everything before new fresh start, and tweaking VM options for IDEA. Seems to work better now, thanks! Got some help from Simon too.
d
Can you share, what VM options you've tweaked? I guess,
-Xmx
, maybe something else? This can be useful for other kontributors; also we might consider to add it somewhere in github.
g
yes, -xmx, I have 2048m now
👍 1
Hm, but after restarting IDEA
I get again
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
Configure modules in 'kotlin' project
events
Version of Kotlin runtime is outdated in several libraries (Gradle: org.jetbrains.kotlinkotlin stdlib1.1.51, unknown library, Gradle: org.jetbrains.kotlinkotlin runtime1.0.5, unknown library). Plugin version is 1.2.20-release-IJ2017.3-1. Runtime libraries should be updated to avoid compatibility problems.
but it seems to not interfere with anything
GEnerate All Tests finished its work without errors, so it's better than it was
but now I have a question
what do I need to do for Generate All Tests to generate something for me? I have added an abstract class mimicking the one in allopen plugin, some testData, etc.
but there is no test generated
should something be put somewhere in gradle files?
or some non-obvious naming convention used?
d
No, there are no naming conventions (well, aside from putting new testdata in the corresponding
testData
-folder), and no additional build configuration is required (given that you do not implement your own test runner, of course)
g
yeah, I've managed to get it working