]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't assume a Perl script can be run directly as a command.
authorGuy Harris <[email protected]>
Wed, 5 Feb 2020 09:07:52 +0000 (01:07 -0800)
committerGuy Harris <[email protected]>
Wed, 5 Feb 2020 09:07:52 +0000 (01:07 -0800)
That's not the case on Windows - it doesn't support #!.  Look for the
perl interpreter and, if we find it, add a rule that runs tests/TESTrun
with the interpreter.

CMakeLists.txt

index b946c17d373951cb5a41818547bdcca081ed4757..626f090a676003582f434ba9872d3306070e3294 100644 (file)
@@ -1200,6 +1200,15 @@ add_custom_target(uninstall
 
 #
 # Tcpdump tests
-#
-add_custom_target(check
-    COMMAND ${CMAKE_SOURCE_DIR}/tests/TESTrun)
+# We try to find the Perl interpreter and, if we do, we have the check
+# rule run tests/TESTrun with it, because just trying to run the TESTrun
+# script as a command won't work on Windows.
+#
+find_program(PERL perl)
+if(PERL)
+    message(STATUS "Found perl at ${PERL}")
+    add_custom_target(check
+        COMMAND ${PERL} ${CMAKE_SOURCE_DIR}/tests/TESTrun)
+else()
+    message(STATUS "Didn't find perl")
+endif()