tests/shared_outputs/mixup/AMBuildScript
changeset 226 185e3cd6740b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tests/shared_outputs/mixup/AMBuildScript	Sat Feb 01 16:56:01 2014 -0800
     1.3 @@ -0,0 +1,70 @@
     1.4 +# vim: set ts=8 sts=2 tw=99 et ft=python: 
     1.5 +import os, sys
     1.6 +
     1.7 +argv = [
     1.8 +  sys.executable,
     1.9 +  os.path.join(builder.sourcePath, 'generate_header.py'),
    1.10 +  'output.h'
    1.11 +]
    1.12 +
    1.13 +shared_outputs = [
    1.14 +  os.path.join(builder.buildFolder, 'output.h')
    1.15 +]
    1.16 +
    1.17 +def Test1():
    1.18 +  builder.AddCommand(
    1.19 +    inputs = [],
    1.20 +    argv = argv,
    1.21 +    outputs = [],
    1.22 +    shared_outputs = shared_outputs
    1.23 +  )
    1.24 +
    1.25 +def Test2():
    1.26 +  # Change the output to a normal output.
    1.27 +  builder.AddCommand(
    1.28 +    inputs = [],
    1.29 +    argv = argv,
    1.30 +    outputs = shared_outputs
    1.31 +  )
    1.32 +
    1.33 +def Test3():
    1.34 +  # Change back to a shared output.
    1.35 +  Test1()
    1.36 +
    1.37 +def Test4():
    1.38 +  # Change to a folder.
    1.39 +  builder.AddFolder('output.h')
    1.40 +
    1.41 +def Test5():
    1.42 +  # Change back to a shared output.
    1.43 +  Test1()
    1.44 +
    1.45 +def TestFail1():
    1.46 +  Test2()
    1.47 +  Test1()
    1.48 +
    1.49 +def TestFail2():
    1.50 +  Test1()
    1.51 +  Test2()
    1.52 +
    1.53 +def TestFail3():
    1.54 +  Test1()
    1.55 +  Test4()
    1.56 +
    1.57 +def TestFail4():
    1.58 +  Test4()
    1.59 +  Test1()
    1.60 +
    1.61 +# Uncomment 1, run, recomment, uncomment 2 to test. Repeat. Each time using
    1.62 +# refactoring mode should fail.
    1.63 +Test1()
    1.64 +#Test2()
    1.65 +#Test3()
    1.66 +#Test4()
    1.67 +#Test5()
    1.68 +
    1.69 +# These tests should all fail.
    1.70 +#TestFail1()
    1.71 +#TestFail2()
    1.72 +#TestFail3()
    1.73 +#TestFail4()