Skip to content

Commit

Permalink
Merge branch 'release/0.4.4'
Browse files Browse the repository at this point in the history
* release/0.4.4:
  rockspecs: adds 0.4.4 rockspec
  docs: update CHANGELOG with pending release date
  docs: update CHANGELOG
  docs: update copyright dates
  travis: update to use hererocks for version management
  travis: synchronizes with moteus/lua-travis-example to fix LuaJIT builds
  event_callback: handle 0 timeout properly
  build: allow all branches to trigger builds
  build: allows 5.3-dev branch
  headers: updates Lua 5.2 workaround to allow 5.3 version
  travis: prepares travis-CI build
  test: updates buffer tests to work with busted which works with Lua 5.2
  • Loading branch information
harningt committed Aug 4, 2016
2 parents 4599234 + 7380d8d commit b4e322e
Show file tree
Hide file tree
Showing 9 changed files with 265 additions and 166 deletions.
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Pull in python for access to pip for hererocks
language: python

sudo: false

env:
global:
- LUAROCKS=2.3.0
matrix:
- LUA="luajit 2.1"
- LUA="luajit 2.0"
- LUA="lua 5.3"
- LUA="lua 5.2"
- LUA="lua 5.1"

before_install:
- pip install hererocks
- hererocks env -r $LUAROCKS --$LUA
- source env/bin/activate
- luarocks install busted

script:
- luarocks make rockspecs/luaevent/luaevent-scm-0.rockspec
- cd test && busted event_buffer-tests.lua

notifications:
email:
on_success: change
on_failure: always
9 changes: 8 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
0.4.4 - WIP
0.4.4 - 2016-08-04
* Updated license to MIT license
* Add basic continuous integration tests via Travis-CI
* event_callback.c: Don't pop too much. Kim Alvefur <zash@zash.se>
* Updates to reduce global pollution
* Support Lua 5.3
* Use busted test framework for buffer tests
* Fix crashes due to event being deleted while in callback
* Fix 0 timeout handling appropriately (it is a valid value)
0.4.3 - 2013-03-11
* Fixes unchecked stack increase resulting in potential overflow
0.4.2 - 2013-03-10
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
LuaEvent - Binding of libevent to Lua to offer event-based IO programming
Copyright (C) 2007,2012,2013 Thomas Harning <harningt@gmail.com>
Copyright (C) 2007,2012-2016 Thomas Harning <harningt@gmail.com>

Licensed under the MIT license.

Expand Down
2 changes: 1 addition & 1 deletion doc/COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ LuaEvent

Licensed under the MIT license.

Copyright (C) 2007,2012,2013 Thomas Harning <harningt@gmail.com>
Copyright (C) 2007,2012-2016 Thomas Harning <harningt@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions include/luaevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

#include <lua.h>

/* Workarounds for Lua 5.2 */
#if (LUA_VERSION_NUM == 502)
/* Workarounds for Lua 5.2 and Lua 5.3 */
#if (LUA_VERSION_NUM >= 502)

#undef lua_equal
#define lua_equal(L,idx1,idx2) lua_compare(L, (idx1), (idx2), LUA_OPEQ)
Expand Down
36 changes: 36 additions & 0 deletions rockspecs/luaevent/luaevent-0.4.4-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package="luaevent"
version="0.4.4-1"
source = {
url = "https://github.com/harningt/luaevent/archive/v0.4.4.tar.gz",
dir = "luaevent-0.4.4",
}
description = {
summary = "libevent binding for Lua",
detailed = [[
This is a binding of libevent to Lua
]],
homepage = "https://github.com/harningt/luaevent",
license = "MIT"
}
dependencies = {
"lua >= 5.1, <= 5.3"
}
external_dependencies = {
EVENT = {
header = "event.h",
library = "event",
}
}
build = {
type = "builtin",
modules = {
["luaevent.core"] = {
sources = { "src/buffer_event.c", "src/event_buffer.c", "src/event_callback.c", "src/utility.c", "src/luaevent.c" },
libdirs = "$(EVENT_LIBDIR)",
incdirs = { "include", "$(EVENT_INCDIR)" },
libraries = "event",
},
["luaevent"] = "lua/luaevent.lua",
},
copy_directories = { "doc", "test" },
}
35 changes: 35 additions & 0 deletions rockspecs/luaevent/luaevent-scm-0.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package="luaevent"
version="scm-0"
source = {
url = "git://github.com/harningt/luaevent.git",
}
description = {
summary = "libevent binding for Lua",
detailed = [[
This is a binding of libevent to Lua
]],
homepage = "https://github.com/harningt/luaevent",
license = "MIT"
}
dependencies = {
"lua >= 5.1, <= 5.3"
}
external_dependencies = {
EVENT = {
header = "event.h",
library = "event",
}
}
build = {
type = "builtin",
modules = {
["luaevent.core"] = {
sources = { "src/buffer_event.c", "src/event_buffer.c", "src/event_callback.c", "src/utility.c", "src/luaevent.c" },
libdirs = "$(EVENT_LIBDIR)",
incdirs = { "include", "$(EVENT_INCDIR)" },
libraries = "event",
},
["luaevent"] = "lua/luaevent.lua",
},
copy_directories = { "doc", "test" },
}
2 changes: 0 additions & 2 deletions src/event_callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ void luaevent_callback(int fd, short event, void* p) {
if( newEvent != event || (cb->timeout.tv_sec != new_tv.tv_sec || cb->timeout.tv_usec != new_tv.tv_usec) ) {
struct timeval *ptv = &cb->timeout;
cb->timeout = new_tv;
if(!cb->timeout.tv_sec && !cb->timeout.tv_usec)
ptv = NULL;
event_del(ev);
event_set(ev, fd, EV_PERSIST | newEvent, luaevent_callback, cb);
/* Assume cannot set a new timeout.. */
Expand Down
Loading

0 comments on commit b4e322e

Please sign in to comment.