Giter VIP home page Giter VIP logo

kaitai-io.kaitai_struct_tests's Introduction

Kaitai Struct: specs and tests

This repository contains specifications and tests for Kaitai Struct project.

What's inside

The repository is laid out like that:

  • src/ - binary input files that would be parsed during the tests
  • formats/ - file formats description is Kaitai Struct YAML format for the files in src/
  • spec/ - specifications (i.e. test code) that uses format descriptions to parse binary input files and ensures that they're parsed properly.
    • $LANGUAGE/ - one subdirectory per every supported target language

During the testing the following is expected to be created:

  • compiled/ - formats (described in formats/), compiled into specific programming languages modules
    • $LANGUAGE/ - one subdirectory per every supported target language
  • test_out/ - test running output, in a language-specific format
    • $LANGUAGE/ - one subdirectory per every supported target language

How to test

The overall procedure of testing works as follows:

  • Make sure that KS compiler (ksc) is built and ready to be used
  • Compile format descriptions in formats/ into source files in relevant programming languages (Java, Python, Ruby, etc), which should be placed in compiled/$LANGUAGE.
  • Compile and run test code for particular language (located in spec/$LANGUAGE), which will use files in src/ for input.
  • Aggregate and view results

Automated test tools

There are a few scripts that automate steps specified above:

  • build-compiler builds compiler using special "stage" mode, i.e. without system-wide deployment, ready to be run from a build directory
  • build-formats compiles all format descriptions in formats/ with this compiler for every supported language, placing results in compiled/$LANGUAGE
  • run-$LANGUAGE executes all tests for a particular $LANGUAGE using preferred language-specific testing tool. The output is generally dumped on screen for quick assessment during development.
  • ci-$LANGUAGE also runs all tests for a particular $LANGUAGE, but logs all output into designated log file instead (mostly useful for aggregation within a CI system afterwards).

Obviously, these scripts require Kaitai Struct compiler and language-specific runtime modules. They are normally located in distinct repositories - there is a file named /config that specifies their default locations. If you've used main Kaitai Struct project to check out all linked repositories as submodules in their default locations, you don't need to adjust anything. If you have these dependencies in some other places, just edit the /config.

Continuous integration

Main Kaitai Struct project includes a Travis CI configuration. This mean that every commit to main project repository gets automatically built and tested throughly. The results are published at Kaitai Struct CI results page.

Please refer to CI documentation for a throughout overview of how this all is tied together in a bigger picture.

kaitai-io.kaitai_struct_tests's People

Contributors

greycat avatar generalmimon avatar sealmove avatar logicandtrick avatar tschoening avatar ams-tschoening avatar adrianherrera avatar koczkatamas avatar cugu avatar jchv avatar cherue avatar fudgepop01 avatar dgelessus avatar valery1707 avatar mingun avatar nolta avatar cwood1 avatar modernikarus avatar smarek avatar adamiwaniuk avatar 13rac1 avatar mickdekkers avatar

Watchers

 avatar

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.