diff --git a/SConstruct b/SConstruct index 762a9c0..044abec 100644 --- a/SConstruct +++ b/SConstruct @@ -94,6 +94,7 @@ PLATFORM = GetOption('platform') TARGET = GetOption('name') BUILD_CONFIG = GetOption('build_config') FLASH_TYPE = GetOption('flash') +TESTFILE = GetOption('testfile') ########################################################### # Environment setup @@ -106,6 +107,7 @@ VARS = { "PLATFORM": PLATFORM, "TARGET": TARGET, "FLASH_TYPE": FLASH_TYPE, + "TESTFILE": TESTFILE, "BUILD_CONFIG": BUILD_CONFIG, "env": env, } @@ -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 ########################################################### diff --git a/scons/pytest.scons b/scons/pytest.scons new file mode 100644 index 0000000..b099a24 --- /dev/null +++ b/scons/pytest.scons @@ -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") \ No newline at end of file