2
0

multiple-attribute-namespaces.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. """
  4. Copyright (c) Contributors to the Open 3D Engine Project.
  5. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  6. SPDX-License-Identifier: Apache-2.0 OR MIT
  7. """
  8. import sys
  9. import os
  10. sys.path.append("..")
  11. from clr import *
  12. import testfuncs
  13. import testhelper
  14. '''
  15. Validates having multiple attribute namespaces in the same file.
  16. '''
  17. result = 0 # to define for sub-tests
  18. resultFailed = 0
  19. def doTests(compiler, silent, azdxcpath):
  20. global result
  21. global resultFailed
  22. # Working directory should have been set to this script's directory by the calling parent
  23. # You can get it once doTests() is called, but not during initialization of the module,
  24. # because at that time it will still be set to the working directory of the calling script
  25. workDir = os.getcwd()
  26. if testhelper.verifyEmissionPattern("multiple-attribute-namespaces.azsl", "multiple-attribute-namespaces.txt", compiler, silent, ["--namespace=mt", "--namespace=vk"]):
  27. result += 1
  28. else:
  29. resultFailed += 1
  30. if testhelper.compileAndExpectError("multiple-attribute-namespaces.azsl", compiler, silent, ["--namespace=mt,vk"]):
  31. result += 1
  32. else:
  33. resultFailed += 1
  34. if testhelper.compileAndExpectError("multiple-attribute-namespaces.azsl", compiler, silent, ["--namespace=mt&vk"]):
  35. result += 1
  36. else:
  37. resultFailed += 1
  38. if __name__ == "__main__":
  39. print ("please call from testapp.py")