github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/casec_test.go (about)

     1  // Ultimate Provisioner: UP cmd
     2  // Copyright (c) 2019 Stephen Cheng and contributors
     3  
     4  /* This Source Code Form is subject to the terms of the Mozilla Public
     5   * License, v. 2.0. If a copy of the MPL was not distributed with this
     6   * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
     7  
     8  package functests
     9  
    10  import (
    11  	"github.com/upcmd/up/biz/impl"
    12  	"github.com/upcmd/up/tests"
    13  	u "github.com/upcmd/up/utils"
    14  	"os"
    15  	"testing"
    16  )
    17  
    18  func init() {
    19  	os.Chdir("../..")
    20  }
    21  
    22  func TestC(t *testing.T) {
    23  	cfg := u.NewUpConfig("", "").InitConfig()
    24  	u.MainConfig = cfg
    25  	files := tests.GetUnitTestCollection()
    26  	impl.FuncMapInit()
    27  
    28  	for _, x := range files {
    29  		u.Pln("testing:", x)
    30  		u.Pln("work dir:", cfg.AbsWorkDir)
    31  		tests.Setupx(x, cfg)
    32  		t := impl.NewTasker("dev", "", cfg)
    33  		t.ExecTask("task", nil, false)
    34  		t.Unset()
    35  	}
    36  }