From 1899835f95765dff0cbb5f3bacbae8095e8975c6 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Thu, 26 May 2022 00:28:13 -0500 Subject: update test to test real source with no deps --- test/Configure/conftest_source_file.py | 15 ++++++++++++--- test/Configure/conftest_source_file/SConstruct | 1 + test/Configure/conftest_source_file/header3.h | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 test/Configure/conftest_source_file/header3.h diff --git a/test/Configure/conftest_source_file.py b/test/Configure/conftest_source_file.py index 451d06a..c5c593e 100644 --- a/test/Configure/conftest_source_file.py +++ b/test/Configure/conftest_source_file.py @@ -28,6 +28,8 @@ Template for end-to-end test file. Replace this with a description of the test. """ +import textwrap + import TestSCons test = TestSCons.TestSCons() @@ -36,16 +38,23 @@ test.dir_fixture("conftest_source_file") test.run(arguments='.') +conf_text = textwrap.dedent("""\ + Checking for C header file header1.h... {cached1}yes + Checking for C header file header3.h... {cached3}yes +""") + +test.up_to_date(read_str=conf_text.format(cached1='(cached) ', cached3='(cached) ')) + test.write('header2.h', """ #pragma once int test_header = 2; """) -test.not_up_to_date(read_str="Checking for C header file header1.h... (cached) yes\n") +test.not_up_to_date(read_str=conf_text.format(cached1='(cached) ', cached3='(cached) ')) -test.up_to_date(read_str="Checking for C header file header1.h... yes\n") +test.up_to_date(read_str=conf_text.format(cached1='', cached3='(cached) ')) -test.up_to_date(read_str="Checking for C header file header1.h... (cached) yes\n") +test.up_to_date(read_str=conf_text.format(cached1='(cached) ', cached3='(cached) ')) test.pass_test() diff --git a/test/Configure/conftest_source_file/SConstruct b/test/Configure/conftest_source_file/SConstruct index 72f0522..2e0b672 100644 --- a/test/Configure/conftest_source_file/SConstruct +++ b/test/Configure/conftest_source_file/SConstruct @@ -2,5 +2,6 @@ env = Environment() env.Append(CPPPATH=['.']) conf1 = Configure(env) conf1.CheckHeader("header1.h") +conf1.CheckHeader("header3.h") conf1.Finish() env.Program('out', 'main.c') \ No newline at end of file diff --git a/test/Configure/conftest_source_file/header3.h b/test/Configure/conftest_source_file/header3.h new file mode 100644 index 0000000..dc4359e --- /dev/null +++ b/test/Configure/conftest_source_file/header3.h @@ -0,0 +1,2 @@ +#pragma once +int test_header = 3; \ No newline at end of file -- cgit v0.12