Questions tagged [instrumentation]

The process of inserting extra diagnostic code during compilation of a given source code.

The process of inserting extra diagnostic code during compilation of a given source code. Instrumentation can involve adding extra debugging information or providing hooks into profilers and other utilities in order to provide extra feedback to the developer.

1193 questions
11
votes
5 answers

Wrapping a function in Javascript / jQuery

If I have an arbitrary function myFunc, what I'm aiming to do is replace this function with a wrapped call that runs code before and after it executes, e.g. // note: psuedo-javascript var beforeExecute = function() { ... } var afterExecute =…
Greg Beech
  • 133,383
  • 43
  • 204
  • 250
11
votes
1 answer

UI instrumentation tests with proguard enabled

Let's say your app has a class Foo, and you are using this class on your app and your instrumentation code. But this class becomes obfuscated in the app APK, so your instrumentation code loses the reference to it. Is it possible to continue…
ademar111190
  • 14,215
  • 14
  • 85
  • 114
11
votes
5 answers

Slow down Espresso

this is regarding Espresso. I am successfully running integration test on a simulator. I think some tests are failing because it's running too fast. Is there a way to slowdown the execution/playback speeD?
11
votes
1 answer

What is the use of agentmain method in java instrumentation

I done some java bytecode instrumentation with -javaagent argument and premain method. But this is the first time i hear about agentmain method. I have some questions about this method. Here follows it. Both premain and agentmain method have same…
Anish Antony
  • 875
  • 3
  • 17
  • 35
11
votes
3 answers

How to pass an argument to an AndroidTestCase?

I've implemented an Instrumentation and an AndroidTestCase. For my tests I need to connect to an external WIFI device. I want the testers to be able to specify an SSID for the test to use. Giving the the command line (adb shell am instrument ...) to…
selalerer
  • 3,766
  • 2
  • 23
  • 33
10
votes
2 answers

C++ function instrumentation via clang++'s -finstrument-functions : how to ignore internal std library calls?

Let's say I have a function like: template void mysort( It begin, It end, Cmp cmp ) { std::sort( begin, end, cmp ); } When I compile this using -finstrument-functions-after-inlining with clang++ --version: clang…
ricky116
  • 744
  • 8
  • 21
10
votes
5 answers

Ignoring report generation for specific classes in cobertura maven plugin

I've been using Cobertura plugin for report generation and instrumentation (with surefire). Here is the issue I am facing: I am unable to make the plugin ignore report generation for specific classes in my project. PF below the related excerpt…
Neeraj
  • 8,408
  • 8
  • 41
  • 69
10
votes
5 answers

Jacoco maven plugin clogs up console with Exceptions-java.lang.IllegalStateException: class is already instrumented

I am working on sonar code coverage using Jacoco plugin and using power mock mockito combination to write JUnit test cases, while all goes well with the build when I run mvn clean install but the console shows a very very long stack trace chain…
Deepak S
  • 1,544
  • 3
  • 15
  • 33
10
votes
3 answers

Test recreating Android Activity using instrumentation and JUnit4

I want to write test for recreating activity. Performing rotation is optional. I want the test to be written in up-to-date version of testing framework "blessed" by Google. I am new to writing tests, so I want to learn basic, main-stream, well…
MateuszL
  • 2,751
  • 25
  • 38
10
votes
2 answers

determine size of object: best way to use instrumentation in scala/sbt

According to this question, the standard way to determine the memory size of an object in Java is by using java.lang.instrumentation. After to some research, it looks like there is no Scala specific way to achieve this, so the Java approach should…
bluenote10
  • 23,414
  • 14
  • 122
  • 178
9
votes
3 answers

Visual Studio 2010 crash when profiling, after analyzing report

I am profiling my C# WinForm project in VS 2010, SP1. IDE crashes after profilig is finished and analyzing is done, but results are not yet displayed. I can manualy process my report by cmd: >VSPerfReport.exe /summary:all "Report111229(4).vsp" but i…
watbywbarif
  • 6,487
  • 8
  • 50
  • 64
9
votes
1 answer

LLVM Pass to insert an external function call to LLVM bitcode

I am writing an LLVM pass to instrument a C source program. I want to insert a function call before each branch instruction which calls an external function like this : void print(int x){ printf("x = %d\n", x); return; } I want to link…
Ali94
  • 205
  • 2
  • 12
9
votes
5 answers

Is Object constructor called when creating an array in Java?

In Java, an array IS AN Object. My question is... is an Object constructor called when new arrays is being created? We would like to use this fact to instrument Object constructor with some extra bytecode which checks length of array being…
Peter Štibraný
  • 32,463
  • 16
  • 90
  • 116
9
votes
1 answer

How to instrument java system classes?

I'm trying to add custom behaviour to system classes (FileInputStream/FileOutputStream). I wrote custom ClassFileTransformer with the following transform method: public byte[] transform(ClassLoader arg0, String arg1, Class arg2, ProtectionDomain…
9
votes
2 answers

Python: How to compare two binary files?

In python I need to print a diff of two binary files. I was looking at difflib.Differ which does a lot. However differ assumes lines of text and so the output does not list the byte index and the hex value difference. What I need is output that has…
Trevor Boyd Smith
  • 18,164
  • 32
  • 127
  • 177