]> git.e2factory.org Git - e2factory.git/commitdiff
cleanup: remove unused code
authorGordon Hecker <gh@emlix.com>
Wed, 20 Jan 2010 11:06:25 +0000 (12:06 +0100)
committerGordon Hecker <gh@emlix.com>
Fri, 12 Feb 2010 09:51:59 +0000 (10:51 +0100)
Signed-off-by: Gordon Hecker <gh@emlix.com>
generic/e2lib.lua

index 1608301d7a9a08e80a8387bb89f7e54b2a6ad6a6..ddb4a91f45747873e430cbce0d7b7381b05f0d1f 100644 (file)
@@ -454,23 +454,6 @@ function e2lib.rotate_log(file)
   return true, nil
 end
 
-local buildidlogfile = false
-
-function e2lib.buildidlog(info, text)
-  if info then
-    if not buildidlogfile then
-      e2lib.mkdir(info.root .. "/log", "-p")
-      buildidlogfile = io.open(info.root .. "/log/buildid.log", "a+")
-    end
-    buildidlogfile:write(text .. "\n")
-  else
-    buildidlogfile:write("   time: ", os.time(), "\n",
-                        "------------------------------------------\n")
-    buildidlogfile:close()
-    buildidlogfile = false
-  end
-end
-
 --- append a line to a file
 -- @param file string: filename
 -- @param line string: a line to append to the file
@@ -679,68 +662,6 @@ function e2lib.howtounpack(physpath, virtpath, destdir)
   return c
 end
 
-
--- Unit test support
---
---   e2lib.testsuite([NAME])
---
---     With an argument: starts a suite of tests. Without an argument: finishes
---     a testsuite. NAME should be a string describing the testsuite. All
---     invocations of e2lib.check() inside a pair of e2lib.testsuite() calls
---     are grouped together.
---
---   e2lib.check(RESULT, EXPECTED, [NAME])
---
---     Compares RESULT with EXPECTED and records whether both are structurally
---     equal (using table.compare if needed). NAME can be given for diagnostic
---     output.
---
---  See e2-run-tests for an example of using this facility.
-
-local testcount = 0
-
-function e2lib.testsuite(name)
-  if name then
-    testcount = 1
-    io.stderr:write("--- starting testsuite: \t", name, "\n")
-    e2lib.current_testsuite = name 
-    e2lib.succeeded_tests = 0
-    e2lib.failed_tests = 0
-  elseif e2lib.current_testsuite then
-    io.stderr:write("--- finishing testsuite:\t", e2lib.current_testsuite, "\n")
-    io.stderr:write("    tests succeeded:\t", e2lib.succeeded_tests, "\n")
-    io.stderr:write("             failed:\t", e2lib.failed_tests, "\n")
-    if e2lib.failed_tests == 0 then
-      io.stderr:write("    ALL TESTS SUCCEEDED.\n")
-    else
-      io.stderr:write("    SOME TESTS FAILED.\n")
-    end
-  else error("no testsuite active") end
-end
-
-function e2lib.check(result, expected, name)
-  if name then io.write(name, " ...") 
-  else io.write("test #", testcount, " ...") end
-  io.flush()
-  testcount = testcount + 1
-  local f
-  if type(expected) == "table" then
-    if type(result) == "table" then
-      f = table.compare(result, expected)
-    else
-      f = false
-    end
-  else f = expected == result end    
-  if f then
-    e2lib.succeeded_tests = (e2lib.succeeded_tests or 0) + 1
-    print("\tok")
-  else
-    e2lib.failed_tests = (e2lib.failed_tests or 0) + 1
-    io.write("\tfailed - expected: ", expected, " but got: ", result, "\n")
-  end
-end
-
-
 -- Input/Output operations
 --
 --   e2lib.read_line(PATHNAME)