mamod/Pode

Tests fails on OS X

Closed this issue · 4 comments

Trying to install pode (for learning) and got the following:

$ perl Makefile.PL 
Checking if your kit is complete...
Warning: the following files are missing in your kit:
    lib/Pode/NativeModules/test.js
Please inform the author.
Generating a Unix-style Makefile
Writing Makefile for Pode
Writing MYMETA.yml and MYMETA.json

also the make test returns:

$ make test
cp lib/Pode/NativeModules/colors.js blib/lib/Pode/NativeModules/colors.js
cp lib/Pode/NativeModules/testUnit.js blib/lib/Pode/NativeModules/testUnit.js
cp lib/Pode/NativeModules/child_process.js blib/lib/Pode/NativeModules/child_process.js
cp lib/Pode/Open.pm blib/lib/Pode/Open.pm
cp lib/Pode/Wrapper.pm blib/lib/Pode/Wrapper.pm
cp lib/Pode/NativeModules/timer_wrap.js blib/lib/Pode/NativeModules/timer_wrap.js
cp lib/Pode/NativeModules/mime.js blib/lib/Pode/NativeModules/mime.js
cp lib/Pode/TTY.pm blib/lib/Pode/TTY.pm
cp lib/Pode/NativeModules/_rbtree.js blib/lib/Pode/NativeModules/_rbtree.js
cp lib/Pode/NativeModules/events.js blib/lib/Pode/NativeModules/events.js
cp lib/Pode/Fs.pm blib/lib/Pode/Fs.pm
cp lib/Pode/NativeModules/util.js blib/lib/Pode/NativeModules/util.js
cp lib/Pode/NativeModules/http.js blib/lib/Pode/NativeModules/http.js
cp lib/Pode/NativeModules/stream.js blib/lib/Pode/NativeModules/stream.js
cp lib/Pode/NativeModules/coffee-script.js blib/lib/Pode/NativeModules/coffee-script.js
cp lib/Pode/NativeModules/vm.js blib/lib/Pode/NativeModules/vm.js
cp lib/Pode/NativeModules/assert.js blib/lib/Pode/NativeModules/assert.js
cp lib/Pode/NativeModules/binary.js blib/lib/Pode/NativeModules/binary.js
cp lib/Pode/Utils.pm blib/lib/Pode/Utils.pm
cp lib/Pode.pm blib/lib/Pode.pm
cp lib/Pode/NativeModules/console.js blib/lib/Pode/NativeModules/console.js
cp README.pod blib/lib/README.pod
cp lib/Pode/NativeModules/_treebase.js blib/lib/Pode/NativeModules/_treebase.js
cp lib/Pode/IP.pm blib/lib/Pode/IP.pm
cp lib/Pode/Buffer.pm blib/lib/Pode/Buffer.pm
cp lib/Pode/NativeModules/path.js blib/lib/Pode/NativeModules/path.js
cp lib/Pode/NativeModules/pode.js blib/lib/Pode/NativeModules/pode.js
cp lib/Pode/NativeModules/timers.js blib/lib/Pode/NativeModules/timers.js
cp lib/Pode/bin/daemon.pl blib/lib/Pode/bin/daemon.pl
cp lib/Pode/Repl.pm blib/lib/Pode/Repl.pm
cp lib/Pode/NativeModules/fs.js blib/lib/Pode/NativeModules/fs.js
cp lib/Pode/HTTP.pm blib/lib/Pode/HTTP.pm
cp lib/Pode/IPC.pm blib/lib/Pode/IPC.pm
cp lib/Pode/NativeModules/repl.js blib/lib/Pode/NativeModules/repl.js
cp lib/Pode/NativeModules/eval.js blib/lib/Pode/NativeModules/eval.js
cp lib/Pode/NativeModules/_linklist.js blib/lib/Pode/NativeModules/_linklist.js
cp lib/Pode/Stream.pm blib/lib/Pode/Stream.pm
cp lib/Pode/NativeModules/require.js blib/lib/Pode/NativeModules/require.js
cp lib/Pode/bin/nohup.exe blib/lib/Pode/bin/nohup.exe
cp lib/Pode/NativeModules/buffer.js blib/lib/Pode/NativeModules/buffer.js
cp script/pode blib/script/pode
"/Users/clt/.anyenv/envs/plenv/versions/5.20.3/bin/perl5.20.3" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pode
PERL_DL_NONLAZY=1 "/Users/clt/.anyenv/envs/plenv/versions/5.20.3/bin/perl5.20.3" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/Pode.t ......... ok   
t/pode_all.t ..... load package/index.js

