Skip to content

Commit

Permalink
HIL commands Added (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: Aumkar Mali <[email protected]>
Co-authored-by: Aryan Kashem <[email protected]>
  • Loading branch information
3 people authored Dec 24, 2024
1 parent 1600067 commit e060e59
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ PLATFORM = GetOption('platform')
TARGET = GetOption('name')
BUILD_CONFIG = GetOption('build_config')
FLASH_TYPE = GetOption('flash')
TESTFILE = GetOption('testfile')

###########################################################
# Environment setup
Expand All @@ -106,6 +107,7 @@ VARS = {
"PLATFORM": PLATFORM,
"TARGET": TARGET,
"FLASH_TYPE": FLASH_TYPE,
"TESTFILE": TESTFILE,
"BUILD_CONFIG": BUILD_CONFIG,
"env": env,
}
Expand Down Expand Up @@ -160,6 +162,18 @@ if COMMAND == "test":
elif COMMAND == "new":
SConscript('scons/new_target.scons', exports='VARS')

###########################################################
# hil command
###########################################################
elif COMMAND == "hil":
print(TEST_FILE)
if not TEST_FILE:
#Error handling
pass

SConscript('scons/pytest.scons', exports='VARS')


###########################################################
# Clean
###########################################################
Expand Down
9 changes: 9 additions & 0 deletions scons/pytest.scons
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Import('VARS')

def sum_two_numbers(a, b):
return a + b

def test_sum():
assert sum_two_numbers(1, 2) == 3, "Expected sum is 3" #Built in assert statement

env.Command("#/pytest")

0 comments on commit e060e59

Please sign in to comment.