akisaarinen / smartdiet

SmartDiet analysis toolkit for Android
GNU General Public License v3.0
13 stars 4 forks source link

Failed tests while running assembly:assembly #1

Open rashidfatah opened 12 years ago

rashidfatah commented 12 years ago

I get the following message at the end after running assembly:assembly at the sbt console

[error] Failed: : Total 27, Failed 2, Errors 0, Passed 25, Skipped 0 [error] Failed tests: [error] fi.akisaarinen.smartdiet.measurement.pt4.Pt4FileReaderSpec [error] {file:/home/raashid/Downloads/akisaarinen-smartdiet-5473ba3/}default-6798b7/assembly:test: Tests unsuccessful [error] Total time: 3 s, completed 10 Apr, 2012 5:37:34 PM

akisaarinen commented 12 years ago

Thanks for reporting the error. On what platform are you running the tests? I just checked and the test suite succeeds on my 64-bit Ubuntu 10.10.

akisaarinen commented 12 years ago

Tests also seem to pass on Mac OS X Lion.

rashidfatah commented 12 years ago

Thanks for your quick reply. I am running the tests on ubuntu 11.04 virtual machine.

akisaarinen commented 12 years ago

Ok, is the a 32-bit version? This seems like a bit fiddling bug related to 32 vs 64 bit systems. I have only used SmartDiet on 64bit environments.

My guess is that the reading of Monsoon PowerMonitor PT4 binary files is broken on 32bit systems. I can take a look at fixing that later this week, but for now there are two things you can try if you want:

1) just create the jar while skipping tests, in case you don't need the Monsoon PowerMonitor related features of SmartDiet. My guess is that all other features work just fine. You can do this by adding the following to build.sbt:

test in assembly := {}

2) install 64-bit version of Ubuntu to your virtual machine, it probably works.

If you are already running a 64-bit system then I am a bit baffled what is causing this. In any case, I can check this later this week.

rashidfatah commented 12 years ago

I have tried with Ubuntu 64-bit and i get that same Monsoon PowerMonitor PT4 error. I tried skipping the tests and creating the jar. The jar was created successfully. But I faced an error : "Error: Unable to access jarfile smartdiet-0.1.jar" while running the command : "java -jar smartdiet-0.1.jar --java-all"

akisaarinen commented 12 years ago

Did you run that command in the right directory where the jar was created? It should appear under the target directory. That error looks like java did not find the file (smartdiet-0.1.jar).

By the way, what features of SmartDiet are you planning to use and for what purpose? Just asking out of curiosity.

rashidfatah commented 12 years ago

Yes, I was in the wrong directory. Now, after running the command i get the following error:

$ java -jar smartdiet-0.1.jar --java-all --ppcsv /home/raashid/Downloads/akisaarinen-smartdiet-5473ba3/sources.json id,path,packet_count,packet_bytes,packet_timespan_ms,est_wlan_mj,est_umts_mj,pt_count,pt_timespan_ms,pt_mj java.io.FileNotFoundException: /home/raashid/Downloads/akisaarinen-smartdiet-5473ba3/sources.json/dmesg.out (Not a directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:138) at scala.io.Source$.fromFile(Source.scala:91) at scala.io.Source$.fromFile(Source.scala:76) at scala.io.Source$.fromFile(Source.scala:54) at fi.akisaarinen.smartdiet.measurement.networkpacket.DmesgReader$.readFromFile(DmesgReader.scala:50) at fi.akisaarinen.smartdiet.energyusage.EnergyUsageAnalyzer$.analyzeAtTriggers(EnergyUsageAnalyzer.scala:164) at fi.akisaarinen.smartdiet.energyusage.EnergyUsageAnalyzer$$anonfun$15.apply(EnergyUsageAnalyzer.scala:177) at fi.akisaarinen.smartdiet.energyusage.EnergyUsageAnalyzer$$anonfun$15.apply(EnergyUsageAnalyzer.scala:176) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) at scala.collection.immutable.List.foreach(List.scala:45) at scala.collection.TraversableLike$class.map(TraversableLike.scala:194) at scala.collection.immutable.List.map(List.scala:45) at fi.akisaarinen.smartdiet.energyusage.EnergyUsageAnalyzer$.printCsvAnalysisForEcScriptOutputs(EnergyUsageAnalyzer.scala:176) at fi.akisaarinen.smartdiet.SmartDiet$.main(SmartDiet.scala:92) at fi.akisaarinen.smartdiet.SmartDiet.main(SmartDiet.scala) Error in analysis: java.io.FileNotFoundException: /home/raashid/Downloads/akisaarinen-smartdiet-5473ba3/sources.json/dmesg.out (Not a directory) java.io.FileNotFoundException: /home/raashid/Downloads/akisaarinen-smartdiet-5473ba3/sources.json/dmesg.out (Not a directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:138) at scala.io.Source$.fromFile(Source.scala:91) at scala.io.Source$.fromFile(Source.scala:76) at scala.io.Source$.fromFile(Source.scala:54) at fi.akisaarinen.smartdiet.measurement.networkpacket.DmesgReader$.readFromFile(DmesgReader.scala:50) at fi.akisaarinen.smartdiet.energyusage.EnergyUsageAnalyzer$.analyzeAtTriggers(EnergyUsageAnalyzer.scala:164) at fi.akisaarinen.smartdiet.energyusage.EnergyUsageAnalyzer$$anonfun$15.apply(EnergyUsageAnalyzer.scala:177) at fi.akisaarinen.smartdiet.energyusage.EnergyUsageAnalyzer$$anonfun$15.apply(EnergyUsageAnalyzer.scala:176) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) at scala.collection.immutable.List.foreach(List.scala:45) at scala.collection.TraversableLike$class.map(TraversableLike.scala:194) at scala.collection.immutable.List.map(List.scala:45) at fi.akisaarinen.smartdiet.energyusage.EnergyUsageAnalyzer$.printCsvAnalysisForEcScriptOutputs(EnergyUsageAnalyzer.scala:176) at fi.akisaarinen.smartdiet.SmartDiet$.main(SmartDiet.scala:92) at fi.akisaarinen.smartdiet.SmartDiet.main(SmartDiet.scala) Total time used for analysis: 150 ms

I have compiled a sample Chess application in eclipse and i have set all the paths in the sources.json file. I unable to figure out the cause of the error.

I would like to use all features of Smart-Diet as I am a research student working in the area of "Mobile Cloud computing". I would also like to know if there is any possibility of doing energy analysis of the application in the Android emulator without using a Nexus phone? Thank you.

rashidfatah commented 12 years ago

The issues are solved now. We are able to compile the application and get the constraint analysis output. I would also like to know if there is any possibility of doing energy analysis of the application in the Android emulator without using a Nexus phone? Thanks.

akisaarinen commented 12 years ago

Hi,

great to hear that you are progressing!

I am afraid that realistic energy analysis in the Android emulator might be impossible. In theory you can probably make the energy analysis software run, but at least when I last tried (Android 2.x series), the emulator was way too slow to perform any realistic measurements. In other words, you can get some numbers, but they do not tell much about the energy consumption because the program is running so slowly.

I think the performance of the emulator has been improved (maybe even significantly) since I last attempted using it for energy analysis, but I am very sceptical whether it is still fast enough for getting meaningful results.

By the way, you can also reach me through email if you want. You can find my address from http://akisaarinen.fi.