mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 05:07:54 +00:00
Updated gseup tests
This commit is contained in:
parent
e566f9be3e
commit
eccf1f8975
4
trick_source/trick_gsetup/.gitignore
vendored
4
trick_source/trick_gsetup/.gitignore
vendored
@ -4,9 +4,9 @@ config.log
|
||||
config.status
|
||||
share/trick/makefiles/config_user.mk
|
||||
*.json
|
||||
!tests/config_for_test_app_with_file.json
|
||||
build/*
|
||||
main
|
||||
main.spec
|
||||
check_env.py
|
||||
*practice*
|
||||
*.cache
|
||||
*.cache
|
||||
|
15
trick_source/trick_gsetup/tests/check_env.py
Executable file
15
trick_source/trick_gsetup/tests/check_env.py
Executable file
@ -0,0 +1,15 @@
|
||||
#! /home/cherpin/gsetup2/venv/bin/python3.8
|
||||
#used for test cases
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--hello", help=f"print hello world.", action="store_true")
|
||||
args = parser.parse_args()
|
||||
if args.hello:
|
||||
print("Hello World!")
|
||||
else:
|
||||
import os
|
||||
print(os.environ.get("CC"))
|
||||
print(os.environ.get("CFLAGS"))
|
||||
print(os.environ.get("CPP"))
|
||||
print(os.environ.get("CPPFLAGS"))
|
@ -144,11 +144,12 @@ def test_bool_to_sting():
|
||||
assert bool_to_string(False) == "no"
|
||||
|
||||
def test_run():
|
||||
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||
stdout = run('echo Hello World!')
|
||||
assert stdout == "Hello World!\n"
|
||||
stdout = run("configure")
|
||||
assert stdout == "/bin/sh: 1: configure: not found\n"
|
||||
stdout = run("python3 check_env.py", "hello")
|
||||
stdout = run(f"python3 {dir_path}/check_env.py", "hello")
|
||||
assert stdout == "Hello World!\n"
|
||||
|
||||
def test_envvar():
|
||||
|
Loading…
Reference in New Issue
Block a user