diff --git a/sus/CMakeLists.txt b/sus/CMakeLists.txt index 8bd66dfb7..0a6a3b809 100644 --- a/sus/CMakeLists.txt +++ b/sus/CMakeLists.txt @@ -299,14 +299,12 @@ if(${SUBSPACE_BUILD_TESTS}) "num/f64_unittest.cc" "num/i8_unittest.cc" "num/i16_unittest.cc" - "num/i32_overflow_unittest.cc" "num/i32_unittest.cc" "num/i64_unittest.cc" "num/isize_unittest.cc" "num/overflow_integer_unittest.cc" "num/u8_unittest.cc" "num/u16_unittest.cc" - "num/u32_overflow_unittest.cc" "num/u32_unittest.cc" "num/u64_unittest.cc" "num/uptr_unittest.cc" @@ -328,18 +326,32 @@ if(${SUBSPACE_BUILD_TESTS}) "tuple/tuple_unittest.cc" ) + add_executable(subspace_overflow_unittests + "num/i32_overflow_unittest.cc" + "num/u32_overflow_unittest.cc" + ) + # Subspace test support subspace_test_default_compile_options(subspace_test_support) target_link_libraries(subspace_test_support subspace::lib) # Subspace unittests subspace_test_default_compile_options(subspace_unittests) - target_link_libraries(subspace_unittests + target_link_libraries(subspace_unittests subspace::lib subspace::test_support gtest_main ) - gtest_discover_tests(subspace_unittests) + + # Subspace overflow unittests + subspace_test_default_compile_options(subspace_overflow_unittests) + target_compile_options(subspace_overflow_unittests PUBLIC -DSUS_CHECK_INTEGER_OVERFLOW=false) + target_link_libraries(subspace_overflow_unittests + subspace::lib + subspace::test_support + gtest_main + ) + gtest_discover_tests(subspace_overflow_unittests) endif() diff --git a/sus/num/i32_overflow_unittest.cc b/sus/num/i32_overflow_unittest.cc index 31aabfccc..6ddfad4be 100644 --- a/sus/num/i32_overflow_unittest.cc +++ b/sus/num/i32_overflow_unittest.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#define SUS_CHECK_INTEGER_OVERFLOW false - #include "googletest/include/gtest/gtest.h" #include "sus/prelude.h" #include "sus/test/ensure_use.h" diff --git a/sus/num/u32_overflow_unittest.cc b/sus/num/u32_overflow_unittest.cc index 608f501af..9d546e09e 100644 --- a/sus/num/u32_overflow_unittest.cc +++ b/sus/num/u32_overflow_unittest.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#define SUS_CHECK_INTEGER_OVERFLOW false - #include "googletest/include/gtest/gtest.h" #include "sus/prelude.h" #include "sus/test/ensure_use.h"