-> Fail | 15 == 12
Caller -> undefined @ undefined

-> Fail | 15 == 6
Caller -> undefined @ undefined


2 of 211 Tests Failed ( 3.065 seconds )
# Looks like your test exited with 1 before it could output anything.
t/pode_all.t ..... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 
t/pode_buffer.t .. 

9301 Tests Ran Successfully ( 5.34 seconds )
t/pode_buffer.t .. ok   
t/pode_fs.t ...... close() on unopened filehandle . at /me/github/Pode/blib/lib/Pode/Fs.pm line 95, <GEN4> line 10153.
close() on unopened filehandle . at /me/github/Pode/blib/lib/Pode/Fs.pm line 95, <GEN4> line 10173.


10039 Tests Ran Successfully ( 2.484 seconds )
t/pode_fs.t ...... ok   

Test Summary Report
-------------------
t/pode_all.t   (Wstat: 256 Tests: 0 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 1 tests but ran 0.
Files=4, Tests=3, 12 wallclock secs ( 1.58 usr  0.22 sys +  8.25 cusr  1.29 csys = 11.34 CPU)
Result: FAIL
Failed 1/4 test programs. 0/3 subtests failed.
make: *** [test_dynamic] Error 255

The interesting parts from the prove -rbv are:

2 1444561369035
------------------------------------------------------
------------------------------------------------------

-> Fail | 15 == 12
------------------------------------------------------
Caller -> undefined @ undefined
------------------------------------------------------
------------------------------------------------------
------------------------------------------------------
3 1444561369045

...

30 1444561369313
------------------------------------------------------
------------------------------------------------------
------------------------------------------------------

-> Fail | 15 == 6
------------------------------------------------------
Caller -> undefined @ undefined
------------------------------------------------------

Unfortunately I haven't any idea how to help track down the error source... :(

mamod commented

Thank you for submitting this issue, please note though that the whole idea behind this module was experimental and didn't evolve, so I'm not sure if this is of any good use even for learning purposes, mind you tell me what your looking for, or trying to learn I might be of a good help some where else :)

Sorry for not mentioning that in the docs, so I'll take a look at this issue, and try to fix but can't promise much :(

It is ok if you didn't fix it. Because I know nothing about Javascript (yet), but i know (a little bit) perl - just tried install something what resembles node.js in friendly (read perlish) environment. :) I just want learn how some node.js "things" should be implemented in perl (like "require" and such) and the pode will be perfect even without clean install.

And why? Maybe sometime (in the (very) FAR future :)) I could try port nunjucsks to the perl - e.g. the nunjucks parsing will be done in perl, but the generated JavaScript will be executed sandboxed using your JavaScript::Duktape module. (btw, it is really wonderful piece of work - at least, for what i tried it yet).

I reported the bug - but don't waste your time with fixing - it isn't crucial for me. ;) Thanks for the answer.

mamod commented

@jomo666 sorry for the delay, health issue :)

Thank you and glad you liked JavaScript::Duktape

I'm in the process of porting Comojs to perl, not sure how things will go so far, but I think it will be easier porting javascript libraries using it. Hope it will be useful too :)

Please let me know if you have any question regarding node/perl, I'll be more than happy to help.

Old issue - no longer needed - closing.