Disable tests which will require LIBJPEG when Jasper was
built without LIBJPEG.

Bug: https://bugs.gentoo.org/629898

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -393,12 +393,14 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/test/bin/wrapper.in"
   "${CMAKE_CURRENT_BINARY_DIR}/test/bin/wrapper" @ONLY)
 
 if (BASH_PROGRAM)
-	add_test(run_test_1
-	  "${BASH_PROGRAM}" "${CMAKE_CURRENT_BINARY_DIR}/test/bin/wrapper"
-	  "${CMAKE_CURRENT_SOURCE_DIR}/test/bin/run_test_1")
-	add_test(run_test_2
-	  "${BASH_PROGRAM}" "${CMAKE_CURRENT_BINARY_DIR}/test/bin/wrapper"
-	  "${CMAKE_CURRENT_SOURCE_DIR}/test/bin/run_test_2")
+	if (JAS_ENABLE_LIBJPEG)
+		add_test(run_test_1
+		  "${BASH_PROGRAM}" "${CMAKE_CURRENT_BINARY_DIR}/test/bin/wrapper"
+		  "${CMAKE_CURRENT_SOURCE_DIR}/test/bin/run_test_1")
+		add_test(run_test_2
+		  "${BASH_PROGRAM}" "${CMAKE_CURRENT_BINARY_DIR}/test/bin/wrapper"
+		  "${CMAKE_CURRENT_SOURCE_DIR}/test/bin/run_test_2")
+	endif()
 	add_test(run_test_3
 	  "${BASH_PROGRAM}" "${CMAKE_CURRENT_BINARY_DIR}/test/bin/wrapper"
 	  "${CMAKE_CURRENT_SOURCE_DIR}/test/bin/run_test_3")
