[137660] branches/gsoc15-dependency/base/src/macports1.0/tests/ macports_libsolv.test
ijackson at macports.org
ijackson at macports.org
Tue Jun 16 09:48:47 PDT 2015
Revision: 137660
https://trac.macports.org/changeset/137660
Author: ijackson at macports.org
Date: 2015-06-16 09:48:47 -0700 (Tue, 16 Jun 2015)
Log Message:
-----------
Create Unit Test for libsolv SAT Solver.
Add unit test for libsolv search. This will save testing
time as a simple "make -C src/macports1.0 test" will test
the search proc instead of running "make install" and testing
manually by running "port -l search <portname>".
Added Paths:
-----------
branches/gsoc15-dependency/base/src/macports1.0/tests/macports_libsolv.test
Added: branches/gsoc15-dependency/base/src/macports1.0/tests/macports_libsolv.test
===================================================================
--- branches/gsoc15-dependency/base/src/macports1.0/tests/macports_libsolv.test (rev 0)
+++ branches/gsoc15-dependency/base/src/macports1.0/tests/macports_libsolv.test 2015-06-16 16:48:47 UTC (rev 137660)
@@ -0,0 +1,33 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
+package require tcltest 2
+namespace import tcltest::*
+
+set pwd [file dirname [file normalize $argv0]]
+
+source ../macports_test_autoconf.tcl
+package require macports 1.0
+
+# Debug options
+array set ui_options {}
+mportinit ui_options
+
+test libsolv_search {
+ # Unit test for searching using libsolv.
+ Unit test for libsolv search.
+} -body {
+ macports::libsolv::create_pool
+ set solv "solv"
+ set glob_res [macports::libsolv::search $solv 0 "glob"]
+ set exact_res [macports::libsolv::search "libsolv" 0 "exact"]
+ set regex_res [macports::libsolv::search $solv 0 "glob"]
+
+ if {![info exists glob_res] || ![info exists exact_res] || ![info exists regex_res]} {
+ return "FAIL: Search didn't run successfully for $solv or \"libsolv\""
+ }
+
+ return "Successfully searched using libsolv."
+} -cleanup {
+} -result "Successfully searched using libsolv."
+
+cleanupTests
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150616/068ac5ae/attachment.html>
More information about the macports-changes
mailing list