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:
parent
328c6f70e8
commit
0ed8e48668
|
@ -10,7 +10,7 @@
|
||||||
/* A bit hackish, but it works... */
|
/* A bit hackish, but it works... */
|
||||||
static void rm_dir(const char *dir)
|
static void rm_dir(const char *dir)
|
||||||
{
|
{
|
||||||
std::string cmd = "rm -frv ";
|
std::string cmd = "rm -rf ";
|
||||||
cmd += dir;
|
cmd += dir;
|
||||||
cmd += "/ocarina-test";
|
cmd += "/ocarina-test";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
|
@ -16,11 +16,11 @@ def run_test(target, source, env):
|
||||||
|
|
||||||
if (len(source) == 2) and (ret == 0):
|
if (len(source) == 2) and (ret == 0):
|
||||||
good = str(source[1])
|
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
|
print
|
||||||
else:
|
else:
|
||||||
for line in open( str(target[0]) ):
|
for line in open( str(target[0]) ):
|
||||||
print line.strip()
|
print line.rstrip()
|
||||||
print
|
print
|
||||||
|
|
||||||
def Test(group, src):
|
def Test(group, src):
|
||||||
|
|
|
@ -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 <file.h>
|
||||||
#include <print.h>
|
#include <print.h>
|
||||||
|
|
|
@ -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)
|
ERROR: NOT_OPEN is not a legal OpenMode (/home/anna/.local/share/ocarina-test/test.0)
|
||||||
Test 0: Passed
|
Test 0: Passed
|
||||||
|
|
|
@ -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
|
Test 0: Passed
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue