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
2
trick_source/trick_gsetup/.gitignore
vendored
2
trick_source/trick_gsetup/.gitignore
vendored
@ -4,9 +4,9 @@ config.log
|
|||||||
config.status
|
config.status
|
||||||
share/trick/makefiles/config_user.mk
|
share/trick/makefiles/config_user.mk
|
||||||
*.json
|
*.json
|
||||||
|
!tests/config_for_test_app_with_file.json
|
||||||
build/*
|
build/*
|
||||||
main
|
main
|
||||||
main.spec
|
main.spec
|
||||||
check_env.py
|
|
||||||
*practice*
|
*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"
|
assert bool_to_string(False) == "no"
|
||||||
|
|
||||||
def test_run():
|
def test_run():
|
||||||
|
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
stdout = run('echo Hello World!')
|
stdout = run('echo Hello World!')
|
||||||
assert stdout == "Hello World!\n"
|
assert stdout == "Hello World!\n"
|
||||||
stdout = run("configure")
|
stdout = run("configure")
|
||||||
assert stdout == "/bin/sh: 1: configure: not found\n"
|
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"
|
assert stdout == "Hello World!\n"
|
||||||
|
|
||||||
def test_envvar():
|
def test_envvar():
|
||||||
|
Loading…
Reference in New Issue
Block a user