Giter Club home page Giter Club logo

android_trace's People

Contributors

djmcnab avatar xstrom avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

android_trace's Issues

Tests for AndroidTraceLayer (`tracing_android_trace`)

The sync layer has some nasty code to manage the stack. E.g. (up-to-date at the time of writing):

for id in stack[index_of_this..].iter() {
if let Some(id) = id {
let span = ctx.span(id).expect("Span not found, this is a bug");
let extensions = span.extensions();
if let Some(ext) = extensions.get::<ATraceExtension>() {
self.trace.begin_section(&ext.name);
} else {
eprintln!("Unexpectedly had item in stack without ATraceExtension");
}
} else {
self.trace.begin_section(EXTRA_STR);
}
}

We should find a way to test this code. This would involve:

  1. Enabling mocking AndroidTrace for testing, somehow (either with a trait, or by specifying the function calls directly)
  2. Creating a layer which uses this mocked AndroidTrace
  3. Running tests with different timings of enabled/disabled and span creation/exiting
  4. Saving the resulting trees, and seeing if they make sense (probably with a kind of snapshot testing), + that each open of a span is met with a matching close

This is not a high priority

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.