diff --git a/executors/node/likely_subtags.js b/executors/node/likely_subtags.js index 100f2fe7..b02b70c8 100644 --- a/executors/node/likely_subtags.js +++ b/executors/node/likely_subtags.js @@ -5,15 +5,13 @@ module.exports = { testLikelySubtags: function (json) { + const label = json['label']; + const locale = json['locale']; let test_option; if (json['option']) { test_option = json['option']; } - const locale = json['locale']; - - // TESTING - const label = json['label']; let return_json = {"label": label}; let intl_locale; try { @@ -28,8 +26,11 @@ module.exports = { let result_locale; if (test_option === 'maximize') { result_locale = intl_locale.maximize().baseName; - } else if (test_option === 'minimize') { + } else if (test_option === 'minimizeFavorScript' || + test_option === 'minimize') { result_locale = intl_locale.minimize().baseName; + } else if (test_option === 'minimizeFavorRegion') { + result_locale = intl_locale.minimizeFavorRegion().baseName; } else { return_json['error'] = 'Unknown test option = ' + test_option; } diff --git a/testdriver/testplan.py b/testdriver/testplan.py index d993407f..6256fe0f 100644 --- a/testdriver/testplan.py +++ b/testdriver/testplan.py @@ -411,7 +411,7 @@ def process_batch_of_tests(self, tests_to_send): logging.info('#### DEBUG OUTPUT = %s', item) # Process some types of errors - if item[1:3] == "!!": + if item[1:3] == "!!" and self.debug > 1: logging.warning(" !!!!!!!!!!!!!!!!! ERROR: %s", item) # Extract the message and check if we continue or not. json_start = item.index('{') @@ -426,8 +426,9 @@ def process_batch_of_tests(self, tests_to_send): json_out = json.loads(item) batch_out.append(json_out) except BaseException as error: - logging.warning(' && Item %s. Error in= %s. Received (%d): >%s<', - index, error, len(item), item) + if self.debug > 1: + logging.warning(' && Item %s. Error in= %s. Received (%d): >%s<', + index, error, len(item), item) index += 1 return batch_out diff --git a/testgen/testdata_gen.py b/testgen/testdata_gen.py index 288e04af..70456ea9 100644 --- a/testgen/testdata_gen.py +++ b/testgen/testdata_gen.py @@ -202,43 +202,63 @@ def processLikelySubtagsData(self): # split at ";" and ignore whitespace tags = list(map(str.strip, line.split(';'))) # This should give 3 items - if len(tags) < 3: - logging.warning('Likely subtags: count of tages != 3: %s', - line) - continue - - # Create 3 minimize tests - expected = tags[2] - for index in range(0, 3): - label = str(count).rjust(max_digits, '0') - locale = tags[index] - test_min = {'label': label, - 'locale': locale, - 'option': 'minimize' - } - verify = {'label': label, - 'verify': expected - } - test_list.append(test_min) - verify_list.append(verify) - count += 1 - - # And 3 maximize tests - expected = tags[1] - for index in range(0, 3): + if line.find('FAIL') >= 0: + # What do do with this? + pass + + # Create minimize tests - default is RemoveFavorScript + if tags[2]: + remove_favor_script = tags[2] + for tag in tags: + if tag == '': + continue + label = str(count).rjust(max_digits, '0') + test_min = {'label': label, + 'locale': tag, + 'option': 'minimize' + } + verify = {'label': label, + 'verify': remove_favor_script + } + test_list.append(test_min) + verify_list.append(verify) + count += 1 + + # And maximize from each tag + add_likely = tags[1] + for tag in tags: + if tag == '': + continue label = str(count).rjust(max_digits, '0') - locale = tags[index] test_max = {'label': label, - 'locale': locale, + 'locale': tag, 'option': 'maximize' } verify = {'label': label, - 'verify': expected + 'verify': add_likely } test_list.append(test_max) verify_list.append(verify) count += 1 + # And check for minimizing with favored script is supported + if tags[3]: + remove_favor_region = tags[3] + for tag in tags: + if tag == '': + continue + label = str(count).rjust(max_digits, '0') + test_max = {'label': label, + 'locale': tag, + 'option': 'minimizeFavorRegion' + } + verify = {'label': label, + 'verify': remove_favor_region + } + test_list.append(test_max) + verify_list.append(verify) + count += 1 + # Add to the test and verify json data json_test['tests'] = test_list json_verify['verifications'] = verify_list diff --git a/verifier/verifier.py b/verifier/verifier.py index 538dfd3b..e69207f3 100644 --- a/verifier/verifier.py +++ b/verifier/verifier.py @@ -245,7 +245,7 @@ def verify_data_results(self): # Save the results if not self.report.save_report(): - print('!!! Count not save report for (%s, %s)', + print('!!! Could not save report for (%s, %s)', vplan.test_type, self.exec) else: self.report.create_html_report()