diff options
author | Daniel Franke <franke@edf-online.de> | 2018-05-18 19:59:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-06-26 18:21:18 (GMT) |
commit | 8661e7052c4f711f13e7168231276e23c4c0defd (patch) | |
tree | eddefa9320ae82c187179b9e9664a9c12008e172 /Tests/RunCMake/math | |
parent | 7c4c13ffef87d748b896e2c762ad0b2c00afcd31 (diff) | |
download | CMake-8661e7052c4f711f13e7168231276e23c4c0defd.zip CMake-8661e7052c4f711f13e7168231276e23c4c0defd.tar.gz CMake-8661e7052c4f711f13e7168231276e23c4c0defd.tar.bz2 |
math: Diagnose divide-by-zero
Diffstat (limited to 'Tests/RunCMake/math')
-rw-r--r-- | Tests/RunCMake/math/MATH-DivideByZero-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/math/MATH-DivideByZero-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/math/MATH-DivideByZero.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/math/RunCMakeTest.cmake | 1 |
4 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/math/MATH-DivideByZero-result.txt b/Tests/RunCMake/math/MATH-DivideByZero-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/math/MATH-DivideByZero-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/math/MATH-DivideByZero-stderr.txt b/Tests/RunCMake/math/MATH-DivideByZero-stderr.txt new file mode 100644 index 0000000..66ad633 --- /dev/null +++ b/Tests/RunCMake/math/MATH-DivideByZero-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at MATH-DivideByZero.cmake:1 \(math\): + math cannot evaluate the expression: "100/0": divide by zero. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/math/MATH-DivideByZero.cmake b/Tests/RunCMake/math/MATH-DivideByZero.cmake new file mode 100644 index 0000000..3ac161e --- /dev/null +++ b/Tests/RunCMake/math/MATH-DivideByZero.cmake @@ -0,0 +1 @@ +math(EXPR var "100/0") diff --git a/Tests/RunCMake/math/RunCMakeTest.cmake b/Tests/RunCMake/math/RunCMakeTest.cmake index d767547..4c4b725 100644 --- a/Tests/RunCMake/math/RunCMakeTest.cmake +++ b/Tests/RunCMake/math/RunCMakeTest.cmake @@ -2,3 +2,4 @@ include(RunCMake) run_cmake(MATH) run_cmake(MATH-InvalidExpression) +run_cmake(MATH-DivideByZero) |