shader-slang / slang-python

Superseded by github.com/shader-slang/slang-torch
MIT License
26 stars 3 forks source link

hard-rasterizer-example: fix unittest #10

Closed kenshi84 closed 8 months ago

kenshi84 commented 8 months ago

So that it actually executes the unit test. Also the last test_render_pixel_fwd_diff was failing, and I figured that the indices were not properly set. Hopefully these changes are correct (I'm totally new to slang), and also it'd be nice if the compiler would report those errors.

saipraveenb25 commented 8 months ago

Hi Kenshi,

The last test is indeed incorrect, thank you for the fix!

As for adding unittest.main() to test.py, I would rather than we use the command line interface instead, by running python3 -m unittest discover or python3 -m unittest test rather than explicitly running the test file. Adding a __main__ routine to test.py will prevent this command from working correctly.

I'll add this to the README so it's clear how to run the tests.

kenshi84 commented 8 months ago

Glad that my fix was correct. And removed the unittest.main() bit.