Skip to content

Commit

Permalink
Problem running tests under Windows
Browse files Browse the repository at this point in the history
The redirection used in the runtests.py script was based on *nix type systems. Corrected for windows.
Windows has a different line ending than *nix, resulting in a problem with diff unless the options -b -w are used.
Some tests had as directory for some paths a directory . this has been corrected to $INPUTDIR
  • Loading branch information
albert-github committed Jun 10, 2015
1 parent 7a0c06d commit 9bd54df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion testing/022_dot.cpp
@@ -1,7 +1,7 @@
// objective: test the \dot and \enddot commands
// check: indexpage.xml
// config: HAVE_DOT = YES
// config: DOTFILE_DIRS = .
// config: DOTFILE_DIRS = $INPUTDIR

/*! class B */
class B {};
Expand Down
2 changes: 1 addition & 1 deletion testing/031_image.dox
@@ -1,6 +1,6 @@
// objective: test the \image command
// check: indexpage.xml
// config: IMAGE_PATH = .
// config: IMAGE_PATH = $INPUTDIR
/** \mainpage
* Some text.
* \image html sample.png
Expand Down
8 changes: 6 additions & 2 deletions testing/runtests.py
Expand Up @@ -25,7 +25,7 @@ def compare_ok(self,got_file,expected_file,name):
elif not os.path.isfile(expected_file):
return (True,'%s absent' % expected_file)
else:
diff = os.popen('diff -u %s %s' % (got_file,expected_file)).read()
diff = os.popen('diff -b -w -u %s %s' % (got_file,expected_file)).read()
if diff and not diff.startswith("No differences"):
return (True,'Difference between generated output and reference:\n%s' % diff)
return (False,'')
Expand Down Expand Up @@ -66,7 +66,11 @@ def prepare_test(self):
sys.exit(1)

# run doxygen
if os.system('%s %s/Doxyfile 2>/dev/null' % (self.args.doxygen,self.test_out))!=0:
if (sys.platform == 'win32'):
redir=' > nul:'
else:
redir=' 2> /dev/null'
if os.system('%s %s/Doxyfile %s' % (self.args.doxygen,self.test_out, redir))!=0:
print('Error: failed to run %s on %s/Doxyfile' % (self.args.doxygen,self.test_out));
sys.exit(1)

Expand Down

0 comments on commit 9bd54df

Please sign in to comment.