Quellcode durchsuchen

Pull lua-specific travis details into RunCi.hx

Justin Donaldson vor 9 Jahren
Ursprung
Commit
055f900b9d
3 geänderte Dateien mit 13 neuen und 7 gelöschten Zeilen
  1. 0 6
      .travis.yml
  2. 1 1
      .travis/setup_lua.sh
  3. 12 0
      tests/RunCi.hx

+ 0 - 6
.travis.yml

@@ -143,12 +143,6 @@ install:
     elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
       travis_retry brew install neko --HEAD;
     fi
-  # Install lua specific resources 
-  - source .travis/setenv_lua.sh
-  - pip install --user cpp-coveralls
-  # Use this special version of lrexlib-pcre 
-  - luarocks install lrexlib-pcre 2.7.2-1 --server=https://luarocks.org/dev
-  - luarocks install luautf8 --server=https://luarocks.org/dev
 
 script:
   # setup database

+ 1 - 1
.travis/setup_lua.sh

@@ -2,7 +2,7 @@
 
 # A script for setting up environment for travis-ci testing.
 # Sets up Lua and Luarocks.
-# LUA must be "lua5.1", "lua5.2" or "luajit".
+# LUA must be "lua5.1", "lua5.2", "lua5.3", or "luajit".
 # luajit2.0 - master v2.0
 # luajit2.1 - master v2.1
 

+ 12 - 0
tests/RunCi.hx

@@ -436,6 +436,17 @@ class RunCi {
 		runCommand("node", ["-v"]);
 	}
 
+	static function getLuaDependencies(jit = false, lua_version = "lua5.2", luarocks_version = "2.3.0") {
+		if (jit) Sys.putEnv("LUAJIT","yes");
+		Sys.putEnv("LUAROCKS", luarocks_version);
+		Sys.putEnv("LUA", lua_version);
+		// use the helper scripts in .travis
+		runCommand("source", [".travis/setenv_lua.sh"]);
+		runCommand("pip", ["install", "--user", "cpp-coveralls"]);
+		runCommand("luarocks", ["install", "lrexlib-pcre", "2.7.2-1", "--server=https://luarocks.org/dev"]);
+		runCommand("luarocks", ["install", "luautf8", "--server=https://luarocks.org/dev"]);
+	}
+
 	static function getCsDependencies() {
 		switch (systemName) {
 			case "Linux":
@@ -933,6 +944,7 @@ class RunCi {
 						runCommand(py, ["test.py"]);
 					}
 				case Lua:
+					getLuaDependencies();
 					runCommand("haxe", ["compile-lua.hxml"].concat(args));
 					runCommand("lua", ["bin/unit.lua"]);
 				case Cpp: