mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
oeqa/runtime: add simple test for scons
This test simply compiles a hello world program using scons. (From OE-Core rev: bf6e3f0f3a7a134e8e3cb16366ef01b8c956e4c8) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
2209af86ed
commit
716dff0b2f
37
meta/lib/oeqa/runtime/cases/scons.py
Normal file
37
meta/lib/oeqa/runtime/cases/scons.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
from oeqa.core.decorator.depends import OETestDepends
|
||||
from oeqa.runtime.decorator.package import OEHasPackage
|
||||
|
||||
class SconsCompileTest(OERuntimeTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUp(cls):
|
||||
dst = '/tmp/'
|
||||
src = os.path.join(cls.tc.runtime_files_dir, 'hello.c')
|
||||
cls.tc.target.copyTo(src, dst)
|
||||
|
||||
src = os.path.join(cls.tc.runtime_files_dir, 'SConstruct')
|
||||
cls.tc.target.copyTo(src, dst)
|
||||
|
||||
@classmethod
|
||||
def tearDown(cls):
|
||||
files = '/tmp/hello.c /tmp/hello.o /tmp/hello /tmp/SConstruct'
|
||||
cls.tc.target.run('rm %s' % files)
|
||||
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
@OEHasPackage(['gcc'])
|
||||
@OEHasPackage(['python3-scons'])
|
||||
def test_scons_compile(self):
|
||||
status, output = self.target.run('cd /tmp/ && scons')
|
||||
msg = 'scons compile failed, output: %s' % output
|
||||
self.assertEqual(status, 0, msg=msg)
|
||||
|
||||
status, output = self.target.run('/tmp/hello')
|
||||
msg = 'running compiled file failed, output: %s' % output
|
||||
self.assertEqual(status, 0, msg=msg)
|
||||
1
meta/lib/oeqa/runtime/files/SConstruct
Normal file
1
meta/lib/oeqa/runtime/files/SConstruct
Normal file
@@ -0,0 +1 @@
|
||||
Program('hello.c')
|
||||
5
meta/lib/oeqa/runtime/files/hello.c
Normal file
5
meta/lib/oeqa/runtime/files/hello.c
Normal file
@@ -0,0 +1,5 @@
|
||||
int
|
||||
main()
|
||||
{
|
||||
printf("Hello, world!\n");
|
||||
}
|
||||
Reference in New Issue
Block a user