summaryrefslogtreecommitdiff
path: root/tests/bindings
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2015-05-13 14:51:35 -0700
committerJosh Haberman <jhaberman@gmail.com>2015-05-13 14:51:44 -0700
commit51cf616dab63ba65c30cc58f0e5a61724aa4f731 (patch)
tree7a3f4be0a0ee7704c66c60d51b5985336ba21426 /tests/bindings
parent35923b43b5f9bc65db3d2f6c5a0170a0bb816ce2 (diff)
Changes to Lua module loading, and file generation.
This change has several parts: 1. Resurrected tools/upbc. The code was all there but the build was broken for open-source. Now you can type "make tools/upbc" and it will build all necessary Lua modules and create a robust shell script for running upbc. 2. Changed Lua module loading to no longer rely on OS-level .so dependencies. The net effect of this is that you now only need to set LUA_PATH and LUA_CPATH; setting LD_LIBRARY_PATH or rpaths is no longer required. Downside: this drops compatibility with Lua 5.1, since it depends on a feature that only exists in Lua >=5.2 (and LuaJIT). 3. Since upbc works again, I fixed the re-generation of the descriptor files (descriptor.upb.h, descriptor.upb.c). "make genfiles" will re-generate these as well as the JIT code generator. 4. Added a Travis test target that ensures that the checked-in generated files are not out of date. I would do this for the Ragel generated file also, but we can't count on all versions of Ragel to necessarily generate identical output. 5. Changed Makefile to no longer automatically run Ragel to regenerate the JSON parser. This is unfortuante, because it's convenient when you're developing the JSON parser. However, "git clone" sometimes skews the timestamps a little bit so that "make" thinks it needs to regenerate these files for a fresh "git clone." This would normally be harmless, but if the user doesn't have Ragel installed, it makes the build fail completely. So now you have to explicitly regenerate the Ragel output. If you want to you can uncomment the auto-generation during development.
Diffstat (limited to 'tests/bindings')
-rw-r--r--tests/bindings/lua/test_upb.pb.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/bindings/lua/test_upb.pb.lua b/tests/bindings/lua/test_upb.pb.lua
index 02b443a..7c1c0d0 100644
--- a/tests/bindings/lua/test_upb.pb.lua
+++ b/tests/bindings/lua/test_upb.pb.lua
@@ -1,6 +1,8 @@
-local upb = require "upb"
+-- Require "pb" first to ensure that the transitive require of "upb" is
+-- handled properly by the "pb" module.
local pb = require "upb.pb"
+local upb = require "upb"
local lunit = require "lunit"
if _VERSION >= 'Lua 5.2' then
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback