Commit 687a19c2 authored by Rob Loach's avatar Rob Loach Committed by GitHub
Browse files

Merge pull request #106 from RobLoach/luasocketfix-test-fix

Update Lutro and http.socket Test
parents f9ec6182 1423e191
......@@ -2,10 +2,21 @@ FROM ubuntu:16.04
MAINTAINER libretro
# Update all dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y
# Install RetroArch's build dependencies
RUN apt-get install -y make git-core curl g++ pkg-config libglu1-mesa-dev freeglut3-dev mesa-common-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev
RUN apt-get install -y make git-core curl g++ pkg-config libglu1-mesa-dev freeglut3-dev mesa-common-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev software-properties-common
# Install RetroArch from the PPA
RUN apt-add-repository -y multiverse
RUN add-apt-repository -y ppa:libretro/testing
RUN apt-get update && apt-get upgrade -y
RUN apt-get install retroarch -y
RUN mkdir -p ~/.config/retroarch
RUN echo "video_driver = \"null\"" >> ~/.config/retroarch/retroarch.cfg
RUN echo "audio_driver = \"null\"" >> ~/.config/retroarch/retroarch.cfg
RUN echo "confirm_on_exit = \"false\"" >> ~/.config/retroarch/retroarch.cfg
VOLUME ["/app"]
WORKDIR /app
......@@ -104,18 +104,17 @@ endif
CC += $(IPHONEMINVER)
CXX += $(IPHONEMINVER)
else ifeq ($(platform), qnx)
TARGET := $(TARGET_NAME)_libretro_qnx.so
TARGET := $(TARGET_NAME)_libretro_$(platform).so
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined
MMD :=
else ifeq ($(platform), emscripten)
TARGET := $(TARGET_NAME)_libretro_emscripten.so
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
STATIC_LINKING = 1
# PSP
else ifeq ($(platform), psp1)
TARGET := $(TARGET_NAME)_libretro_psp1.a
TARGET := $(TARGET_NAME)_libretro_$(platform).a
fpic :=
CC = psp-gcc$(EXE_EXT)
CXX = psp-g++$(EXE_EXT)
......@@ -131,7 +130,7 @@ else ifeq ($(platform), psp1)
# Vita
else ifeq ($(platform), vita)
TARGET := $(TARGET_NAME)_libretro_vita.a
TARGET := $(TARGET_NAME)_libretro_$(platform).a
fpic :=
CC = arm-vita-eabi-gcc$(EXE_EXT)
CXX = arm-vita-eabi-g++$(EXE_EXT)
......@@ -142,7 +141,7 @@ else ifeq ($(platform), vita)
MMD :=
else ifeq ($(platform), ngc)
TARGET := $(TARGET_NAME)_libretro_ngc.a
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CC_AS = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
......@@ -152,7 +151,7 @@ else ifeq ($(platform), ngc)
STATIC_LINKING = 1
MMD :=
else ifeq ($(platform), wii)
TARGET := $(TARGET_NAME)_libretro_wii.a
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CC_AS = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
......@@ -163,7 +162,7 @@ else ifeq ($(platform), wii)
MMD :=
# PS3
else ifeq ($(platform), ps3)
TARGET := $(TARGET_NAME)_libretro_ps3.a
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
CC_AS = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
......@@ -268,9 +267,25 @@ clean:
-make -C $(LUADIR) clean
-rm -f $(OBJS) $(TARGET)
docker:
docker build -t libretro-lutro .
docker run -v $(CURDIR):/app libretro-lutro make
docker-build:
@docker build -t libretro-lutro .
docker: docker-build
@docker run -it \
-v $(CURDIR):/app \
libretro-lutro \
make
docker-test: docker
@docker run -it \
-v $(CURDIR):/app \
--name retroarch \
libretro-lutro \
retroarch -L lutro_libretro.so test/unit
docker-kill:
@-docker kill retroarch
@-docker rm -f retroarch
test: all
retroarch -L lutro_libretro.so test
......
# Lutro
# Lutro [![Build Status](https://travis-ci.org/libretro/libretro-lutro.svg?branch=master)](https://travis-ci.org/libretro/libretro-lutro)
Experimental [Lua](http://lua.org) game framework for [libretro](http://libretro.com), following the [LÖVE](http://love2d.org) API.
......
......@@ -3,6 +3,7 @@ package.path = package.path .. './test/?.lua;./test/unit/?.lua;./test/unit/luaun
-- Dependencies
unit = require 'luaunit'
http = require 'socket.http'
function UTF8Test()
local utf8 = require("utf8")
......@@ -67,13 +68,10 @@ function lutro.filesystem.getUserDirectoryTest()
unit.assertEquals(homeDir, luaHomeDir)
end
function LuaSocketTest()
function http.requestTest()
local http = require('socket.http')
local result = 'Result'
local err = 'Request not made yet...'
result, err = http.request("http://wrong.host/")
-- @todo Fix LuaSocket test, once LuaSocket works.
io.write(tostring(err))
local result = http.request('http://buildbot.libretro.com/assets/frontend/info/lutro_libretro.info')
unit.assertStrContains(result, 'display_name = "Lutro"')
end
function lutro.getVersionTest()
......@@ -183,7 +181,7 @@ end
-- Runs all the defined tests.
function runTests()
LuaSocketTest()
http.requestTest()
lutro.keyboard.getKeyFromScancodeTest()
lutro.keyboard.getScancodeFromKeyTest()
lutro.filesystem.getUserDirectoryTest()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment