[UnitTest] Make unit tests deterministic with fixed seed
Compare changes
Files
9- Christophe Guillon authored
Use the getSeed() method provided by Catch to initialize the random number generator instead of using the default random device. This allows to make the tests deterministic when --rng-seed <seed> option is passed. Also this allows to report a test failure by specifying the seed as reported in the test output, which can then be reproduced with --rng-seed <reported_seed>.
+ 5
− 4
@@ -14,13 +14,14 @@
@@ -127,7 +128,7 @@ TEST_CASE("[core/data] Tensor(Construction)", "[Tensor][Constructor]") {
@@ -169,7 +170,7 @@ TEST_CASE("[core/data] Tensor(getter/setter)", "[Tensor][Getter][Setter]") {
@@ -261,7 +262,7 @@ TEST_CASE("[core/data] Tensor(other)", "[Tensor][extract][zeros][print]") {