几种语言原生开发环境构建之--Lua语言
2016-08-02 21:34
645 查看
安装目录
假设安装目录为 /home/user/soft/
更详细配置,参见
文件test_spec.lua添加测试内容,比如:
测试用例
开始测试
假设安装目录为 /home/user/soft/
lua语言安装
$ export PATH=/home/user/soft/lua:$PATH $ cd /home/user/soft/ $ curl -R -O http://www.lua.org/ftp/lua-5.3.4.tar.gz $ tar zxf lua-5.3.4.tar.gz $ mv lua-5.3.4 lua $ cd lua $ make linux install INSTALL_TOP=../ $ lua
lua包管理器安装luarocks
$ cd /home/user/soft/lua $ export PATH=/home/user/soft/lua:$PATH $ wget http://luarocks.org/releases/luarocks-2.4.2.tar.gz $ tar zxpf luarocks-2.4.2.tar.gz $ cd luarocks-2.4.2 $ export prefix=$(dirname $(dirname $(which lua))) $ ./configure --prefix=$prefix --sysconfdir=$prefix/luarocks --force-config --with-lua=$prefix $ make bootstrap $ luarocks
lua项目构建
$ mkdir rocktest $ cd rocktest && mkdir -p src/spec $ luarocks write_rockspec --lua-version=5.3 rocktest 1.0.0 ./ # 上面这里是新建了一个.rockspec配置文件,rocktest项目名称,1.0.0版本号 $ touch src/first.lua && echo "print('hello');return {}" > src/first.lua $ vim *.rockspec # 如果要构建库 modules = {first = "src/first.lua"} # 如果要构建可执行文件: ,install = { bin = { ['sometest'] = 'bin/sometest' } } $ mkdir bin && echo "require 'first' " > bin/sometest $ luarocks make
更详细配置,参见
lua测试工具安装
安装busted$ luarocks install busted $ touch rocktest/spec/test_spec.lua #以 _spec结尾
文件test_spec.lua添加测试内容,比如:
describe('Tests the busted pending functions through the commandline', function() it('is a test with a pending', function() pending('finish this test later') error('should never get here') end) pending('is a pending inside a describe', function() it('this test does not run', function() error('this should not run') end) end) end)
测试用例
开始测试
$ busted
相关文章推荐
- 几种语言原生开发环境构建之--Typescript语言
- 几种语言原生开发环境构建之--Go语言
- 几种语言原生开发环境构建之--Elm语言
- 几种语言原生开发环境构建之--Python语言
- 几种语言原生开发环境构建之--Haskell语言
- 在ubuntu下构建go语言开发环境的方法
- Idea基于scala语言构建spark开发环境搭建
- Windows下 Lua 语言的开发和运行环境 - Lua for Windows
- 配置EditPlus与NAnt构建轻型的.NET开发环境
- 配置EditPlus与NAnt构建轻型的.NET开发环境
- 几种主流网页开发语言的思考 [转]
- 开发国际化程序,在不同语言环境中显示对应的语言
- 构建自己的.NET Framework3.0开发环境
- 几种主流网页开发语言的思考(下)
- 让PHP支持大型项目-构建JSP、PHP与JAVA融为一体的开发环境[转载]
- 在多语言环境中构建基于MOSS2007的解决方案
- Asp,PHP,JSP,.Net几种网站开发语言比较
- 今年在好几种开发语言中转来转去,现在轮到CS了。
- 敏捷软件开发基础: 持续集成环境的构建
- 构建Python的桌面开发环境 于2005年07月26日