Giter Club home page Giter Club logo

luactest's Introduction

Build Status Total alerts FOSSA Status Coverity Scan Build Status

luactest

The idea is to be able to write and run tests for C functions in Lua. inspired by me being lazy and my life being too short for writing tests for C in C.
The workflow is the clang libtooling tool under libtool will find the funcitons and add their lua wrapper into source code and register it with lua. luatablegen is a python script that takes an XML script describing your C structs and turns them into lua tables since almost every non-toy C code uses structs anyways and adding C structs as Lua tables is non-trivial. after that you just build the tool(its not a typo, you actually build your tool) which is a Lua 5.3 interpreter. you then write your test scripts in Lua and run them. linenoise is there to give you some basic cli functionality if you choose to run the tool in interactive mode. the default.lua file works as the dot file. The default provided will add your luarocks libraries to our custom Lua instance for some added quality of life.

Demo

you can run the makefile in the root directory. then run the executable, type in dofile("./test.lua")and see the result. it runs our little test function from Lua which converts a string into an integer. <br>

TODO

  • write the libtooling tool.
  • need to add completion and hints for linenoise.
  • add non-interactive execution to tool.
  • add cygwin support because i have to use windows at work...

Notes

The luarocks feature work for Lua 5.3. I haven't looked at the Lua 5.4 changelog yet.

Build

If you don't have clang, subtitute all make commands with make CC=gcc.
Then run:

git clone https://github.com/bloodstalker/luactest
git submodule init
git submodule update
make

To build the libtooling tool run make under libtool directory.
The tool right now should support LLVM 5,6,8 and 9(latest tested trunk:355787).

License

FOSSA Status

luactest's People

Contributors

fossabot avatar terminaldweller 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.