lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On Sun, May 24, 2020 at 4:48 PM Vinicius Jarina <viniciusjarina@gmail.com> wrote:
NLua uses CMake to build on Linux/Mac and Windows using x86, x64, ARM and ARM64
https://github.com/NLua/lua/tree/febbeceb0150d01fe3e1c656b6e20e03a9489a2d

This is the latest commit with Lua 5.3.5 the tip of master is already using Lua 5.4
This is perfect; thank you, Vinicius. I will thank you twice because my C# NLuaSerialConsole application is being used by our QA team to run tests against an embedded system. The application is buggy as all get out (my fault, not NLua), but people are VERY pleased with being able to run simple Lua scripts against an embedded target for testing.

You all might be interested to know that Lua is being used to run all sorts of tests for the Canadian Emergency Ventilator project: 
https://douglasmagazine.com/victorias-starfish-medical-helping-to-supply-emergency-ventilators-for-canadians/  

Our QA team is using Lua to run functional tests as noted above. The CMakeLists.txt is for a Unity unit test application to compile and test the firmware on a PC (Linux and Windows). Its completely C and Lua based. We originally started it in Eclipse using the internal build system but due to the complexity of adding different code bases it became unwieldy. I actually started to have wrist problems from clicking in dialog boxes! We've almost completely moved over to CMake based on the efforts of a colleague. He uses CLion and I am using KDevelop for IDEs. We are using my WinLua Toolchain on Windows, which includes the LLVM-Mingw compiler. Most of the development, however, is done in Linux.

Anyway, Lua is used in the application to load the configuration files and as a mechanism to load different unit test libraries and run selected test. The reading of config files is very rudimentary at the moment (Help! anyone got a library?). That aside, I firmly believe the flexibility in loading and running the C Unit Test modules will give us a big leg up as we move into the testing phase as the firmware solidifies. Since all the unit tests must have a void <func>(void) signature, I can just cast those with (lua_CFunction) and "bob's yer uncle". 

There is one area left to be proved out: running different shared libraries with the same functions/symbols in both. They won't be run at the same time, but I would like to be able to load them consecutively using Lua. This is because some tests require us to mock internal components, so they will have the same name/signature in two different files. That's my issue to sort out on Monday. 

Anyway, I have to get back to it. Thanks again!
Regards,
Russ


On Sun, May 24, 2020 at 12:11 PM Russell Haley <russ.haley@gmail.com> wrote:
Hi,

I'd like to add Lua 5.3.5 to a CMake based project. I need it to build a static lib, shared object and (optionally) the Lua executable. Does anyone have a standalone CMakelists.txt file for Lua 5.3.5?

Thanks,

Russ