Comments (13)
I have just pushed a commit that should fix this issues. I used the chance to rethink some of the assumptions I made in the code. I attached the current zip file in case you want to immediately try it it out. Make sure to uninstall the current version of the plugin and then in the plugins menu click on the gear next to Installed
and then Install Plugin from disk
and simply select the zip file.
I'll likely upload the changes to Jetbrains plugin repository and release a version tomorrow morning (in 24 hours). After that it usually takes a maximum of 2 business days for Jetbrains to approve it and push the plugin update.
C C++ Coverage-2020.3.1.zip
from c-cpp-coverage-for-clion.
Wow - thanks Markus (I assume, from your email address on your account here...)
I've set up the new version, I'll let you know how it goes.
from c-cpp-coverage-for-clion.
Hi, thanks very much indeed for this...
Initial experiments with it looked promising, and then I got a traceback... so I'll make notes here, and see if I can figure out a repro..
The traceback:
java.util.concurrent.ExecutionException: com.intellij.openapi.progress.ProcessCanceledException
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at net.zero9178.cov.data.LLVMCoverageGenerator.processRoot(LLVMCoverageGenerator.kt:209)
at net.zero9178.cov.data.LLVMCoverageGenerator.processJson(LLVMCoverageGenerator.kt:154)
at net.zero9178.cov.data.LLVMCoverageGenerator.generateCoverage(LLVMCoverageGenerator.kt:592)
at net.zero9178.cov.CoverageConfigurationExtension$attachToProcess$1$processTerminated$2.run(CoverageConfigurationExtension.kt:140)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:472)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.intellij.openapi.progress.ProcessCanceledException
at com.jetbrains.cidr.lang.parser.OCParser.computeSyncWithEDTPriority(OCParser.java:353)
at com.jetbrains.cidr.lang.parser.OCParser.parse(OCParser.java:198)
at com.jetbrains.cidr.lang.parser.OCFileElementType.parseContents(OCFileElementType.java:23)
at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:192)
at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:567)
at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:191)
at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:242)
at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:42)
at com.intellij.psi.impl.source.tree.SharedImplUtil.getFirstChild(SharedImplUtil.java:37)
at com.intellij.psi.impl.source.PsiFileImpl.getFirstChild(PsiFileImpl.java:744)
at net.zero9178.cov.data.LLVMCoverageGenerator$findStatementsForBranches$1$1.visitElement(LLVMCoverageGenerator.kt:392)
at net.zero9178.cov.data.LLVMCoverageGenerator$findStatementsForBranches$1.compute(LLVMCoverageGenerator.kt:514)
at net.zero9178.cov.data.LLVMCoverageGenerator$findStatementsForBranches$1.compute(LLVMCoverageGenerator.kt:37)
at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$0(DumbService.java:103)
at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$1(DumbService.java:147)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:889)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61)
at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:140)
at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:103)
at net.zero9178.cov.data.LLVMCoverageGenerator.findStatementsForBranches(LLVMCoverageGenerator.kt:367)
at net.zero9178.cov.data.LLVMCoverageGenerator.processFunctions(LLVMCoverageGenerator.kt:281)
at net.zero9178.cov.data.LLVMCoverageGenerator.access$processFunctions(LLVMCoverageGenerator.kt:37)
at net.zero9178.cov.data.LLVMCoverageGenerator$processRoot$$inlined$flatMap$lambda$1.get(LLVMCoverageGenerator.kt:207)
at net.zero9178.cov.data.LLVMCoverageGenerator$processRoot$$inlined$flatMap$lambda$1.get(LLVMCoverageGenerator.kt:37)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
from c-cpp-coverage-for-clion.
Steps done:
- Delete all configurations with coverage on - both in CMake settings. and on disk
- Select Debug-clang+llvm-11
- Run with C//C++ Coverage Plugin
- Click "Create" on the missing compilation flags dialog - and wait for CMake project to reload
[I think the 'Missing compilation flags' popup didn't disappear after the new profile had loaded. - Run the CLion coverage button
CLion coverage results updated correctly - Run the C/C++ Coverage Plugin
No results displayed - red exclamation warning shows up at bottom right
Traceback
java.util.concurrent.ExecutionException: com.intellij.openapi.progress.ProcessCanceledException
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at net.zero9178.cov.data.LLVMCoverageGenerator.processRoot(LLVMCoverageGenerator.kt:209)
at net.zero9178.cov.data.LLVMCoverageGenerator.processJson(LLVMCoverageGenerator.kt:154)
at net.zero9178.cov.data.LLVMCoverageGenerator.generateCoverage(LLVMCoverageGenerator.kt:592)
at net.zero9178.cov.CoverageConfigurationExtension$attachToProcess$1$processTerminated$2.run(CoverageConfigurationExtension.kt:140)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:472)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.intellij.openapi.progress.ProcessCanceledException
at com.jetbrains.cidr.lang.parser.OCParser.computeSyncWithEDTPriority(OCParser.java:353)
at com.jetbrains.cidr.lang.psi.impl.OCLazyElementBase.getFirstChildNode(OCLazyElementBase.java:144)
at com.intellij.psi.impl.source.tree.LazyParseablePsiElement.getFirstChild(LazyParseablePsiElement.java:88)
at net.zero9178.cov.data.LLVMCoverageGenerator$findStatementsForBranches$1$1.visitElement(LLVMCoverageGenerator.kt:392)
at com.jetbrains.cidr.lang.psi.visitors.OCVisitor.visitOCElement(OCVisitor.java:13)
at com.jetbrains.cidr.lang.psi.visitors.OCVisitor.visitStatement(OCVisitor.java:25)
at com.jetbrains.cidr.lang.psi.visitors.OCVisitor.visitBlockStatement(OCVisitor.java:33)
at com.jetbrains.cidr.lang.psi.impl.OCLazyBlockStatementImpl.accept(OCLazyBlockStatementImpl.java:28)
at com.jetbrains.cidr.lang.psi.impl.OCLazyElementBase.accept(OCLazyElementBase.java:78)
at net.zero9178.cov.data.LLVMCoverageGenerator$findStatementsForBranches$1$1.visitElement(LLVMCoverageGenerator.kt:396)
at net.zero9178.cov.data.LLVMCoverageGenerator$findStatementsForBranches$1$1.visitElement(LLVMCoverageGenerator.kt:398)
at net.zero9178.cov.data.LLVMCoverageGenerator$findStatementsForBranches$1$1.visitElement(LLVMCoverageGenerator.kt:398)
at net.zero9178.cov.data.LLVMCoverageGenerator$findStatementsForBranches$1.compute(LLVMCoverageGenerator.kt:514)
at net.zero9178.cov.data.LLVMCoverageGenerator$findStatementsForBranches$1.compute(LLVMCoverageGenerator.kt:37)
at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$0(DumbService.java:103)
at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$1(DumbService.java:147)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:889)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61)
at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:140)
at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:103)
at net.zero9178.cov.data.LLVMCoverageGenerator.findStatementsForBranches(LLVMCoverageGenerator.kt:367)
at net.zero9178.cov.data.LLVMCoverageGenerator.processFunctions(LLVMCoverageGenerator.kt:281)
at net.zero9178.cov.data.LLVMCoverageGenerator.access$processFunctions(LLVMCoverageGenerator.kt:37)
at net.zero9178.cov.data.LLVMCoverageGenerator$processRoot$$inlined$flatMap$lambda$1.get(LLVMCoverageGenerator.kt:207)
at net.zero9178.cov.data.LLVMCoverageGenerator$processRoot$$inlined$flatMap$lambda$1.get(LLVMCoverageGenerator.kt:37)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
The traceback in the previous comment was also generated with this sequence of steps.
from c-cpp-coverage-for-clion.
The "happy path" works well:
- Restart CLion (2020.3, still)
- Delete all configurations with coverage on - both in CMake settings. and on disk
- Select Debug-clang+llvm-11
- Run with C//C++ Coverage Plugin
- Click "Create" on the missing compilation flags dialog - and wait for CMake project to reload
- Run the C/C++ Coverage Plugin
Success - results are displayed
It does seem that the traceback might be to do with running the CLion run-with-coverage button before running the Plugin's run-with-coverage button.
from c-cpp-coverage-for-clion.
Last I looked into this it was related to CLion being under high load as other tasks are running (due to say indexing or otherwise). Waiting for those to stop before running coverage would be a workaround.
I will try to look into this again and hope I can somehow give coverage higher priority so that CLion doesn't try to cancel it.
from c-cpp-coverage-for-clion.
I should say that today I am testing it on a slightly larger project than over the last few days... so that may well be related...
from c-cpp-coverage-for-clion.
In the interests of full disclosure - about the amount of your time that I am using on this project - I thought I should let you know that this CLion ticket seems to be getting a lot of attention at the moment, in terms of the number of email messages I've been receiving about it changing state (to test, to dev etc)
Add proper branch coverage:
https://youtrack.jetbrains.com/issue/CPP-22202
I'd hate for you to spend loads of time on this, only to find that a CLion update makes this plugin redundant...
(The gap in functionality between the two options is currently so great that I think it's probably unlikely that the new CLion feature will overtake the plugin... but I did feel compelled to make sure you were aware that JetBrains is working on this...)
from c-cpp-coverage-for-clion.
I should say that today I am testing it on a slightly larger project than over the last few days... so that may well be related...
I'l go back to testing the previous project, and see what happens...
from c-cpp-coverage-for-clion.
Last I looked into this it was related to CLion being under high load as other tasks are running (due to say indexing or otherwise). Waiting for those to stop before running coverage would be a workaround.
Yes, still on the larger project, if I leave a longer gap between running CLion coverage and then plugin coverage, the plugin coverage works fine.
[I tried reproducing it working fine, and got a CLion low-memory warning]
from c-cpp-coverage-for-clion.
Rats - I've just realised that all these comments today should have gone in to #25... Sorry.
from c-cpp-coverage-for-clion.
In the interests of full disclosure - about the amount of your time that I am using on this project - I thought I should let you know that this CLion ticket seems to be getting a lot of attention at the moment, in terms of the number of email messages I've been receiving about it changing state (to test, to dev etc)
Add proper branch coverage:
https://youtrack.jetbrains.com/issue/CPP-22202I'd hate for you to spend loads of time on this, only to find that a CLion update makes this plugin redundant...
(The gap in functionality between the two options is currently so great that I think it's probably unlikely that the new CLion feature will overtake the plugin... but I did feel compelled to make sure you were aware that JetBrains is working on this...)
Don't worry about it. I am also quite actively looking at CLions bug tracker so I do know they are working on it. Unless they are equal on features, that is both in terms of annotating branch coverage as well as the nice region coverage clang provides, I am not planning to stop development on this plugin. And if they do end up finally having all those features I will likely be celebrating! I would rather have a great coverage functionality in CLion than an ego boost due to downloads on my plugin. Any time I spend on it I do for fun and I see as already worthwhile. Although I do admit that seeing bug reports as well as people using the plugin gives me more motivation and more of an incentive to work on it as opposed to other projects of mine.
from c-cpp-coverage-for-clion.
That's really kind - thank you very much!
from c-cpp-coverage-for-clion.
Related Issues (20)
- net.zero9178.cov.data.LLVMCoverageGenerator: lass java.lang.Integer cannot be cast to class java.lang.Boolean HOT 5
- Crash when runnig gcov HOT 1
- Documentation seems incorrect for clang 9 HOT 2
- Exception in CLion HOT 3
- Viewing coverage for library targets HOT 1
- Running into exception when defining llvm-cov path HOT 2
- [2.11] Exception with Clang(8/9) HOT 3
- No llvm-profdata specified to accompany llvm-cov on macOS HOT 8
- Remote Host Support
- 0% files, 0% lines covered. HOT 1
- Questions about usage, as a novice user HOT 9
- Small suggestion: Clearer tooltip on the Run action? HOT 2
- Maybe provide feedback if no results after clicking Plugin's action HOT 2
- Function names not demangled - how do I fix my settings? HOT 10
- Create button not visible in the "Missing compilation flags" message
- The plugin does not work with some light CLion themes HOT 1
- [1.1.3] String index out of range: -1
- gcov called with -b arg even though branch coverage is disabled HOT 4
- WSL support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c-cpp-coverage-for-clion.