From 7eb678a8936c5ff0b1d6a7b52a5029b80ef42625 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 31 Jul 2014 18:06:14 +0000 Subject: [PATCH] Move NSEdoc for unittest.run to unittest.nse This prevents unittest.run from being included in the Script Arguments section of every script that includes a unittest-compatible library. --- nselib/unittest.lua | 6 ++---- scripts/unittest.nse | 3 +++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nselib/unittest.lua b/nselib/unittest.lua index d07ab8c0a..58abca44d 100644 --- a/nselib/unittest.lua +++ b/nselib/unittest.lua @@ -15,9 +15,6 @@ -- -- The library is driven by the unittest NSE script. -- --- @args unittest.run Run tests. Causes unittest.testing() to --- return true. --- -- @copyright Same as Nmap--See http://nmap.org/book/man-legal.html local stdnse = require "stdnse" @@ -143,7 +140,8 @@ local am_testing = stdnse.get_script_args('unittest.run') ---Check whether tests are being run -- -- Libraries can use this function to avoid the overhead of creating tests if --- the user hasn't chosen to run them. +-- the user hasn't chosen to run them. Unittesting is turned on with the +-- unittest.run script-arg. -- @return true if unittests are being run, false otherwise. function testing() return am_testing diff --git a/scripts/unittest.nse b/scripts/unittest.nse index 242e79ba1..a009e8950 100644 --- a/scripts/unittest.nse +++ b/scripts/unittest.nse @@ -6,6 +6,9 @@ Runs unit tests on all NSE libraries. ]] --- +-- @args unittest.run Run tests. Causes unittest.testing() to +-- return true. +-- -- @args unittest.tests Run tests from only these libraries (defaults to all) -- -- @usage