Skip to content
Snippets Groups Projects
Commit 380f8bc4 authored by Florian Angerer's avatar Florian Angerer
Browse files

Implemented test for conditional breakpoints.

parent 66fe1b82
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import com.oracle.truffle.api.debug.Breakpoint;
......@@ -154,6 +155,39 @@ public class FastRDebugTest {
assertEquals("Factorial computed OK", 2, n.intValue());
}
/**
* Test is currently ignored because of missing functionality in Truffle.
*/
@Test
@Ignore
public void testConditionalBreakpoint() throws Throwable {
final Source source = RSource.fromTextInternal("main <- function() {\n" +
" for(i in seq(10)) {\n" +
" print(i)\n" +
" }\n" +
"}\n",
RSource.Internal.DEBUGTEST_DEBUG);
engine.eval(source);
run.addLast(() -> {
assertNull(suspendedEvent);
assertNotNull(debuggerSession);
Breakpoint breakpoint = Breakpoint.newBuilder(source).lineIs(3).build();
breakpoint.setCondition("i == 5");
debuggerSession.install(breakpoint);
});
assertLocation(3, "print(i)", "i", "5");
continueExecution();
// Init before eval:
performWork();
final Source evalSrc = RSource.fromTextInternal("main()\n", RSource.Internal.DEBUGTEST_DEBUG);
engine.eval(evalSrc);
assertExecutedOK();
}
@Test
public void stepInStepOver() throws Throwable {
final Source factorial = createFactorial();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment