Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

lut 1.0.2 #2

Merged
merged 9 commits into from Apr 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 9 additions & 8 deletions .travis.yml
Expand Up @@ -11,14 +11,15 @@ env:
- TOOL="clang" # Use clang
- TOOL="i686-w64-mingw32" # 32bit MinGW
- TOOL="x86_64-w64-mingw32" # 64bit MinGW
- TOOL="arm-linux-gnueabihf" # ARM hard-float (hf), linux
# Always fails because lua does not build.
# - TOOL="arm-linux-gnueabihf" # ARM hard-float (hf), linux

# Crosscompile builds may fail
matrix:
allow_failures:
- env: TOOL="i686-w64-mingw32"
- env: TOOL="x86_64-w64-mingw32"
- env: TOOL="arm-linux-gnueabihf"
# matrix:
# allow_failures:
# - env: TOOL="i686-w64-mingw32"
# - env: TOOL="x86_64-w64-mingw32"
# - env: TOOL="arm-linux-gnueabihf"

# Install dependencies
install:
Expand All @@ -31,7 +32,7 @@ before_script:

# Build the module
script:
- ~/_tools/travis/travis build
- ~/_tools/travis/travis build && (test -e ~/build/lubyk/lut/_test/bin/lua.exe || ~/build/lubyk/lut/_test/bin/lua test/all.lua)

# Execute additional tests or commands
after_script:
Expand All @@ -45,7 +46,7 @@ branches:
# Notify the LuaDist Dev group if needed
notifications:
recipients:
- luadist-dev@googlegroups.com
- gaspard@teti.ch
email:
on_success: change
on_failure: always
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required ( VERSION 2.8 )
include ( cmake/dist.cmake )
include ( lua )

