Skip to contentSkip to conversation

patman: Add spaces back into patman test

PATCH New Doug Anderson 2 participants 6 messages Nov 27, 2012 – Jan 31, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 patman: Add spaces back into patman test

The patman test code was failing because some extra spaces got stripped when it was applied. These spaces are critical to the test code working.

---
 tools/patman/test.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
tools/patman/test.py +3 -3
index cf42480..f801ced 100644
@@ -119,8 +119,8 @@ index 6f3748d..f9e4e65 100644
 --- a/README
 +++ b/README
 @@ -2026,6 +2026,17 @@ The following options need to be configured:
-		example, some LED's) on your board. At the moment,
-		the following checkpoints are implemented:
+ 		example, some LED's) on your board. At the moment,
+ 		the following checkpoints are implemented:
 
 +- Time boot progress
 +		CONFIG_BOOTSTAGE
@@ -134,7 +134,7 @@ index 6f3748d..f9e4e65 100644
 +		You can add calls to bootstage_mark() to set time markers.
 +
  - Standalone program support:
-		CONFIG_STANDALONE_LOAD_ADDR
+ 		CONFIG_STANDALONE_LOAD_ADDR
 
 diff --git a/common/bootstage.c b/common/bootstage.c
 new file mode 100644
Signature · 1 line
1.7.7.3
#1 lore raw

PATCH 2/2 patman: Allow tests to run even if patman is in the path

Several of the patman doctests assume that patman was run with:
./patman

Fix them so that they work even if patman is run with just "patman" (because patman is in the path).

---
 tools/patman/gitutil.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
tools/patman/gitutil.py +9 -2
index 72d37a0..41a74a5 100644
@@ -217,6 +217,10 @@ def EmailPatches(series, cover_fname, args, dry_run, cc_fname,
     Returns:
         Git command that was/would be run
 
+    # For the duration of this doctest pretend that we ran patman with ./patman
+    >>> _old_argv0 = sys.argv[0]
+    >>> sys.argv[0] = './patman'
+
     >>> alias = {}
     >>> alias['fred'] = ['f.bloggs at napier.co.nz']
     >>> alias['john'] = ['j.bloggs at napier.co.nz']
@@ -244,6 +248,9 @@ def EmailPatches(series, cover_fname, args, dry_run, cc_fname,
     'git send-email --annotate --to "f.bloggs at napier.co.nz" --cc \
 "f.bloggs at napier.co.nz" --cc "j.bloggs at napier.co.nz" --cc \
 "m.poppins at cloud.net" --cc-cmd "./patman --cc-cmd cc-fname" cover p1 p2'
+
+    # Restore argv[0] since we clobbered it.
+    >>> sys.argv[0] = _old_argv0
     """
     to = BuildEmailList(series.get('to'), '--to', alias)
     if not to:
@@ -340,8 +347,8 @@ def GetTopLevel():
 
     This test makes sure that we are running tests in the right subdir
 
-    >>> os.path.realpath(os.getcwd()) == \
-            os.path.join(GetTopLevel(), 'tools', 'scripts', 'patman')
+    >>> os.path.realpath(os.path.dirname(__file__)) == \
+            os.path.join(GetTopLevel(), 'tools', 'patman')
     True
     """
     return command.OutputOneLine('git', 'rev-parse', '--show-toplevel')
Signature · 1 line
1.7.7.3
#3 lore raw

PATCH 2/2 patman: Allow tests to run even if patman is in the path

Quoted 10 lines · Simon Glass
Quoted 7 lines · Doug Anderson

Several of the patman doctests assume that patman was run with:
./patman

Fix them so that they work even if patman is run with just "patman" (because patman is in the path).

Applied to u-boot-x86, thanks.

#4 lore raw

PATCH 1/2 patman: Add spaces back into patman test

In reply to Doug Anderson
Quoted 5 lines · Doug Anderson

The patman test code was failing because some extra spaces got stripped when it was applied. These spaces are critical to the test code working.

Quoted 32 lines
---
 tools/patman/test.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
tools/patman/test.py +3 -4
index cf42480..f801ced 100644
@@ -119,8 +119,8 @@ index 6f3748d..f9e4e65 100644
 --- a/README
 +++ b/README
 @@ -2026,6 +2026,17 @@ The following options need to be configured:
-               example, some LED's) on your board. At the moment,
-               the following checkpoints are implemented:
+               example, some LED's) on your board. At the moment,
+               the following checkpoints are implemented:
 
 +- Time boot progress
 +              CONFIG_BOOTSTAGE
@@ -134,7 +134,7 @@ index 6f3748d..f9e4e65 100644
 +              You can add calls to bootstage_mark() to set time markers.
 +
  - Standalone program support:
-               CONFIG_STANDALONE_LOAD_ADDR
+               CONFIG_STANDALONE_LOAD_ADDR
 
 diff --git a/common/bootstage.c b/common/bootstage.c
 new file mode 100644
--

1.7.7.3

#5 lore raw

PATCH 1/2 patman: Add spaces back into patman test

Quoted 8 lines · Simon Glass
Quoted 5 lines · Doug Anderson

The patman test code was failing because some extra spaces got stripped when it was applied. These spaces are critical to the test code working.

Applied to u-boot-x86, thanks.

Quoted 33 lines
Quoted 33 lines

---
 tools/patman/test.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
tools/patman/test.py +3 -4
index cf42480..f801ced 100644
@@ -119,8 +119,8 @@ index 6f3748d..f9e4e65 100644
 --- a/README
 +++ b/README
 @@ -2026,6 +2026,17 @@ The following options need to be configured:
-               example, some LED's) on your board. At the moment,
-               the following checkpoints are implemented:
+               example, some LED's) on your board. At the moment,
+               the following checkpoints are implemented:
 
 +- Time boot progress
 +              CONFIG_BOOTSTAGE
@@ -134,7 +134,7 @@ index 6f3748d..f9e4e65 100644
 +              You can add calls to bootstage_mark() to set time markers.
 +
  - Standalone program support:
-               CONFIG_STANDALONE_LOAD_ADDR
+               CONFIG_STANDALONE_LOAD_ADDR
 
 diff --git a/common/bootstage.c b/common/bootstage.c
 new file mode 100644
--

1.7.7.3