Browse Source

Prepend package.path instead of LUA_PATH for tests

Lua 5.2 and later prefer the environment variable LUA_PATH_X_Y over
LUA_PATH, which complicates prepending the Lua path in the environment.
Peter Colberg 2 years ago
parent
commit
bf6adceec5
11 changed files with 18 additions and 14 deletions
  1. 2
    0
      ffi-cdecl/C.lua.in
  2. 0
    7
      ffi-cdecl/Makefile
  3. 0
    7
      test/Makefile
  4. 2
    0
      test/array.lua
  5. 2
    0
      test/composite.lua
  6. 2
    0
      test/enum.lua
  7. 2
    0
      test/function.lua
  8. 2
    0
      test/pointer.lua
  9. 2
    0
      test/scalar.lua
  10. 2
    0
      test/variable.lua
  11. 2
    0
      test/vector.lua

+ 2
- 0
ffi-cdecl/C.lua.in View File

@@ -1,3 +1,5 @@
1
+package.path = "./?.lua;../?.lua;" .. package.path
2
+
1 3
 local gcc = require("gcc")
2 4
 local cdecl = require("gcc.cdecl")
3 5
 local fficdecl = require("ffi-cdecl")

+ 0
- 7
ffi-cdecl/Makefile View File

@@ -3,13 +3,6 @@ CPPFLAGS =
3 3
 CFLAGS = -Wall -pedantic -O2
4 4
 GCCLUA = $(CURDIR)/../../gcc-lua/gcc/gcclua.so
5 5
 
6
-ifdef LUA_PATH
7
-LUA_PATH := $(CURDIR)/?.lua;$(CURDIR)/../?.lua;$(LUA_PATH)
8
-else
9
-LUA_PATH := $(CURDIR)/?.lua;$(CURDIR)/../?.lua;;
10
-endif
11
-export LUA_PATH
12
-
13 6
 all: C.lua
14 7
 
15 8
 %.lua: %.c %.lua.in

+ 0
- 7
test/Makefile View File

@@ -9,13 +9,6 @@ CFLAGS = -Wall
9 9
 CCOPT = -std=gnu99
10 10
 GCCLUA = $(CURDIR)/../../gcc-lua/gcc/gcclua.so
11 11
 
12
-ifdef LUA_PATH
13
-LUA_PATH := $(CURDIR)/../?.lua;$(CURDIR)/../?/init.lua;$(LUA_PATH)
14
-else
15
-LUA_PATH := $(CURDIR)/../?.lua;$(CURDIR)/../?/init.lua;;
16
-endif
17
-export LUA_PATH
18
-
19 12
 all: array composite enum function pointer scalar variable vector
20 13
 
21 14
 %: %.c %.lua

+ 2
- 0
test/array.lua View File

@@ -4,6 +4,8 @@
4 4
 -- Distributed under the MIT license. (See accompanying file LICENSE.)
5 5
 --
6 6
 
7
+package.path = "../?.lua;" .. package.path
8
+
7 9
 local gcc   = require("gcc")
8 10
 local cdecl = require("gcc.cdecl")
9 11
 

+ 2
- 0
test/composite.lua View File

@@ -4,6 +4,8 @@
4 4
 -- Distributed under the MIT license. (See accompanying file LICENSE.)
5 5
 --
6 6
 
7
+package.path = "../?.lua;" .. package.path
8
+
7 9
 local gcc   = require("gcc")
8 10
 local cdecl = require("gcc.cdecl")
9 11
 

+ 2
- 0
test/enum.lua View File

@@ -4,6 +4,8 @@
4 4
 -- Distributed under the MIT license. (See accompanying file LICENSE.)
5 5
 --
6 6
 
7
+package.path = "../?.lua;" .. package.path
8
+
7 9
 local gcc   = require("gcc")
8 10
 local cdecl = require("gcc.cdecl")
9 11
 

+ 2
- 0
test/function.lua View File

@@ -4,6 +4,8 @@
4 4
 -- Distributed under the MIT license. (See accompanying file LICENSE.)
5 5
 --
6 6
 
7
+package.path = "../?.lua;" .. package.path
8
+
7 9
 local gcc   = require("gcc")
8 10
 local cdecl = require("gcc.cdecl")
9 11
 

+ 2
- 0
test/pointer.lua View File

@@ -4,6 +4,8 @@
4 4
 -- Distributed under the MIT license. (See accompanying file LICENSE.)
5 5
 --
6 6
 
7
+package.path = "../?.lua;" .. package.path
8
+
7 9
 local gcc   = require("gcc")
8 10
 local cdecl = require("gcc.cdecl")
9 11
 

+ 2
- 0
test/scalar.lua View File

@@ -4,6 +4,8 @@
4 4
 -- Distributed under the MIT license. (See accompanying file LICENSE.)
5 5
 --
6 6
 
7
+package.path = "../?.lua;" .. package.path
8
+
7 9
 local gcc   = require("gcc")
8 10
 local cdecl = require("gcc.cdecl")
9 11
 

+ 2
- 0
test/variable.lua View File

@@ -4,6 +4,8 @@
4 4
 -- Distributed under the MIT license. (See accompanying file LICENSE.)
5 5
 --
6 6
 
7
+package.path = "../?.lua;" .. package.path
8
+
7 9
 local gcc   = require("gcc")
8 10
 local cdecl = require("gcc.cdecl")
9 11
 

+ 2
- 0
test/vector.lua View File

@@ -4,6 +4,8 @@
4 4
 -- Distributed under the MIT license. (See accompanying file LICENSE.)
5 5
 --
6 6
 
7
+package.path = "../?.lua;" .. package.path
8
+
7 9
 local gcc   = require("gcc")
8 10
 local cdecl = require("gcc.cdecl")
9 11
 

Loading…
Cancel
Save