Index: common/dirwalk/test.sh |
diff --git a/common/dirwalk/test.sh b/common/dirwalk/test.sh |
new file mode 100755 |
index 0000000000000000000000000000000000000000..4f261e01850d843c8b5782982afbbff5bad1cb8d |
--- /dev/null |
+++ b/common/dirwalk/test.sh |
@@ -0,0 +1,39 @@ |
+#!/bin/bash |
M-A Ruel
2016/09/15 14:31:02
I'd like to have the test to be split up in a sepa
mithro
2016/09/20 12:41:44
This file is just to make it easy to run all the p
M-A Ruel
2016/09/20 16:37:27
Yes, we do not use bash unless it is expressively
|
+# Copyright 2016 The LUCI Authors. All rights reserved. |
+# Use of this source code is governed under the Apache License, Version 2.0 |
+# that can be found in the LICENSE file. |
+ |
+TESTS=common/dirwalk/tests/*.json |
+ |
+go install github.com/luci/luci-go/common/dirwalk/tests/tools/gendir |
+go install github.com/luci/luci-go/common/dirwalk/tests/tools/walkdir |
+ |
+echo "Generating the test directories" |
+TMPDIR=/usr/local/google/tmp/luci-tests |
+mkdir -p $TMPDIR |
+for TESTFILE in $TESTS; do |
+ TESTNAME="$(basename $TESTFILE .json)" |
+ TESTDIR="$TMPDIR/$TESTNAME" |
+ if ! [ -d $TESTDIR ]; then |
+ echo "Generating test directory for $TESTNAME" |
+ gendir -config $TESTFILE -outdir $TESTDIR |
+ du -h $TESTDIR |
+ fi |
+done |
+ |
+for METHOD in simple nostat parallel; do |
+ echo "Running $METHOD" |
+ for TESTFILE in $TESTS; do |
+ TESTNAME="$(basename $TESTFILE .json)" |
+ TESTDIR="$TMPDIR/$TESTNAME" |
+ OUTPUT=output.$METHOD.$TESTNAME |
+ echo "Running $METHOD.$TESTNAME" |
+ rm $OUTPUT |
+ $(which time) --verbose --output=$OUTPUT --append walkdir --dir $TESTDIR --method $METHOD $@ 2> $OUTPUT |
+ tail -n 20 $OUTPUT |
+ echo |
+ done |
+ echo |
+ echo |
+ echo |
+done |