install(
install (
DIRECTORY lut/
DESTINATION ${INSTALL_LMOD}/lut
COMPONENT Runtime
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
lut
lut [![Build Status](https://travis-ci.org/lubyk/lut.png)](https://travis-ci.org/lubyk/lut)
===

Lubyk utility library (provides documentation generation from lua code and testing).
Expand Down
4 changes: 2 additions & 2 deletions dist.info
@@ -1,7 +1,7 @@
--- This file is part of Lubyk project

name = "lut"
version = "1.0.0"
version = "1.0.2"

desc = "Utility module for lubyk. Contains a documentation generator and testing facilities."
author = "Gaspard Bucher"
Expand All @@ -10,6 +10,6 @@ url = "http://lubyk.org"
maintainer = "Gaspard Bucher"

depends = {
"lua ~> 5.1",
"lua >= 5.1, < 5.3",
"lub ~> 1.0",
}
13 changes: 13 additions & 0 deletions doc/index.html
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>lub</title>
</head>
<body>
<h3>Online documentation</h3>
<p><a href='http://doc.lubyk.org/lub.html'>doc.lubyk.org/lub.html</a></h1></p>

<h3>Generate</h3>
<pre>$ lua scripts/makedoc.lua</pre>
</body>
</html>
40 changes: 0 additions & 40 deletions lut-1.0.0-1.rockspec

This file was deleted.

39 changes: 39 additions & 0 deletions lut-1.0.2-1.rockspec
@@ -0,0 +1,39 @@
package = "lut"
version = "1.0.2-1"
source = {
url = "http://lubyk.org/archive/lut-REL-1.0.2.tar.gz",
dir = 'lut-REL-1.0.2',
}
description = {
summary = "Utility module for lubyk. Contains a documentation generator and testing facilities.",
detailed = [[
lub.Doc: a powerful documentation generator for Lua code with support for
litterate programming, cross-reference linking, images, latex math, etc.

lub.Test: unit testing framework.
]],
homepage = "http://lubyk.org",
license = "MIT"
}
dependencies = {
"lua >= 5.1, < 5.3",
"lub ~> 1.0",
}
build = {
type = 'builtin',
modules = {
['lut' ] = 'lut/init.lua',
['lut.Doc' ] = 'lut/Doc.lua',
['lut.Test' ] = 'lut/Test.lua',
},
install = {
lua = {
['lut.doc.template'] = 'lut/doc/template.html',
['lut.doc.css.bootstrap_min_css'] = 'lut/doc/css/bootstrap.min.css',
['lut.doc.css.docs_css'] = 'lut/doc/css/docs.css',
['lut.doc.img.glyphicons-halflings-white_png'] = 'lut/doc/img/glyphicons-halflings-white.png',
['lut.doc.img.glyphicons-halflings_png'] = 'lut/doc/img/glyphicons-halflings.png',
['lut.doc.js.bootstrap_min_js'] = 'lut/doc/js/bootstrap.min.js',
},
}
}
14 changes: 12 additions & 2 deletions lut/Test.lua
Expand Up @@ -20,7 +20,8 @@ local current = nil
--
-- Full test file example:
--
-- require 'lut'
-- local lub = require 'lub'
-- local lut = require 'lut'
-- local should = lut.Test 'animal.Dog'
--
-- function should.bark()
Expand Down Expand Up @@ -159,6 +160,9 @@ end
--
-- -- Run all tests now.
-- should:test()
--
-- WARN: Once tests are run, this function calls `os.exit` with a return code of 0
-- (success) or -1 (failure).

-- nodoc
function lib:test(batch)
Expand All @@ -178,13 +182,17 @@ end
-- Test all files in `list_or_path` matching `pattern`. Typical usage is to
-- create an `all.lua` file in the tests folder with:
--
-- require 'lut'
-- local lub = require 'lub'
-- local lut = require 'lut'
-- lut.Test.files(lub.path '|')
--
-- This will run tests for all files matching the default pattern `%_test.lua$`.
-- If the optional `reject` pattern is provided, paths matching this pattern
-- will be, well, rejected. See [lub.path](lub.html#path) for details on the
-- pipe syntax.
--
-- WARN: Once tests are run, this function calls `os.exit` with a return code of 0
-- (success) or -1 (failure).
function lib.files(list_or_path, pattern, reject)
private.parseArgs()
pattern = pattern or '%_test.lua$'
Expand Down Expand Up @@ -609,6 +617,8 @@ function private.report()
end
end
print('')

os.exit(lib.total_fail == 0 and 0 or -1)
end

return lib
7 changes: 3 additions & 4 deletions lut/init.lua
Expand Up @@ -7,10 +7,9 @@
--]]--------------------
local lub = require 'lub'
local lib = lub.Autoload 'lut'
lut = lib

-- Current version for 'lut' module. Minor version numbers are never released
-- and are used during development.
lib.VERSION = '1.0.0'
-- Current version for 'lut' module. Odd minor version numbers are never
-- released and are used during development.
lib.VERSION = '1.0.2'

return lib
4 changes: 3 additions & 1 deletion scripts/CMakeLists.txt.in
Expand Up @@ -6,8 +6,10 @@ cmake_minimum_required ( VERSION 2.8 )
include ( cmake/dist.cmake )
include ( lua )

install(DIRECTORY {{mod.type}}
install (
DIRECTORY {{mod.type}}/
DESTINATION ${INSTALL_LMOD}/{{mod.type}}
COMPONENT Runtime
)

install_data ( README.md LICENSE )
Expand Down
4 changes: 2 additions & 2 deletions scripts/dist.info.in
@@ -1,7 +1,7 @@
{% mod = require 'lut' %}
--- This file is part of Lubyk project

name = "Lut"
name = "{{mod.type}}"
version = "{{mod.VERSION}}"

desc = "Utility module for lubyk. Contains a documentation generator and testing facilities."
Expand All @@ -11,6 +11,6 @@ url = "http://lubyk.org"
maintainer = "Gaspard Bucher"

depends = {
"lua ~> 5.1",
"lua >= 5.1, < 5.3",
"lub ~> 1.0",
}
11 changes: 5 additions & 6 deletions scripts/makedoc.lua
@@ -1,17 +1,16 @@
local lub = require 'lub'
lub.Doc.make {
local lut = require 'lut'
lut.Doc.make {
sources = {
'lub',
'lut',
},
head = '<meta name="google-site-verification" content="p1ZrKNheIo5xMhrMOo9MxKaY2hL9LlyuPYyRnEl2QuM" />',
target = 'doc',
format = 'html',
header = [[ <a href='http://lubyk.org'><img alt='lubyk logo' src='img/lubyk.png'/></a> <h1><a href='http://doc.lubyk.org'>Lubyk documentation</a></h1></a> ]],
header = [[<h1><a href='http://doc.lubyk.org'>Lubyk documentation</a></h1></a> ]],
index = [=[
--[[--
# Lubyk documentation

## List of available modules in lubyk
## List of available modules
--]]--
]=]
}
38 changes: 18 additions & 20 deletions scripts/rockspec.in
@@ -1,41 +1,39 @@
{% mod = require 'lut' %}
package = "Lut"
package = "{{mod.type}}"
version = "{{mod.VERSION}}-1"
source = {
url = "http://lubyk.org/archive/REL-{{mod.VERSION}}.tar.gz",
dir = '{{mod.type}}-REL-{{mod.VERSION}}',
url = "http://lubyk.org/archive/{{mod.type}}-REL-{{mod.VERSION}}.tar.gz",
dir = '{{mod.type}}-REL-{{mod.VERSION}}',
}
description = {
summary = "Utility module for lubyk. Contains a documentation generator and testing facilities.",
detailed = [[
lub.Doc: a powerful documentation generator for Lua code with support for
litterate programming, cross-reference linking, images, latex math, etc.

lub.Test: unit testing framework.
]],
-- lub.Test: A simple yet powerful unit testing framework.
homepage = "http://lubyk.org",
license = "MIT"
summary = "Utility module for lubyk. Contains a documentation generator and testing facilities.",
detailed = [[
lub.Doc: a powerful documentation generator for Lua code with support for
litterate programming, cross-reference linking, images, latex math, etc.

lub.Test: unit testing framework.
]],
homepage = "http://lubyk.org",
license = "MIT"
}
dependencies = {
"lua ~> 5.1",
"lub ~> 1.0",
"lua >= 5.1, < 5.3",
"lub ~> 1.0",
}
build = {
type = 'builtin',
modules = {
{{string.format("[%-17s] = '%s/%s.lua'", "'"..mod.type.."'", mod.type, 'init')}},
{% for file in lfs.dir(mod.type) do %}
{% if file == 'init.lua' then %}
['{{mod.type}}' ] = '{{mod.type}}/init.lua',
{% elseif file:match('.lua$') then file = file:sub(1, -5) %}
['{{mod.type}}.{{file}}'] = '{{mod.type}}/{{file}}.lua',
{% if file ~= 'init.lua' and file:match('.lua$') then file = file:sub(1, -5) %}
{{string.format("[%-17s] = '%s/%s.lua'", "'"..mod.type..'.'..file.."'", mod.type, file)}},
{% end %}
{% end %}
},
install = {
lua = {
['lut.doc.template'] = 'lut/doc/template.html',
{% for _, path in ipairs(lut.Doc.ASSETS) do %}
{% for _, path in ipairs(mod.Doc.ASSETS) do %}
['lut.doc.{{path:gsub('[.]', '_'):gsub('/', '.')}}'] = 'lut/doc/{{path}}',
{% end %}
},
Expand Down
3 changes: 2 additions & 1 deletion test/Doc_test.lua
Expand Up @@ -3,7 +3,8 @@
lut.Doc test

--]]------------------------------------------------------
require 'lut'
local lub = require 'lub'
local lut = require 'lut'
local should = lut.Test 'lut.Doc'

local tmp = lub.path '|fixtures/tmp'
Expand Down
3 changes: 2 additions & 1 deletion test/Test_test.lua
Expand Up @@ -3,7 +3,8 @@
lub.Doc test

--]]------------------------------------------------------
require 'lut'
local lub = require 'lub'
local lut = require 'lut'
local should = lut.Test('lut.Test', { coverage = false })

function should.assertTrue()
Expand Down
3 changes: 2 additions & 1 deletion test/all.lua
@@ -1,4 +1,5 @@
require 'lut'
local lub = require 'lub'
local lut = require 'lut'

lut.Test.files(lub.path '|')