• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) Meta Platforms, Inc. and affiliates.
2# All rights reserved.
3#
4# This source code is licensed under the BSD-style license found in the
5# LICENSE file in the root directory of this source tree.
6
7# pyre-strict
8
9import filecmp
10import os
11import unittest
12
13
14class TestSchema(unittest.TestCase):
15    def test_schema_sync(self) -> None:
16        # make the test work in both internal and oss.
17        prefix = (
18            "executorch/" if os.path.exists("executorch/schema/scalar_type.fbs") else ""
19        )
20
21        self.assertTrue(
22            filecmp.cmp(
23                prefix + "devtools/bundled_program/schema/scalar_type.fbs",
24                prefix + "schema/scalar_type.fbs",
25            ),
26            'Please run "hg cp fbcode//executorch/schema/scalar_type.fbs fbcode//executorch/devtools/bundled_program/schema/scalar_type.fbs" to sync schema changes.',
27        )
28