tests: Various improvements

- Don't be verbose when removing files.
- Reverse diff order so output makes more sense.
- Only strip whitespace from the end of lines.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2013-07-28 22:36:08 -04:00 committed by Anna Schumaker
parent 328c6f70e8
commit 0ed8e48668
5 changed files with 4 additions and 10 deletions

View File

@ -10,7 +10,7 @@
/* A bit hackish, but it works... */
static void rm_dir(const char *dir)
{
std::string cmd = "rm -frv ";
std::string cmd = "rm -rf ";
cmd += dir;
cmd += "/ocarina-test";
system(cmd.c_str());

View File

@ -16,11 +16,11 @@ def run_test(target, source, env):
if (len(source) == 2) and (ret == 0):
good = str(source[1])
if (subprocess.call("diff -u %s %s" % (res, good), shell = True) != 0):
if (subprocess.call("diff -u %s %s" % (good, res), shell = True) != 0):
print
else:
for line in open( str(target[0]) ):
print line.strip()
print line.rstrip()
print
def Test(group, src):

View File

@ -1,5 +1,5 @@
/*
* Test that a file object can be created.
* Test that a file object can be created and resolves paths correctly.
*/
#include <file.h>
#include <print.h>

View File

@ -1,6 +1,3 @@
removed /home/anna/.local/share/ocarina-test/test.4
removed /home/anna/.local/share/ocarina-test/test.3
removed directory: /home/anna/.local/share/ocarina-test
ERROR: NOT_OPEN is not a legal OpenMode (/home/anna/.local/share/ocarina-test/test.0)
Test 0: Passed

View File

@ -1,6 +1,3 @@
removed /home/anna/.local/share/ocarina-test/test.4
removed /home/anna/.local/share/ocarina-test/test.3
removed directory: /home/anna/.local/share/ocarina-test
Test 0: Passed