I have been playing with unit testing with google test for nds homebrew inside desmume.
It works great so far but I would like to have access to advance features of google test (streams redirection to be able to capture stdout) yet this require dup and dup2().
The headers for these 2 system calls are in sys\system_unistd.h so my homebrew compiles but it doesn't link,
because of undefined references to dup() and dup2().
Is this my fault ? can some other devkitarm users use dup() ans dup2() ?
If the answer is yes, could you tell me in which .a library or .o file the objects for those 2 system calls are suposed to be ?
If the answer is no, could someone send me the dup.c and dup2.c files ?
Best regards,
Lakedaemon
dup() and dup2() ?
-
- Site Admin
- Posts: 2004
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: dup() and dup2() ?
stream redirection isn't supported, sorry. Despite appearances to the contrary there is no underlying OS and some things don't work.
-
- Posts: 4
- Joined: Mon Aug 16, 2010 8:48 pm
Re: dup() and dup2() ?
It's okey ^^;
Don't worry about it.
Knowing this already helps me a lot (that explains why I couldn't capture stdout with googletest) :
I won't spend more time trying to make streams redirection work when it's not possible.
Thanks for the helpful answer
If you are interested, I managed to make google test work (by using a different event listener) and it has already been very helpfull to find bugs for me (that I wouldn't have found otherwise) :
The googletest code runs in a .nds rom that you launch in a custom build of desmume (that listens to some signal from the .nds rom it is emulating)
and that passes through the content of the stdout of the .nds rom to the stdout of desmume
It allows you to make unit testing a breeze.
(of course it is as perfect as desmume's emultion, but well, that means that it's quite good).
Don't worry about it.
Knowing this already helps me a lot (that explains why I couldn't capture stdout with googletest) :
I won't spend more time trying to make streams redirection work when it's not possible.
Thanks for the helpful answer
If you are interested, I managed to make google test work (by using a different event listener) and it has already been very helpfull to find bugs for me (that I wouldn't have found otherwise) :
The googletest code runs in a .nds rom that you launch in a custom build of desmume (that listens to some signal from the .nds rom it is emulating)
and that passes through the content of the stdout of the .nds rom to the stdout of desmume
It allows you to make unit testing a breeze.
(of course it is as perfect as desmume's emultion, but well, that means that it's quite good).
Re: dup() and dup2() ?
Lakedaemon, I know this is a bit old, but would you be willing to post your code here under the Apache 2.0 license? Explanations would also be helpful, of course. 
I've been trying to use Boost's library with little success. Printing test results to the tiny screen isn't that great, either. I think perhaps integrating more with the emulator would be better, as you had done with DeSmuMe.

I've been trying to use Boost's library with little success. Printing test results to the tiny screen isn't that great, either. I think perhaps integrating more with the emulator would be better, as you had done with DeSmuMe.
-
- Posts: 4
- Joined: Mon Aug 16, 2010 8:48 pm
Re: dup() and dup2() ?
I'm living away from home for the next 2 months.
And the code is on the computer at home...
Some of it has been published on the internet in a google group about googletest and maybee the desmume/devkitpro forums
try googling for "googletest nintendo ds"
It was working real fine...but I only used it for like 2 weeks and then lost focus...had to work on other stuff
And the code is on the computer at home...
Some of it has been published on the internet in a google group about googletest and maybee the desmume/devkitpro forums
try googling for "googletest nintendo ds"
It was working real fine...but I only used it for like 2 weeks and then lost focus...had to work on other stuff
Who is online
Users browsing this forum: No registered users and 4 guests