summaryrefslogtreecommitdiff
path: root/test/Configure
diff options
context:
space:
mode:
authorDaniel Moody <dmoody256@gmail.com>2022-05-25 22:24:01 -0500
committerDaniel Moody <dmoody256@gmail.com>2022-05-25 22:24:10 -0500
commitb2b7a3c12b894a2561ba91fd55896d56c063d402 (patch)
tree6f6ea733251caca50138482e81653197cc455d75 /test/Configure
parent5054f7045344e1f9dd4a2154f2191a3459a9ae98 (diff)
downloadscons-git-b2b7a3c12b894a2561ba91fd55896d56c063d402.tar.gz
Fix for #2757, non conftest nodes involved in configure checks now get node info cleared after check.
Diffstat (limited to 'test/Configure')
-rw-r--r--test/Configure/conftest_source_file.py52
-rw-r--r--test/Configure/conftest_source_file/SConstruct6
-rw-r--r--test/Configure/conftest_source_file/header1.h2
-rw-r--r--test/Configure/conftest_source_file/header2.h2
-rw-r--r--test/Configure/conftest_source_file/main.c2
5 files changed, 64 insertions, 0 deletions
diff --git a/test/Configure/conftest_source_file.py b/test/Configure/conftest_source_file.py
new file mode 100644
index 000000000..6f43cb5f4
--- /dev/null
+++ b/test/Configure/conftest_source_file.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+#
+# MIT License
+#
+# Copyright The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+"""
+Template for end-to-end test file.
+Replace this with a description of the test.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.dir_fixture("conftest_source_file")
+
+test.run(arguments='.')
+
+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.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Configure/conftest_source_file/SConstruct b/test/Configure/conftest_source_file/SConstruct
new file mode 100644
index 000000000..72f052261
--- /dev/null
+++ b/test/Configure/conftest_source_file/SConstruct
@@ -0,0 +1,6 @@
+env = Environment()
+env.Append(CPPPATH=['.'])
+conf1 = Configure(env)
+conf1.CheckHeader("header1.h")
+conf1.Finish()
+env.Program('out', 'main.c') \ No newline at end of file
diff --git a/test/Configure/conftest_source_file/header1.h b/test/Configure/conftest_source_file/header1.h
new file mode 100644
index 000000000..85dcd6890
--- /dev/null
+++ b/test/Configure/conftest_source_file/header1.h
@@ -0,0 +1,2 @@
+#pragma once
+#include "header2.h" \ No newline at end of file
diff --git a/test/Configure/conftest_source_file/header2.h b/test/Configure/conftest_source_file/header2.h
new file mode 100644
index 000000000..2cf8e9057
--- /dev/null
+++ b/test/Configure/conftest_source_file/header2.h
@@ -0,0 +1,2 @@
+#pragma once
+int test_header = 1; \ No newline at end of file
diff --git a/test/Configure/conftest_source_file/main.c b/test/Configure/conftest_source_file/main.c
new file mode 100644
index 000000000..a9f95703c
--- /dev/null
+++ b/test/Configure/conftest_source_file/main.c
@@ -0,0 +1,2 @@
+#include "header1.h"
+int main(){return 0;} \ No newline at end of file