def METHOD_NAME(wabt_test_dir, testsuite_dir, tool, flags=None):
    testsuite_tests = GetFilesWithExtension(testsuite_dir, '.wast')
    wabt_tests = GetFilesWithExtension(wabt_test_dir, '.txt')
    for removed_test_name in wabt_tests - testsuite_tests:
        test_filename = os.path.join(wabt_test_dir, removed_test_name + '.txt')
        if options.verbose:
            print('Removing %s' % test_filename)
        os.remove(test_filename)
    for added_test_name in testsuite_tests - wabt_tests:
        wast_filename = os.path.join(
            os.path.relpath(testsuite_dir, REPO_ROOT_DIR),
            added_test_name + '.wast')
        test_filename = os.path.join(wabt_test_dir, added_test_name + '.txt')
        if options.verbose:
            print('Adding %s' % test_filename)
        test_dirname = os.path.dirname(test_filename)
        if not os.path.exists(test_dirname):
            os.makedirs(test_dirname)
        with open(test_filename, 'w') as f:
            f.write(';;; TOOL: %s\n' % tool)
            f.write(';;; STDIN_FILE: %s\n' % wast_filename.replace(os.sep, '/'))
            if flags:
                f.write(';;; ARGS*: %s\n' % flags)