diff options
author | William Deegan <bill@baddogconsulting.com> | 2019-03-02 21:56:53 -0500 |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2019-03-02 21:56:53 -0500 |
commit | 3a107dcd6c93520f41c54b25a322317bfd1b8460 (patch) | |
tree | b674df7e9bd4cb62b3b0dbeab8694e176a22bc6c /test | |
parent | 9c6608bc1069d8bfd199e30801b2d1118c0137af (diff) | |
download | scons-git-3a107dcd6c93520f41c54b25a322317bfd1b8460.tar.gz |
Add test to cover this issue with MD5-timestamp decider breaking dependencies only on windows when one generated souce implicitly depends on another generated source.
Diffstat (limited to 'test')
-rw-r--r-- | test/Decider/MD5-winonly-firstbuild.py | 60 | ||||
-rw-r--r-- | test/Decider/MD5-winonly-fixture/SConstruct | 9 | ||||
-rw-r--r-- | test/Decider/MD5-winonly-fixture/sconstest.skip | 0 | ||||
-rw-r--r-- | test/Decider/MD5-winonly-fixture/test_lex.l | 10 | ||||
-rw-r--r-- | test/Decider/MD5-winonly-fixture/test_parse.y | 43 |
5 files changed, 122 insertions, 0 deletions
diff --git a/test/Decider/MD5-winonly-firstbuild.py b/test/Decider/MD5-winonly-firstbuild.py new file mode 100644 index 000000000..4047ea8c9 --- /dev/null +++ b/test/Decider/MD5-winonly-firstbuild.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# 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. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Test but which only shows on windows when one generated file depends on another generated file +In this case flex and yacc are an example. +""" + +import os +import stat + +import TestSCons +from TestCmd import IS_WINDOWS + + +test = TestSCons.TestSCons() + +if IS_WINDOWS: + yacc = test.where_is('yacc') or test.where_is('bison') or test.where_is('win_bison') + lex = test.where_is('flex') or test.where_is('lex') or test.where_is('win_flex') + # print("Lex:%s yacc:%s"%(lex,yacc)) + if not yacc or not lex: + test.skip("On windows but no flex/lex/win_flex and yacc/bison/win_bison required for test") +else: + test.skip("Windows only test") + + +test.dir_fixture('MD5-winonly-fixture') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Decider/MD5-winonly-fixture/SConstruct b/test/Decider/MD5-winonly-fixture/SConstruct new file mode 100644 index 000000000..c194c47cc --- /dev/null +++ b/test/Decider/MD5-winonly-fixture/SConstruct @@ -0,0 +1,9 @@ +DefaultEnvironment(tools=[]) +env=Environment() +env.Decider('MD5-timestamp') +env.AppendENVPath('PATH', r'd:\mesa\flexbison') +env.Tool('lex') +env.Tool('yacc') +env['YACCFLAGS'] = '-d' +env.Append(LEXFLAGS = ['--wincompat']) +env.SharedLibrary('dummy',['test_lex.l','test_parse.y']) diff --git a/test/Decider/MD5-winonly-fixture/sconstest.skip b/test/Decider/MD5-winonly-fixture/sconstest.skip new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/Decider/MD5-winonly-fixture/sconstest.skip diff --git a/test/Decider/MD5-winonly-fixture/test_lex.l b/test/Decider/MD5-winonly-fixture/test_lex.l new file mode 100644 index 000000000..269b98487 --- /dev/null +++ b/test/Decider/MD5-winonly-fixture/test_lex.l @@ -0,0 +1,10 @@ +%{ + +#include <stdio.h> +#include "test_parse.h" +int c; +%} +%% + +%% + diff --git a/test/Decider/MD5-winonly-fixture/test_parse.y b/test/Decider/MD5-winonly-fixture/test_parse.y new file mode 100644 index 000000000..3ead9d2b8 --- /dev/null +++ b/test/Decider/MD5-winonly-fixture/test_parse.y @@ -0,0 +1,43 @@ +%{ +#include<stdio.h> + +int regs[26]; +int base; + +%} + +%start digit + +%union { int a; } + + +%token DIGIT LETTER + +%left '|' +%left '&' +%left '+' '-' +%left '*' '/' '%' +%left UMINUS /*supplies precedence for unary minus */ + +%% /* beginning of rules section */ + +digit: DIGIT; + + +%% +main() +{ + return(yyparse()); +} + +yyerror(s) +char *s; +{ + fprintf(stderr, "%s\n",s); + return(0); +} + +yywrap() +{ + return(1); +}
\ No newline at end of file |