From cdda8b8a36ae5072f468b7ccce1417d3299e9648 Mon Sep 17 00:00:00 2001 From: "pschwartau%netscape.com" Date: Tue, 28 Aug 2001 21:13:58 +0000 Subject: [PATCH] Adding two new utility functions. git-svn-id: svn://10.0.0.236/trunk@101907 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/tests/ecma_3/shell.js | 25 +++++++++++++++++++++++-- mozilla/js/tests/js1_5/shell.js | 25 +++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/mozilla/js/tests/ecma_3/shell.js b/mozilla/js/tests/ecma_3/shell.js index cbc4069fadc..a318b8cc958 100644 --- a/mozilla/js/tests/ecma_3/shell.js +++ b/mozilla/js/tests/ecma_3/shell.js @@ -25,11 +25,32 @@ var FAILED = "FAILED!: "; var STATUS = "STATUS: "; var BUGNUMBER = "BUGNUMBER: "; - +var SECT_PREFIX = 'Section '; +var SECT_SUFFIX = ' of test -'; var VERBOSE = false; - var callStack = new Array(); +/* + * The test driver searches for such a phrase in the test output. + * If such phrase exists, it will set n as the expected exit code. + */ +function expectExitCode(n) +{ + + print('--- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE ' + n + ' ---'); + +} + +/* + * Statuses current section of a test + */ +function inSection(x) +{ + + return SECT_PREFIX + x + SECT_SUFFIX; + +} + /* * Report a failure in the 'accepted' manner */ diff --git a/mozilla/js/tests/js1_5/shell.js b/mozilla/js/tests/js1_5/shell.js index cbc4069fadc..ec73eaa80e3 100644 --- a/mozilla/js/tests/js1_5/shell.js +++ b/mozilla/js/tests/js1_5/shell.js @@ -25,11 +25,32 @@ var FAILED = "FAILED!: "; var STATUS = "STATUS: "; var BUGNUMBER = "BUGNUMBER: "; - var VERBOSE = false; - +var SECT_PREFIX = 'Section '; +var SECT_SUFFIX = ' of test -'; var callStack = new Array(); +/* + * The test driver searches for such a phrase in the test output. + * If such phrase exists, it will set n as the expected exit code. + */ +function expectExitCode(n) +{ + + print('--- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE ' + n + ' ---'); + +} + +/* + * Statuses current section of a test + */ +function inSection(x) +{ + + return SECT_PREFIX + x + SECT_SUFFIX; + +} + /* * Report a failure in the 'accepted' manner */