X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Fmisc%2Fnew-test.sh;fp=auto_tests%2Fmisc%2Fnew-test.sh;h=0000000000000000000000000000000000000000;hb=3123ca57f71d145bb5bcc4a2f754d3dff3225346;hp=4539202561211227762e073a6b8fcf9ee116993d;hpb=26ee953643ccd2d32e38e6b60b20e6a01c1dc9ba;p=dygraphs.git diff --git a/auto_tests/misc/new-test.sh b/auto_tests/misc/new-test.sh deleted file mode 100755 index 4539202..0000000 --- a/auto_tests/misc/new-test.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# Run this to automatically create a new auto_test. Example: -# -# ./auto_tests/misc/new_test.sh axis-labels -# -# This will produce a new file in auto_tests/tests/axis_labels.js including -# -# var AxisLabelsTestCase = TestCase("axis-labels"); -# ... -# -# It will also add a reference to this file to auto_tests/misc/local.html. - -set -o errexit -if [ -z $1 ]; then - echo Usage: $0 test-case-name-with-dashes - exit 1 -fi - -dashed_name=$1 -underscore_name=$(echo $1 | sed 's/-/_/g') -camelCaseName=$(echo $1 | perl -pe 's/-([a-z])/uc $1/ge') -testCaseName=${camelCaseName}TestCase - -test_file=auto_tests/tests/$underscore_name.js - -if [ -f $test_file ]; then - echo $test_file already exists - exit 1 -fi - -cat < $test_file; -/** - * @fileoverview FILL THIS IN - * - * @author $(git config --get user.email) ($(git config --get user.name)) - */ -var $testCaseName = TestCase("$dashed_name"); - -$testCaseName.prototype.setUp = function() { - document.body.innerHTML = "
"; -}; - -$testCaseName.prototype.tearDown = function() { -}; - -$testCaseName.prototype.testNameGoesHere = function() { - var opts = { - width: 480, - height: 320 - }; - var data = "X,Y\n" + - "0,-1\n" + - "1,0\n" + - "2,1\n" + - "3,0\n" - ; - - var graph = document.getElementById("graph"); - var g = new Dygraph(graph, data, opts); - - ... - assertEquals(1, 1); -}; - -END - -perl -pi -e 'next unless /update_options.js/; print " \n"' auto_tests/misc/local.html - -echo Wrote test to $test_file