From 69f37968ab29e963d9163a7e72eca81bff17e3b7 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Wed, 7 Aug 2013 06:33:09 +0200 Subject: Adding LuaHandle support. --- Balau | 2 +- Makefile | 2 +- src/Dalos-cli.cc | 2 ++ tests/alltests.lua | 2 ++ tests/test2.lua | 6 ++++++ 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 tests/test2.lua diff --git a/Balau b/Balau index 1a67500..24dbb15 160000 --- a/Balau +++ b/Balau @@ -1 +1 @@ -Subproject commit 1a67500d100520dd8be9856f2f57ab8b0fbf90bb +Subproject commit 24dbb15bf6f2b513e2fb75345345b7b646ff1a81 diff --git a/Makefile b/Makefile index c91cdec..037cde8 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ strip: $(TARGET) Balau: $(MAKE) -C Balau -tests: $(TARGET) +tests: all $(MAKE) -C Balau tests ./$(TARGET) tests/alltests.lua tests/runtests.lua ./$(TARGET) tests/alltests.lua -e 'runtests()' diff --git a/src/Dalos-cli.cc b/src/Dalos-cli.cc index 5c7cc8a..887d7d1 100644 --- a/src/Dalos-cli.cc +++ b/src/Dalos-cli.cc @@ -4,6 +4,7 @@ #include #include #include +#include #include "BReadline.h" #include "LuaLoad.h" @@ -42,6 +43,7 @@ namespace { class DalosInit : public LuaExecCell { virtual void run(Lua & L) override { registerLuaLoad(L); + registerLuaHandle(L); } }; diff --git a/tests/alltests.lua b/tests/alltests.lua index d0feda2..d4088e6 100644 --- a/tests/alltests.lua +++ b/tests/alltests.lua @@ -1,5 +1,7 @@ load "tests/test1.lua" +load "tests/test2.lua" function runtests() test1() + test2() end diff --git a/tests/test2.lua b/tests/test2.lua new file mode 100644 index 0000000..d023ba5 --- /dev/null +++ b/tests/test2.lua @@ -0,0 +1,6 @@ +function test2() + local i = Input.new "tests/test1.lua" + i:open() + i:close() + i:destroy() +end -- cgit v1.2.3