mirror of
https://github.com/nmap/nmap.git
synced 2025-12-16 04:39:03 +00:00
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.
This commit is contained in:
@@ -15,9 +15,6 @@
|
|||||||
--
|
--
|
||||||
-- The library is driven by the unittest NSE script.
|
-- The library is driven by the unittest NSE script.
|
||||||
--
|
--
|
||||||
-- @args unittest.run Run tests. Causes <code>unittest.testing()</code> to
|
|
||||||
-- return true.
|
|
||||||
--
|
|
||||||
-- @copyright Same as Nmap--See http://nmap.org/book/man-legal.html
|
-- @copyright Same as Nmap--See http://nmap.org/book/man-legal.html
|
||||||
|
|
||||||
local stdnse = require "stdnse"
|
local stdnse = require "stdnse"
|
||||||
@@ -143,7 +140,8 @@ local am_testing = stdnse.get_script_args('unittest.run')
|
|||||||
---Check whether tests are being run
|
---Check whether tests are being run
|
||||||
--
|
--
|
||||||
-- Libraries can use this function to avoid the overhead of creating tests if
|
-- 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
|
||||||
|
-- <code>unittest.run</code> script-arg.
|
||||||
-- @return true if unittests are being run, false otherwise.
|
-- @return true if unittests are being run, false otherwise.
|
||||||
function testing()
|
function testing()
|
||||||
return am_testing
|
return am_testing
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ Runs unit tests on all NSE libraries.
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
---
|
---
|
||||||
|
-- @args unittest.run Run tests. Causes <code>unittest.testing()</code> to
|
||||||
|
-- return true.
|
||||||
|
--
|
||||||
-- @args unittest.tests Run tests from only these libraries (defaults to all)
|
-- @args unittest.tests Run tests from only these libraries (defaults to all)
|
||||||
--
|
--
|
||||||
-- @usage
|
-- @usage
|
||||||
|
|||||||
Reference in New Issue
Block a user