Commits

Armin Ronacher committed 514d1b1

Fixed testsuite for OS X

Comments (0)

Files changed (4)

 check: vcprompt
 	cd tests && ./test-simple
 
+test: check
+
 gitrepo = tests/git-repo.tar
 
 check-git: vcprompt $(gitrepo)
         return 1;
 
     /* might abort early in case the helpscreen is shown */
-    if (parse_args(argc, argv, options))
-        goto close_and_cleanup;
+    if (parse_args(argc, argv, options)) {
+        free_options(options);
+        return 1;
+    }
 
     parse_format(options);
     set_options(options);
 
 find_vcprompt()
 {
-    vcprompt=$(dirname $(dirname $(readlink -f $0)))/vcprompt
+    vcprompt=`pwd`/../vcprompt
     if [ ! -x $vcprompt ]; then
-	echo "error: vcprompt executable not found (expected $vcprompt)" >&2
-	exit 1
+        echo "error: vcprompt executable not found (expected $vcprompt)" >&2
+        exit 1
     fi
 }
 
 setup()
 {
-    tmpdir=`mktemp -d`
+    tmpdir=`mktemp -d /tmp/vcprompt.XXXXX`
     trap cleanup 0 1 2 15
 }
 

tests/test-simple

-#!/bin/sh
+#!/bin/bash
 
 # Simple tests that do not require any external tools: i.e.
 # these just setup little fake working copies and make sure
 
 find_vcprompt
 setup
-
 failed=""
 
 test_no_vc