]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest: Replace building dep tool with direnv
authorKhem Raj <raj.khem@gmail.com>
Wed, 24 Feb 2021 22:08:46 +0000 (14:08 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 26 Feb 2021 15:16:56 +0000 (15:16 +0000)
dep tool is now deprecated and its replaced with go modules so using
this as sample for testing is also getting arcane. Replace it with
another project direnv[1] which is quite active and uptodate

[1] https://github.com/direnv/direnv

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/gotoolchain.py

index 3119520f0de3ddaf009008e5ef4b1c46d19f107c..4fc3605f42f9f16151f2b53de50363b9d1a9332c 100644 (file)
@@ -46,26 +46,25 @@ class oeGoToolchainSelfTest(OESelftestTestCase):
         shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True)
         super(oeGoToolchainSelfTest, cls).tearDownClass()
 
-    def run_sdk_go_command(self, gocmd):
-        cmd = "cd %s; " % self.tmpdir_SDKQA
+    def run_sdk_go_command(self, gocmd, proj, name):
+        cmd = "cd %s/src/%s/%s; " % (self.go_path, proj, name)
         cmd = cmd + ". %s; " % self.env_SDK
         cmd = cmd + "export GOPATH=%s; " % self.go_path
         cmd = cmd + "${CROSS_COMPILE}go %s" % gocmd
         return runCmd(cmd).status
 
     def test_go_dep_build(self):
-        proj = "github.com/golang"
-        name = "dep"
-        ver = "v0.3.1"
+        proj = "github.com/direnv"
+        name = "direnv"
+        ver = "v2.27.0"
         archive = ".tar.gz"
         url = "https://%s/%s/archive/%s%s" % (proj, name, ver, archive)
 
         runCmd("cd %s; wget %s" % (self.tmpdir_SDKQA, url))
         runCmd("cd %s; tar -xf %s" % (self.tmpdir_SDKQA, ver+archive))
         runCmd("mkdir -p %s/src/%s" % (self.go_path, proj))
-        runCmd("mv %s/dep-0.3.1 %s/src/%s/%s"
+        runCmd("mv %s/direnv-2.27.0 %s/src/%s/%s"
                % (self.tmpdir_SDKQA, self.go_path, proj, name))
-        retv = self.run_sdk_go_command('build  %s/%s/cmd/dep'
-                                       % (proj, name))
+        retv = self.run_sdk_go_command('build', proj, name)
         self.assertEqual(retv, 0,
                          msg="Running go build failed for %s" % name)