Author: fperrad
Date: Sat Jul 26 09:08:21 2008
New Revision: 29757
Added:
trunk/languages/lua/t/gl.t (contents, props changed)
Modified:
trunk/MANIFEST
trunk/languages/lua/src/lib/gl.pir
trunk/languages/lua/src/lib/glut.pir
Log:
[Lua] first test for OpenGL
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Sat Jul 26 09:08:21 2008
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Jul 25 21:08:13 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sat Jul 26 16:04:22 2008 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -1694,6 +1694,7 @@
languages/lua/t/fornum.t [lua]
languages/lua/t/function.t [lua]
languages/lua/t/functions.t [lua]
+languages/lua/t/gl.t [lua]
languages/lua/t/harness [lua]
languages/lua/t/if.t [lua]
languages/lua/t/io.t [lua]
Modified: trunk/languages/lua/src/lib/gl.pir
==============================================================================
--- trunk/languages/lua/src/lib/gl.pir (original)
+++ trunk/languages/lua/src/lib/gl.pir Sat Jul 26 09:08:21 2008
@@ -23,18 +23,16 @@
.sub '__onload' :anon :load
# print "__onload gl\n"
-
- load_bytecode 'library/OpenGL.pbc'
-
.const .Sub entry = 'luaopen_gl'
set_hll_global 'luaopen_gl', entry
.end
.sub 'luaopen_gl'
# print "luaopen_gl\n"
+ load_bytecode 'OpenGL.pir'
# Import all OpenGL/GLU/GLUT functions
- $P0 = get_global ['OpenGL'], '_export_all_functions'
+ $P0 = get_hll_global ['OpenGL'], '_export_all_functions'
$P0()
.local pmc _lua__GLOBAL
Modified: trunk/languages/lua/src/lib/glut.pir
==============================================================================
--- trunk/languages/lua/src/lib/glut.pir (original)
+++ trunk/languages/lua/src/lib/glut.pir Sat Jul 26 09:08:21 2008
@@ -23,19 +23,17 @@
.sub '__onload' :anon :load
# print "__onload glut\n"
-
- load_bytecode 'library/OpenGL.pbc'
- load_bytecode 'library/NCI/call_toolkit_init.pbc'
-
.const .Sub entry = 'luaopen_glut'
set_hll_global 'luaopen_glut', entry
.end
.sub 'luaopen_glut'
# print "luaopen_glut\n"
+ load_bytecode 'OpenGL.pir'
+ load_bytecode 'NCI/call_toolkit_init.pir'
# Import all OpenGL/GLU/GLUT functions
- $P0 = get_global ['OpenGL'], '_export_all_functions'
+ $P0 = get_hll_global ['OpenGL'], '_export_all_functions'
$P0()
.local pmc _lua__GLOBAL
Added: trunk/languages/lua/t/gl.t
==============================================================================
--- (empty file)
+++ trunk/languages/lua/t/gl.t Sat Jul 26 09:08:21 2008
@@ -0,0 +1,51 @@
+#! perl
+# Copyright (C) 2008, The Perl Foundation.
+# $Id$
+
+=head1 NAME
+
+t/gl.t - OpenGL library
+
+=head1 SYNOPSIS
+
+ % perl -I../lib -Ilua/t lua/t/gl.t
+
+=head1 DESCRIPTION
+
+Tests OpenGL
+(implemented in F<languages/lua/src/lib/gl.pir>
+and F<languages/lua/src/lib/glut.pir>).
+
+=cut
+
+use strict;
+use warnings;
+use FindBin;
+use lib "$FindBin::Bin";
+
+use Parrot::Test;
+use Test::More;
+use Parrot::Test::Lua;
+
+my $test_prog = Parrot::Test::Lua::get_test_prog();
+if ( $test_prog eq 'lua' ) {
+ plan skip_all => "parrot only";
+}
+else {
+ plan tests => 1;
+}
+
+language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'require' );
+require "glut"
+require "gl"
+print "OpenGL"
+CODE
+OpenGL
+OUTPUT
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4: