Updated gseup tests

This commit is contained in:
Caleb Herpin 2021-07-22 09:54:10 -05:00
parent e566f9be3e
commit eccf1f8975
3 changed files with 19 additions and 3 deletions

View File

@ -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

View 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"))

View File

@ -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():