gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
<thelema> let float_print oc x = fprintf oc "%5.3f" x
<alexyk> thelema: cool, thx
lamawithonel__ has quit [Ping timeout: 264 seconds]
coucou747 has quit [Ping timeout: 272 seconds]
coucou747 has joined #ocaml
groovy2shoes has left #ocaml []
thatch has joined #ocaml
myu2 has joined #ocaml
hnrgrgr has quit [Quit: leaving]
hnrgrgr has joined #ocaml
hnrgrgr has quit [Client Quit]
hnrgrgr has joined #ocaml
hnrgrgr has quit [Client Quit]
hnrgrgr has joined #ocaml
hnrgrgr has quit [Quit: leaving]
hnrgrgr has joined #ocaml
hnrgrgr has quit [Client Quit]
elehack has joined #ocaml
hnrgrgr has joined #ocaml
hnrgrgr has quit [Client Quit]
alexyk has quit [Quit: alexyk]
bzzbzz has quit [Quit: leaving]
drunK has quit [Remote host closed the connection]
joewilliams is now known as joewilliams_away
joewilliams_away is now known as joewilliams
myu2 has quit [Remote host closed the connection]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
Amorphous has quit [Ping timeout: 272 seconds]
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
MajorPSP156 has joined #ocaml
Amorphous has joined #ocaml
MajorPSP156 has quit [Quit: bai]
elehack has quit [Quit: Farewell, programs.]
cyanure has joined #ocaml
ymasory has quit [Remote host closed the connection]
snarkyboojum has joined #ocaml
eye-scuzzy has quit [Ping timeout: 240 seconds]
eye-scuzzy has joined #ocaml
myu2 has joined #ocaml
thatch has quit [Remote host closed the connection]
thatch has joined #ocaml
thatch__ has joined #ocaml
thatch has quit [Ping timeout: 255 seconds]
joewilliams is now known as joewilliams_away
thatch has joined #ocaml
thatch__ has quit [Read error: Connection reset by peer]
cyanure has quit [Remote host closed the connection]
thatch has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
joewilliams_away is now known as joewilliams
Snark has joined #ocaml
thatch has joined #ocaml
thatch has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 276 seconds]
ftrvxmtrx has quit [Ping timeout: 276 seconds]
ftrvxmtrx has joined #ocaml
fraggle_ has quit [Ping timeout: 250 seconds]
fraggle_ has joined #ocaml
myu2_ has joined #ocaml
myu2 has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
myu2_ has quit [Ping timeout: 240 seconds]
yroeht has quit [K-Lined]
ikaros has joined #ocaml
myu2 has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
boscop has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
coucou747 has quit [Read error: Operation timed out]
coucou747 has joined #ocaml
ttamttam has joined #ocaml
myu2 has quit [Remote host closed the connection]
ikaros has quit [Quit: Leave the magic to Houdini]
Yoric has joined #ocaml
mike_mcclurg has quit [Ping timeout: 240 seconds]
brendan has quit [Ping timeout: 255 seconds]
myu2 has joined #ocaml
mike_mcclurg has joined #ocaml
avsm has joined #ocaml
_andre has joined #ocaml
ftrvxmtrx has joined #ocaml
DimitryKakadu has joined #ocaml
kaustuv_ has quit [Read error: Operation timed out]
Yoric has quit [Ping timeout: 255 seconds]
Yoric has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ttamttam has joined #ocaml
DimitryKakadu has quit [Ping timeout: 260 seconds]
DimitryKakadu has joined #ocaml
BiDOrD has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]
Yoric has quit [Quit: Yoric]
BiDOrD has quit [Read error: Operation timed out]
ftrvxmtrx has quit [Quit: Leaving]
seafood_ has joined #ocaml
drunK has joined #ocaml
seafood_ is now known as seafood
myu2 has joined #ocaml
ounit has joined #ocaml
<ounit> does someone here work with ounit?
<ounit> no one?
<thelema> ounit: I've worked with it
oriba has joined #ocaml
<ounit> perfect, do you now some tutorials or something like that, which gives me a good introduction?
<f[x]> ounit.mli
<f[x]> and generated html doc are more than enough
<ounit> really?
<f[x]> yes
<f[x]> and there is documentation page with examples on project page
<avsm2> there is quite a big set of real tests here: https://github.com/avsm/ocaml-orm-sqlite/tree/master/lib_test if it helps
ygrek has joined #ocaml
coucou747 has quit [Quit: 0x2a]
<ounit> do i have to put my test.ml file in the same folder with the file to be tested?
<thelema> ounit: no, it just has to be able to find the code being tested to compile
<thelema> so if they're in different folders, you'll have to tell ocaml where the code being tested is
<thelema> just like you'd have to tell it where the libraries you're using are
<ounit> thelema: how?
<ounit> thelema: via open?
<thelema> no, in the command line, when you compile
ounit has quit [Quit: http://irc2go.com/]
drunK has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
seafood has quit [Ping timeout: 240 seconds]
drunK has joined #ocaml
jm has joined #ocaml
gmarik has joined #ocaml
coucou747 has joined #ocaml
mike_mcclurg has quit [Ping timeout: 240 seconds]
eye-scuzzy has quit [Quit: leaving]
mike_mcclurg has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
LeNsTR has joined #ocaml
LeNsTR has quit [Changing host]
LeNsTR has joined #ocaml
LeNsTR has quit [Client Quit]
<kaustuv> Is github unusually slow for anyone else? Like ~2 minutes for a git pull?
* thelema tries
<thelema> nope, took ~5 seconds for me
<kaustuv> Damn gremlins must be eating my packets
<thelema> github.com has address 207.97.227.239
<thelema> maybe you're using a bad server?
LeNsTR|away has joined #ocaml
LeNsTR|away has quit [Changing host]
LeNsTR|away has joined #ocaml
<thelema> or maybe github is just being flaky, as it's wont to do
<kaustuv> What is the difference between batteries.mllib and batteries_uni.mllib ?
cyanure has joined #ocaml
<thelema> batteries_uni.mllib is the list of modules assembled into batteries_uni.cma cnd .cmxa
<thelema> right now the only difference is BatMutex, BatRMutex and the Batteries (to replace Batteries_uni)
<kaustuv> Yeah, but what is the diff. between batteries.cm(x)a and batteries_uni.cm(x)a?
<thelema> one supports threads, while the other works in a thread-free compile
<thelema> "uni = no threads", somehow I got the name from uniprocess
<thelema> looking back, it's a pretty terrible name
<kaustuv> Yeah, it might not be an optimal name because uni can = universe, and anyway -threads doesn't give you multiprocessing
<thelema> yes, I know
<thelema> but "nothread" seemed too long
<thelema> the plan for 2.0 when we can break backwards compatibility is to have "batteries" be non-threaded and "batteries_thr" be threaded
<mrvn> name it the same way the stdlib does
<mrvn> /usr/lib/ocaml/threadUnix.mli
<thelema> ThreadBatteries?
<mrvn> small t.
<thelema> open ThreadBatteries
<mrvn> Or is that Thread::Unix?
<mrvn> thelema: does the threaded batteries have more functions?
<thelema> mrvn: it has Mutex and RMutex modules that non-threaded doesn't
<mrvn> Ahh, so you can't do archive(native) = "unix.cmxa" and archive(byte,mt_vm) = "vmthreads/unix.cma" automatic switching.
<mrvn> And why is that vmthreads/unix.cma there? Whats threadUnix.mli for then?
<thelema> iirc, one still does 'open Unix'
<thelema> even in threaded programs
<mrvn> thelema: exactly. The META file picks the right unix.cma for you.
<mrvn> But forget the threadUnix suggestion. That seems to have to do with the old Thread::Unix module.
<hcarty> thelema: Could Mutex and RMutex be replaced by dummy versions in the non-thread case?
<thelema> probably
<thelema> If someone wants to make it work automatically, I wouldn't mind.
<mrvn> hcarty: easily. You just use an int and increment/decrement it without locking.
<thelema> I don't recall why we failed at doing this before... maybe we just need a src/threads folder
<thelema> there was something that prevented doing it automatically before.
<mrvn> thelema: how does that work with the unix module and bytecode? There doesn't seem to be a thread and non-thread version?
<thelema> there is a thread version in otherlibs/threads/unix.ml
<thelema> and a nonthread version in otherlibs/unix/unix.ml
<mrvn> which generate /usr/lib/ocaml/unix.cma and /usr/lib/ocaml/vmthreads/unix.cma
<thelema> yup.
<mrvn> aeh, sorry. I ment how does this work for native code. There is only /usr/lib/ocaml/unix.cmxa, no vmthreads version.
* thelema doesn't know
<thelema> maybe it's already threadsafe in native code?
<mrvn> anyway, if you add dummy Mutex/RMutex modules so the interface is the same you can do the archive(byte,mt_vm) = ... trick.
eye-scuzzy has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
ulfdoz has joined #ocaml
NaCl is now known as melatonin
oriba has quit [Quit: Verlassend]
melatonin is now known as NaCl
NaCl is now known as NameStolen
NameStolen is now known as Invincible
ftrvxmtrx has quit [Quit: Leaving]
avsm has quit [Quit: Leaving.]
brendan has joined #ocaml
Invincible is now known as NaCl
ikaros has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Client Quit]
Obfuscate has quit [Read error: Connection reset by peer]
ttamttam has quit [Remote host closed the connection]
<jm> Is there a good reason why BatSet doesn't have a subset function (it's part of the BatSet.S module type)?
Associat0r has joined #ocaml
<thelema> jm: the upcoming release has a compare_subset function that returns the information you want ... hmm, still only for functorized sets, not polymorphic ones...
<thelema> jm: you're welcome to write one with a few tests, and we can include it.
<thelema> I think the limiting factor is the ordering of the sets - even if they're the same type, different comparison functions make this inefficient
<jm> thelema: Thanks! Well, I don't really care about efficiency in my current application so mine version would be very naive and possibly not approriate for batteries...
<thelema> I can assure you that there's a few set/map functions that aren't so efficient
<thelema> such as BatSet.union, which just adds all the elements in the second set to the first with a fold
<jm> Ok, here's what I would do: let subset s1 s2 = forall (fun x -> mem x s2) s1.
<jm> *for_all
<jm> Still think you want something like this in batteries? :p
<thelema> I'm writing the mli docs right now
<mrvn> Can't you get access to the comparison function and if they are equal then compare efficiently?
<thelema> mrvn: yes. bluestorm has a branch which does this - yet unmerged
<mrvn> As for union. It is a bit hard to insert into a tree without starting from the root each time. At lest if each insert balances.
<thelema> jm: how should I attribute your code?
<mrvn> thelema: .oO(reject patch unless attributed properly in its header :)
<jm> thelema: That's fine. It's too trivial for an attribution.
ftrvxmtrx has joined #ocaml
<thelema> mrvn: I just copied the code from IRC to batSet.ml, there's no patch
<thelema> jm: are you going to make me track you down so I can put you in the commit log?
<jm> thelema: What exactly do you need from me? My name? Or a github account name?
<thelema> although this will be more difficult with you being in the UK.
<thelema> usually git commits are attributed to a "Full Name <email@address>"
<thelema> if you insist, I can attribute it to less, but "JM <JM@ip address on #ocaml@freenode>" isn't a very good one
<jm> Ok, ok. Make it: "Justus Matthiesen <justus.matthiesen@gmail.com>".
<jm> thelema: Awesome!
<mrvn> jm: now you are famous.
<thelema> jm: your next commit, please write the doc for
<mrvn> When the aliens invade they will forever wonder who this Justus was that wrote this horrible code. :)))
<thelema> and the tests
<jm> thelema: Sure thing (my first commit was completely unintentional, after all)!
<mrvn> I'm veen thinking. With a functional set wouldn't it be faster to remove each element from the first set from the second. If one isn't present the sets aren't equal. If the set is empty at the end they are equal.
<thelema> it passed all tests the first time, though. that counts for something
<thelema> mrvn: that sounds like it'd work - show me the code.
<mrvn> jm: care to implement that and compare for different sized sets?
<thelema> on the other hand, the lower levels of the set would likely be cached, and the cost of rebalancing once might kill any benefit gained.
<jm> That's a relieve because I didn't actually run the code.
<mrvn> thelema: sure, the remove costs more that member but the set will be getting smaller and smaller.
<mrvn> thelema: you could improve it by an unbalanced removal.
<thelema> I dunno about all the rebalances that would be necessary. Maybe if the elements could be removed in random order...
<thelema> or in some order less likely to unbalance the tree than sorted min -> max
<mrvn> thelema: if the comparison function is the same the order will be in order. otherwise who knows.
<mrvn> But removal without balancing will just shorten the paths until you end up with an empty set. that would be ideal.
<thelema> in order removals are bad just as in order inserts are bad
<mrvn> thelema: do you know of some algorithm to do inorder removal/insert?
<thelema> I recall seeing one...
<thelema> but I can't seem to google it ATM
<mrvn> Specifically I have a list of sorted and continious keys (no gaps) and want to insert them into a B-Tree. Or I want to remove all keys between A and B.
<mrvn> The other case I often have is that I insert at the end. That is also verry bad for the balance.
<mrvn> One thing I'm currently doing is that if the node is the rightmost node of a level and needs splitting then I move nearly all elements in the lower node instead of half and half.
<thelema> kaustuv: you're awesome.
<kaustuv> thelema: it is untested, but hopefully the bugs are easy to fix
<thelema> I'm not sure whether you'll need to do string handling within comments - ocaml proper does
<kaustuv> thelema: OK, testing reveals a bunch of bugs. Fixes forthcoming.
ounit has joined #ocaml
<kaustuv> thelema: hmm, I seem to have misunderstood what (*** does. Need to rewrite that bit
<thelema> iirc, it just inlines what's in the ocmment into the test file
<thelema> kaustuv: I might just hack this so that compile errors are pointed back to the original file instead of to the _t.ml file
Yoric has joined #ocaml
<thelema> fun with line number directives: http://caml.inria.fr/pub/docs/manual-ocaml/lex.html
drunK has quit [Remote host closed the connection]
<kaustuv> thelema: I am still debugging that, so please don't hack on it yet. I'll give you a pull request when make test works for me locally.
<thelema> ok, well I seem to have it hooked into the build system satisfactorily, so don't worry about that part,
<kaustuv> Actually, just fetch that URL again. I think pushing to git will be hard given how much my local master has diverged. I would rather toss the work out than try to rewrite history.
<thelema> no problem.
<kaustuv> OK, all tests pass for me locally.
drunK has joined #ocaml
<thelema> things look good here too. running one more clean test before pushing
<thelema> ok, pushed.
<kaustuv> I would propose one modification to the inline tests syntax -- using (*{ }*) instead of (** **) -- to prevent accidental collision with ocamldoc
<kaustuv> (even if ocamldoc is only run on the .mlis)
<thelema> there was a couple accidental collisions with .ml ocamldocs that started with (**T...*), but I found and fixed them.
<thelema> in the future, I don't expect there to be too many problems that way, but we could probably require **) on tests, which would cut down the accident rate.
<thelema> further, we could require whitespace after the (**T
<ounit> someone here experienced wiht ounit?
<thelema> oh, you have already required the whitespace
<kaustuv> thelema: yes, and also the **) as terminator
<thelema> ounit: go ahead and ask
<thelema> well, I guess if someone does (**T ... *), they deserve to raise an error (instead of being treated as a normal comment)
<ounit> i am new at unit tests and should programm some tests in ounit, but have no idea how to start, has someone usefull pages or tutorials?
<thelema> although "(*** " might be common enough...
<ounit> i have read the rather short explanations on ounit homepage
<thelema> ounit: I assume you have some code to test. The usual way to do this is by having a separate program that runs the code and compares the result with the expected result, raising an error if there's a difference
<thelema> step 1: make a separate program that calls your code successfully, ignoring the result. It's best if this program has any needed input built in to it.
<thelema> (ounit isn't needed for step 1)
<ounit> i have working compiler files in separate folders can i make one main test file in the root folder to test the separated modules?
<thelema> step 2: add ounit to your step 1 program to check the result, so you get nice progress and harness integration, with nicer printing of any problems and heirarchical testing, plus naming for all your tests
<thelema> ounit: of course
<ounit> and how do i open those files so ounit doesnt complain?
<thelema> often people have source code in "lib/" and tests in "lib_test/", batteries has code in "src/" and tests in "testsuite/" and "qtest/"
<thelema> that's a step 1 problem, unrelated to ounit.
<thelema> ocamlc -I compiler_folder/ test.ml -o test
<thelema> (this is without ounit)
<thelema> with ounit, you probably want to use ocamlfind:
<thelema> ocamlfind ocamlc -package oUnit -I compiler_folder test.ml -o test
<ounit> can you explain that line, please
<thelema> "ocamlfind ocamlc" tells ocamlfind you want to compile bytecode, "-package oUnit" tells it to add whatever compiler options the oUnit package needs
<thelema> "-I compiler_folder/" adds compiler_folder/ to the include directory, so it'll be searched for .cmo files (the result of compiling your main program)
<thelema> and I hope you understand the rest
<ounit> not really
<thelema> "test.ml" says to compile the file test.ml, and "-o test" says to output the result to the file "test"
<ounit> i have a predone makefile in this folder so i had never to work with ocamlc or ocamlfind
<thelema> fair enough. you'll need to use that to build the compiler before you can build the tests
<thelema> ... I'm assuming you want to test various functions in the compiler, and not to test the whole compiler on various test programs
<ounit> yes exactly
<thelema> and I'm gone for the next hour and a half, be back then
<ounit> thanks, will be here than
_andre has quit [Quit: leaving]
ymasory has joined #ocaml
Snark has quit [Quit: Ex-Chat]
BiDOrD has joined #ocaml
BiDOrD has quit [Client Quit]
BiDOrD has joined #ocaml
drunK has quit [Remote host closed the connection]
drunK has joined #ocaml
LeNsTR|away has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 240 seconds]
ymasory has quit [Remote host closed the connection]
ygrek has joined #ocaml
mnabil has joined #ocaml
lpereira has joined #ocaml
myu2 has quit [Remote host closed the connection]
cyanure has quit [Quit: Quitte]
boscop has quit [Ping timeout: 240 seconds]
Yoric has quit [Quit: Yoric]
kaustuv_ has joined #ocaml
boscop has joined #ocaml
vk0 has quit [Read error: Operation timed out]
mfp_ has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
vk0 has joined #ocaml
Edward__ has joined #ocaml
mfp_ is now known as mfp
Obfuscate has joined #ocaml
<ounit> thelema: are you back?
<thelema> ounit: yes
Yoric has joined #ocaml
gmarik has quit [Quit: Leaving.]
gmarik has joined #ocaml
<ounit> thelema: perfect
<ounit> could you continue with explanation please
<thelema> that was my explanation. Have you tried to do what I listed as step 1?
<ounit> isnt that what my makefile does?
<thelema> no ounit, just write a program that calls the functions you want to test
<thelema> your makefile compiles your compiler
<thelema> you need to make a new file (call it test.ml) and call internal compiler functions from it.
<ounit> yes, now i can follow again
<ounit> i have such a test.ml file in the root folder
<thelema> And figure out how to compile that against the parts of the compiler you're compiling
<thelema> and you're calling one function from the compiler with appropriate arguments?
<ounit> thats where all the problems start
<thelema> appropriate arguments? or compiling?
<ounit> one step earlier, just for my understanding, i compile first the compiler and then i compile the test.ml?
<thelema> yes, use the makefile to compile the compiler
<thelema> then compile your test.ml against the .cmo/cmx files produced
<ounit> how do i compile against .cmo/cmx files?
<thelema> If you're calling a function Foo.bar, ocaml will want to find a file foo.cmo (for bytecode) or foo.cmx (for native compiled)
<thelema> if it's not in the current directory, you should add -I dir/ to the command line to tell it to look in dir/
<ounit> and if i have several different files to test in different folders, should i then write multiple dirs?
<thelema> -I dir1 -I dir2 -I dir3
<thelema> start with a single function and expand from there once it's working
ymasory has joined #ocaml
<ounit> the compiled test.ml, i start it with ./test ?
<kaustuv_> thelema: can you pull https://github.com/chaudhuri/batteries-included/commit/e1359a83 if you agree with the modification?
<thelema> ounit: yes
<thelema> ounit: before adding ounit, it's not important that the program do anything - the output of whatever functions you're testing can be ignored
<kaustuv_> thelema: also, there is a problem with make_suite (and also with the earlier make_suite.rb) -- if the tests are not in the top level of the module, then the generated file cannot compile. They can break even if the tests are in a submodule. This makes testing stuff like BatArray.Cap very convoluted
<thelema> kaustuv_: the changes look good. I guess we could parse module structure and use open M in .. for each test within a submodule
<ounit> thelema: why ignoring the output of the functions?
<thelema> ounit: because the purpose of step 1 is to just be able to compile against the code to be tested, part 2 adds the actual testing functions, and ounit consumes the output of the function itself
ygrek has quit [Ping timeout: 240 seconds]
Yoric has quit [Quit: Yoric]
<kaustuv_> thelema: yes, I thought about parsing the module structure, or at least the [module Foo = struct ... end] fragment. The full solution (i.e., for functors) would still be impossible, I think.
<thelema> sure, I think we'll have to do testing differently for i.e. Set.Make
<thelema> luckily we don't have too many of those
<ounit> thelema: now i can follow :)
<ounit> thelema: so basically the test.ml just contains open OUnit and let _ = run_test_tt_main () ?
DimitryKakadu has quit [Remote host closed the connection]
<thelema> ounit: a bit more than that - you'll want to run_test_tt_main on a group of tests
<ounit> thelema: but those tests do not call functions from the compiler?
<thelema> you can use "testgroup_name" >::: [ t1; t2; ... ] to make a group from tests t1 t2 t3
<thelema> and "test_name" >:: test_function to make a test
<thelema> the tests absolutely call functions from the compiler
<ounit> the tests t1 to t3 are empty?
<thelema> no, they're created by "test_name" >:: test_function
<thelema> and test_function probably uses OUnit.assert_equal to check that the output of the compiler function matches what it should be.
<ounit> open OUnit let test1 = assert_equal 7 (Graph.string_of_node 7) let graph_suite = "Graph-suite">::: ["test1">:: test1] let suite = "Test-suite">::: [graph_suite] let _ = run_test_tt_main suite
<ounit> something like that?
<thelema> yes, something like that, probably with some changes in test1:
<ounit> but that would call some theoretical function a test file
<thelema> let test1 () = assert_equal ~printer:string_of_int 7 (int_of_string (Graph.string_of_node 7))
<thelema> yes.
<ounit> but isnt that step 2?
<kaustuv_> Wasn't there a video tutorial for ounit somewhere?
<hcarty> kaustuv_: On Google Video I think
<ounit> i watched it, helped me nothing
<thelema> it uses eclipse for everything, it seems
<ounit> not step 2?
<thelema> ounit: yes, step 2 is basically the program you wrote with test1
shaun_ has joined #ocaml
<ounit> so how does step 1 look like?
<shaun_> hi, would someone be able to help with an OUnit problem please?
mnabil has quit [Ping timeout: 265 seconds]
BiDOrD has quit [Quit: BiDOrD]
<thelema> shaun_: maybe ounit can
<thelema> ounit: doesn't matter, the important part is successfully compiling
<shaun_> it compiles, but when run, produces no output and exits normally
<shaun_> i need to monitor changes in dynamic behaviour for an exntension to the compiler
<thelema> shaun_: it sounds very likely that ounit can help you
<shaun_> ok, will contact them, thanks
<kaustuv_> shaun_: it's hard to debug in the abstract. Do you have some code you can post somewhere?
<shaun_> basic test code from the example is in test2.ml:
<shaun_> ocamlfind ocamlc -o test -package oUnit -linkpkg -g test2.ml
<shaun_> works correctly, produces output etc
<thelema> shaun_: by "ounit", I mean the user here on irc
<shaun_> but when I compile with:
<shaun_> ocamlfind ocamlc -o ../../unit\ tests/tests -package oUnit -linkpkg -g -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -I ../../evaluation\ data utils/misc.cmo utils/tbl.cmo utils/config.cmo utils/clflags.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo utils/consistbl.cmo parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo parsing/syntaxerr.cmo parsing/parser.cmo parsing/lexer.cmo parsing/parse.cmo pars
<shaun_> ing/printast.cmo typing/unused_var.cmo typing/ident.cmo typing/path.cmo typing/primitive.cmo typing/types.cmo typing/btype.cmo typing/oprint.cmo typing/subst.cmo typing/predef.cmo typing/datarepr.cmo typing/env.cmo typing/typedtree.cmo typing/ctype.cmo typing/printtyp.cmo typing/includeclass.cmo typing/mtype.cmo typing/includecore.cmo typing/includemod.cmo typing/parmatch.cmo typing/typetexp.cmo typing/stypes.cmo typing/typecore.cmo typing/typedecl.c
<shaun_> mo typing/typeclass.cmo typing/typemod.cmo typing/tele.cmo '../../evaluation data/genericAst.cmo' '../../evaluation data/evaluationDatabase.cmo' bytecomp/lambda.cmo bytecomp/printlambda.cmo bytecomp/typeopt.cmo bytecomp/switch.cmo bytecomp/matching.cmo bytecomp/translobj.cmo bytecomp/translcore.cmo bytecomp/translclass.cmo bytecomp/translmod.cmo bytecomp/simplif.cmo bytecomp/runtimedef.cmo bytecomp/meta.cmo bytecomp/instruct.cmo bytecomp/bytegen.cmo
<shaun_> bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo driver/pparse.cmo driver/errors.cmo driver/compile.cmo driver/main_args.cmo driver/main.cmo \
<shaun_> ../../unit\ tests/test2.ml
<shaun_> compilation succeeds but produces no output when run
<thelema> shaun_: try to use pastebin-type things for larger pastes
<shaun_> oh, thanks
<kaustuv_> shaun_: maybe driver/main.cmo is calling exit() because it sees no command line args?
<kaustuv_> (The module initializers are run in the order in which the modules are specified in the command line...)
<thelema> shaun_: try only linking in the modules you need for testing
<shaun_> hmm, that is possible
<shaun_> will do, just thought it was strange that the executable exited normally
<shaun_> thanks
<kaustuv_> Add a let () = failwith "Hello, world" to test2.ml and see if the program exits abnormally
<shaun_> working now, the problem was main calling exit(), thanks all :D
<thelema> kaustuv_++
<kaustuv_> ITYM Pervasives.incr, HTH, HAND
<thelema> it's an ocamlbuild function, I just forgot the second argument.
<thelema> :P
jm has quit [Remote host closed the connection]
<ounit> thelema : thanks a lot gotta go
ounit has quit [Quit: http://irc2go.com/]
lpereira has quit [Quit: Leaving.]
gmarik has quit [Quit: Leaving.]
shaun_ has quit [Quit: Leaving]
<mfp> hmm seems a number of students got an assignment involving ounit(?)
<adrien> hahaha
<thelema> also involving a compiler that they haven't written...
ikaros has quit [Quit: Leave the magic to Houdini]
<thelema> I'd guess TAs for the compiler class that's using OCaml (that we're also getting beginner questions about), except they're in the wrong hemisphere
<thelema> the compiler they're working on looks a bit like caml-light
<kaustuv_> ounit is such a trivial library that it must either not do something basic that other testing libraries such as JUnit do (reflection?) or unit testing must be a fundamentally bogus software engineering discipline
<thelema> quickcheck is a pretty trivial library too. Unit testing is bogus in most situations.
<kaustuv_> Well, quickcheck is good for checking the obvious boundary conditions, and it did find a bug in my code recently, so I am not entirely against it
<thelema> unit testing is good for library code, not quite as good for user-facing code
ftrvxmtrx has quit [Quit: Leaving]
tautologico has joined #ocaml
kaustuv_ has left #ocaml []
drunK has quit [Remote host closed the connection]
boscop has quit [Ping timeout: 240 seconds]