From e863e1bc71aea05c554e6d06014b51c19f5a6bf5 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 27 Feb 2019 14:41:06 -0800 Subject: Add test for GH Issue #3303 --- test/Configure/option--config.py | 10 ++++++++++ test/fixture/test_main.c | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 test/fixture/test_main.c diff --git a/test/Configure/option--config.py b/test/Configure/option--config.py index 80a8bcd..02f10ce 100644 --- a/test/Configure/option--config.py +++ b/test/Configure/option--config.py @@ -122,6 +122,9 @@ test.checkLogAndStdout(["Checking for C header file non_system_header0.h... ", [((".c", CR), (_obj, NCR))]], "config.log", ".sconf_temp", "SConstruct") + +test.file_fixture('test_main.c') + # Check the combination of --config=force and Decider('MD5-timestamp') # On second run there was an issue where the decider would throw DeciderNeedsNode # exception which the configure code didn't handle. @@ -132,12 +135,19 @@ env.Decider('MD5-timestamp') conf = Configure(env) conf.TryLink('int main(){return 0;}','.c') env = conf.Finish() +env.Program('test_main.c') """) test.run(arguments='--config=force') # On second run the sconsign is loaded and decider doesn't just indicate need to rebuild test.run(arguments='--config=force') test.must_not_contain(test.workpath('config.log'), "TypeError: 'NoneType' object is not callable", mode='r') +# Now check to check that test_main.c didn't rebuild on second run above. +# This fixes an issue where --config=force overwrites the Environments decider and is not reset when +# the configure context is done. +# https://github.com/SCons/scons/issues/3303 +test.fail_test(test.stdout().find('test_main.o') != -1) + test.pass_test() # Local Variables: diff --git a/test/fixture/test_main.c b/test/fixture/test_main.c new file mode 100644 index 0000000..adbe919 --- /dev/null +++ b/test/fixture/test_main.c @@ -0,0 +1,4 @@ +int main( int argc, char* argv[] ) +{ + return 0; +} -- cgit v0.12