rust3ds/ctru-rs

Unit Testing

Meziu opened this issue · 2 comments

Meziu commented

I just discovered this exists: https://doc.rust-lang.org/unstable-book/language-features/custom-test-frameworks.html.
Would need integration with cargo-3ds.

This issue has no priority, but it would be cool if we ever ran out of issues to work on (unlikely...).

Just leaving a note as I tried to build a test executable for fun, and got these linker errors:

$ cargo 3ds test -vv --no-run --lib |& egrep -o 'undefined reference .+' | sort | uniq 
undefined reference to `execvp'
undefined reference to `getpwuid_r'
undefined reference to `getuid'
undefined reference to `pipe'
undefined reference to `pthread_sigmask'
undefined reference to `sigemptyset'
undefined reference to `sysconf'

Some of these (particularly pipe + execvp, maybe pthread_sigmask and sigemptyset) seem tricky or maybe impossible for us to stub out, but I believe that would be the minimum set of other symbols we'd need to use the default test implementation. Perhaps using the custom test framework would require less work than shoehorning the existing test runner, but that feature is unstable with very little documentation, so I'm not really sure. Just another option to potentially consider.

Meziu commented

If the custom test runner lets us use tests implemented for the default runner, there is no problem trying.