# -*- 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 ../port_test_autoconf.tcl
package require macports 1.0

array set ui_options {}
#set ui_options(ports_debug)   yes
#set ui_options(ports_verbose) yes
mportinit ui_options

source ./library.tcl
macports_worker_init
package require portmain 1.0


# Set testing vars
set os_platform darwin
set macos_version 10.8.0
set os_version 12
set os_arch i386
set portpath .
set portbuildpath ./build


test get_default_subport {
    Get default subport unit test.
} -body {
    set portpath path/port/subport
    if {[portmain::get_default_subport] != "subport"} {
        return "FAIL: wrong subport"
    }
    return "Get default subport successful."
} -result "Get default subport successful."


test get_subbuildpath {
    Get subbuildpath unit test.
} -body {
    set portpath path/port/subport
    if {[portmain::get_subbuildpath] != [file normalize "./build/subport"]} {
        return "FAIL: wrong subbuildpath"
    }
    return "Get subbuild path successful."
} -result "Get subbuild path successful."


cleanupTests
