From efc6731774ca6e0da4453921ab0daeadc44ee8bc Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sat, 21 Sep 2013 09:04:01 -0500 Subject: make echotest work on BSD, by adding .echo as recognized extension diff --git a/doc/testing.txt b/doc/testing.txt index f609b65..5617e61 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -73,7 +73,6 @@ Two tests still need an intermediate script that mangles away timestamps and near-zero floating point numbers: * dumptest -* echotest * cgalstlsanitytest Some tests are yet to be converted: @@ -85,15 +84,6 @@ These look like tests, but are not actually in use: * modulecachetest * cgalcachetest -In the course of migration, the possibilities of using the OPENSCAD_TESTING -compile time flag go away; that flag used to strip timestamps out of files, -to unify float output, and to tweak the file inclusion paths. With that flag -unused, we get better coverage of the primary code paths, at the cost of -having to do some normalization in the unit testing process (thus the dumptest -and echo test scripts). Especially, having a nonstandard MCAD library in the -user include path can now break things -- but so can having misbehaving -programs in your PATH. - Troubleshooting: ------------------------------ diff --git a/src/openscad.cc b/src/openscad.cc index d8ce112..82afc16 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -83,15 +83,18 @@ using std::vector; using boost::lexical_cast; using boost::is_any_of; -static void echotest_output_handler( const std::string &msg, void *userdata ) +class Echostream : public std::ofstream { - std::ofstream *outstream = static_cast(userdata); - if (!outstream->is_open()) { - fprintf(stderr,"Error writing outstream\n" ); - return; +public: + Echostream( const char * filename ) : std::ofstream( filename ) + { + set_output_handler( &Echostream::output, this ); } - *outstream << msg; -} + static void output( const std::string &msg, void *userdata ) { + Echostream *thisp = static_cast(userdata); + *thisp << msg << "\n"; + } +}; static void help(const char *progname) { @@ -186,7 +189,7 @@ Camera get_camera( po::variables_map vm ) return camera; } -int cmdline( const char* deps_output_file, const char* filename, Camera &camera, const char *output_file, fs::path original_path, Render::type renderer, char ** argv ) +int cmdline( const char* deps_output_file, const char* filename, Camera &camera, const char *output_file, fs::path original_path, Render::type renderer, char ** argv, bool echo ) { parser_init(boosty::stringy(boost::filesystem::path( argv[0] ).parent_path())); Tree tree; @@ -201,7 +204,7 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, const char *png_output_file = NULL; const char *ast_output_file = NULL; const char *term_output_file = NULL; - const char *echotest_output_file = NULL; + const char *echo_output_file = NULL; std::string suffix = boosty::extension_str( output_file ); boost::algorithm::to_lower( suffix ); @@ -213,7 +216,7 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, else if (suffix == ".png") png_output_file = output_file; else if (suffix == ".ast") ast_output_file = output_file; else if (suffix == ".term") term_output_file = output_file; - else if (suffix == ".echotest") echotest_output_file = output_file; + else if (suffix == ".echo") echo_output_file = output_file; else { fprintf(stderr, "Unknown suffix for output file %s\n", output_file); return 1; @@ -226,14 +229,8 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, top_ctx.dump(NULL, NULL); #endif - if (echotest_output_file) { - std::ofstream fstream( echotest_output_file ); - if (!fstream.is_open()) { - PRINTB("Can't open file \"%s\" for export", csg_output_file); - } else { - set_output_handler( echotest_output_handler, fstream ); - } - } + Echostream *echostream; + if (echo_output_file) echostream = new Echostream( echo_output_file ); FileModule *root_module; ModuleInstantiation root_inst("group"); @@ -273,6 +270,8 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, tree.setRoot(root_node); + if (echostream) echostream->close(); + if (csg_output_file) { fs::current_path(original_path); std::ofstream fstream(csg_output_file); @@ -320,8 +319,8 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, } else { #ifdef ENABLE_CGAL - if ((echotest_output_file || png_output_file) && !(renderer==Render::CGAL)) { - // echotest or OpenCSG png -> don't necessarily need CGALMesh evaluation + if ((echo_output_file || png_output_file) && !(renderer==Render::CGAL)) { + // echo or OpenCSG png -> don't necessarily need CGALMesh evaluation } else { root_N = cgalevaluator.evaluateCGALMesh(*tree.root()); } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4c4bf9f..61a3520 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -897,7 +897,7 @@ add_cmdline_test(csgtermtest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX term FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allexpressions.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allfunctions.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad) -add_cmdline_test(echotest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX echotest FILES ${ECHO_FILES}) +add_cmdline_test(echotest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX echo FILES ${ECHO_FILES}) add_cmdline_test(dumptest EXE ${OPENSCAD_BINPATH} ARGS -o dump SUFFIX csg FILES ${DUMPTEST_FILES}) add_cmdline_test(cgalpngtest EXE ${OPENSCAD_BINPATH} ARGS --render -o SUFFIX png FILES ${CGALPNGTEST_FILES}) add_cmdline_test(opencsgtest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX png FILES ${OPENCSGTEST_FILES}) diff --git a/tests/regression/echotest/builtin-tests-expected.echo b/tests/regression/echotest/builtin-tests-expected.echo new file mode 100644 index 0000000..385b0dc --- /dev/null +++ b/tests/regression/echotest/builtin-tests-expected.echo @@ -0,0 +1 @@ +ECHO: 3.14159265359 diff --git a/tests/regression/echotest/builtin-tests-expected.txt b/tests/regression/echotest/builtin-tests-expected.txt deleted file mode 100644 index 385b0dc..0000000 --- a/tests/regression/echotest/builtin-tests-expected.txt +++ /dev/null @@ -1 +0,0 @@ -ECHO: 3.14159265359 diff --git a/tests/regression/echotest/dim-all-expected.echo b/tests/regression/echotest/dim-all-expected.echo new file mode 100644 index 0000000..a16c580 --- /dev/null +++ b/tests/regression/echotest/dim-all-expected.echo @@ -0,0 +1,16 @@ +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: linearX = 51.44957554275 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: linearY = 29.13025467434 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: aligned = 60 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: ordinateX = -49.17542445724 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: ordinateY = 30.86974532565 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: radius = 60 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: diameter = 120 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: arc = 59.03624346792 diff --git a/tests/regression/echotest/dim-all-expected.txt b/tests/regression/echotest/dim-all-expected.txt deleted file mode 100644 index a16c580..0000000 --- a/tests/regression/echotest/dim-all-expected.txt +++ /dev/null @@ -1,16 +0,0 @@ -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: linearX = 51.44957554275 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: linearY = 29.13025467434 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: aligned = 60 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: ordinateX = -49.17542445724 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: ordinateY = 30.86974532565 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: radius = 60 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: diameter = 120 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: arc = 59.03624346792 diff --git a/tests/regression/echotest/echo-expected.echo b/tests/regression/echotest/echo-expected.echo new file mode 100644 index 0000000..8fc094e --- /dev/null +++ b/tests/regression/echotest/echo-expected.echo @@ -0,0 +1 @@ +ECHO: diff --git a/tests/regression/echotest/echo-expected.txt b/tests/regression/echotest/echo-expected.txt deleted file mode 100644 index 8fc094e..0000000 --- a/tests/regression/echotest/echo-expected.txt +++ /dev/null @@ -1 +0,0 @@ -ECHO: diff --git a/tests/regression/echotest/echo-tests-expected.echo b/tests/regression/echotest/echo-tests-expected.echo new file mode 100644 index 0000000..d7ebe2f --- /dev/null +++ b/tests/regression/echotest/echo-tests-expected.echo @@ -0,0 +1,10 @@ +ECHO: undef +ECHO: "string" +ECHO: "stringvar" +ECHO: a = 1, b = 2, true, c = false +ECHO: [1, "vecstr", 2.34, false] +ECHO: [1 : 2 : 10] +ECHO: vec = [1, 2, 3] +ECHO: range = [0 : 1 : 2] +ECHO: "string generated by str()" +ECHO: 0.8 diff --git a/tests/regression/echotest/echo-tests-expected.txt b/tests/regression/echotest/echo-tests-expected.txt deleted file mode 100644 index d7ebe2f..0000000 --- a/tests/regression/echotest/echo-tests-expected.txt +++ /dev/null @@ -1,10 +0,0 @@ -ECHO: undef -ECHO: "string" -ECHO: "stringvar" -ECHO: a = 1, b = 2, true, c = false -ECHO: [1, "vecstr", 2.34, false] -ECHO: [1 : 2 : 10] -ECHO: vec = [1, 2, 3] -ECHO: range = [0 : 1 : 2] -ECHO: "string generated by str()" -ECHO: 0.8 diff --git a/tests/regression/echotest/escape-test-expected.echo b/tests/regression/echotest/escape-test-expected.echo new file mode 100644 index 0000000..e69de29 diff --git a/tests/regression/echotest/escape-test-expected.txt b/tests/regression/echotest/escape-test-expected.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/regression/echotest/expression-shortcircuit-tests-expected.echo b/tests/regression/echotest/expression-shortcircuit-tests-expected.echo new file mode 100644 index 0000000..d7f1c40 --- /dev/null +++ b/tests/regression/echotest/expression-shortcircuit-tests-expected.echo @@ -0,0 +1,5 @@ +ECHO: "Pass" +ECHO: "Pass" +ECHO: "Pass" +ECHO: "Pass" +ECHO: "Pass" diff --git a/tests/regression/echotest/expression-shortcircuit-tests-expected.txt b/tests/regression/echotest/expression-shortcircuit-tests-expected.txt deleted file mode 100644 index d7f1c40..0000000 --- a/tests/regression/echotest/expression-shortcircuit-tests-expected.txt +++ /dev/null @@ -1,5 +0,0 @@ -ECHO: "Pass" -ECHO: "Pass" -ECHO: "Pass" -ECHO: "Pass" -ECHO: "Pass" diff --git a/tests/regression/echotest/inf-tests-expected.echo b/tests/regression/echotest/inf-tests-expected.echo new file mode 100644 index 0000000..7ac4fe9 --- /dev/null +++ b/tests/regression/echotest/inf-tests-expected.echo @@ -0,0 +1,23 @@ +ECHO: inf +ECHO: -inf +ECHO: nan +ECHO: nan +ECHO: nan +ECHO: nan +ECHO: nan +ECHO: 90 +ECHO: -90 +ECHO: 135 +ECHO: inf +ECHO: inf +ECHO: undef +ECHO: inf +ECHO: inf +ECHO: inf +ECHO: -inf +ECHO: inf +ECHO: inf +ECHO: 1 +ECHO: -1 +ECHO: inf +ECHO: nan diff --git a/tests/regression/echotest/inf-tests-expected.txt b/tests/regression/echotest/inf-tests-expected.txt deleted file mode 100644 index 7ac4fe9..0000000 --- a/tests/regression/echotest/inf-tests-expected.txt +++ /dev/null @@ -1,23 +0,0 @@ -ECHO: inf -ECHO: -inf -ECHO: nan -ECHO: nan -ECHO: nan -ECHO: nan -ECHO: nan -ECHO: 90 -ECHO: -90 -ECHO: 135 -ECHO: inf -ECHO: inf -ECHO: undef -ECHO: inf -ECHO: inf -ECHO: inf -ECHO: -inf -ECHO: inf -ECHO: inf -ECHO: 1 -ECHO: -1 -ECHO: inf -ECHO: nan diff --git a/tests/regression/echotest/len-tests-expected.echo b/tests/regression/echotest/len-tests-expected.echo new file mode 100644 index 0000000..2a776c0 --- /dev/null +++ b/tests/regression/echotest/len-tests-expected.echo @@ -0,0 +1,7 @@ +ECHO: 4 +ECHO: 4 +ECHO: 0 +ECHO: 0 +ECHO: 2 +ECHO: 3 +ECHO: undef diff --git a/tests/regression/echotest/len-tests-expected.txt b/tests/regression/echotest/len-tests-expected.txt deleted file mode 100644 index 2a776c0..0000000 --- a/tests/regression/echotest/len-tests-expected.txt +++ /dev/null @@ -1,7 +0,0 @@ -ECHO: 4 -ECHO: 4 -ECHO: 0 -ECHO: 0 -ECHO: 2 -ECHO: 3 -ECHO: undef diff --git a/tests/regression/echotest/lookup-tests-expected.echo b/tests/regression/echotest/lookup-tests-expected.echo new file mode 100644 index 0000000..b98ebe2 --- /dev/null +++ b/tests/regression/echotest/lookup-tests-expected.echo @@ -0,0 +1,15 @@ +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: 0 +ECHO: 0.5 +ECHO: -55 +ECHO: -55 +ECHO: -54.44444444444 +ECHO: -2.5 +ECHO: 0 +ECHO: 0.9 +ECHO: 6.66666666666 +ECHO: 333 +ECHO: 333 diff --git a/tests/regression/echotest/lookup-tests-expected.txt b/tests/regression/echotest/lookup-tests-expected.txt deleted file mode 100644 index b98ebe2..0000000 --- a/tests/regression/echotest/lookup-tests-expected.txt +++ /dev/null @@ -1,15 +0,0 @@ -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: 0 -ECHO: 0.5 -ECHO: -55 -ECHO: -55 -ECHO: -54.44444444444 -ECHO: -2.5 -ECHO: 0 -ECHO: 0.9 -ECHO: 6.66666666666 -ECHO: 333 -ECHO: 333 diff --git a/tests/regression/echotest/parser-tests-expected.echo b/tests/regression/echotest/parser-tests-expected.echo new file mode 100644 index 0000000..615726a --- /dev/null +++ b/tests/regression/echotest/parser-tests-expected.echo @@ -0,0 +1,5 @@ +ECHO: 0.1 +ECHO: 2 +ECHO: 1100 +ECHO: 0.021 +ECHO: 0 diff --git a/tests/regression/echotest/parser-tests-expected.txt b/tests/regression/echotest/parser-tests-expected.txt deleted file mode 100644 index 615726a..0000000 --- a/tests/regression/echotest/parser-tests-expected.txt +++ /dev/null @@ -1,5 +0,0 @@ -ECHO: 0.1 -ECHO: 2 -ECHO: 1100 -ECHO: 0.021 -ECHO: 0 diff --git a/tests/regression/echotest/rands-expected.echo b/tests/regression/echotest/rands-expected.echo new file mode 100644 index 0000000..36ac6cd --- /dev/null +++ b/tests/regression/echotest/rands-expected.echo @@ -0,0 +1,3 @@ +WARNING: Ignoring unknown variable 'v'. +ECHO: "i hope rands() did not crash" +ECHO: [1, 1, 1, 1] diff --git a/tests/regression/echotest/rands-expected.txt b/tests/regression/echotest/rands-expected.txt deleted file mode 100644 index 36ac6cd..0000000 --- a/tests/regression/echotest/rands-expected.txt +++ /dev/null @@ -1,3 +0,0 @@ -WARNING: Ignoring unknown variable 'v'. -ECHO: "i hope rands() did not crash" -ECHO: [1, 1, 1, 1] diff --git a/tests/regression/echotest/recursion-tests-expected.echo b/tests/regression/echotest/recursion-tests-expected.echo new file mode 100644 index 0000000..e5c99b1 --- /dev/null +++ b/tests/regression/echotest/recursion-tests-expected.echo @@ -0,0 +1,2 @@ +ERROR: Recursion detected calling function 'crash' +ECHO: undef diff --git a/tests/regression/echotest/recursion-tests-expected.txt b/tests/regression/echotest/recursion-tests-expected.txt deleted file mode 100644 index e5c99b1..0000000 --- a/tests/regression/echotest/recursion-tests-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ -ERROR: Recursion detected calling function 'crash' -ECHO: undef diff --git a/tests/regression/echotest/search-tests-expected.echo b/tests/regression/echotest/search-tests-expected.echo new file mode 100644 index 0000000..0269f43 --- /dev/null +++ b/tests/regression/echotest/search-tests-expected.echo @@ -0,0 +1,20 @@ + WARNING: search term not found: "q" + WARNING: search term not found: 1000 + WARNING: search term not found: "zzz" + WARNING: search term not found: "zzz" + WARNING: search term not found: 500 + WARNING: search term not found: "" +ECHO: "Characters in string (\"a\"): [0]" +ECHO: "Characters in string (\"adeq\"): [[0, 5], [3, 8], [4], []]" +ECHO: "Default string search (\"abe\"): [0, 1, 8]" +ECHO: "Return all matches for string search (\"abe\"): [[0, 4, 9, 10], [1, 5], [8]]" +ECHO: "Return up to 2 matches for string search (\"abe\"): [[0, 4], [1, 5], [8]]" +ECHO: "Return up to 2 matches for string search; alternate columns (\"aebe\"): [[0, 4], [8], [1, 5], [8]]" +ECHO: "Default number search (7): [5]" +ECHO: "Return all matches for number search (1): [0, 4, 10]" +ECHO: "Return up to 2 matches for number search (1): [0, 4]" +ECHO: "Default list number search ([1, 3, 1000]): [0, 1, []]" +ECHO: "Default list string search ([\"b\", \"zzz\", \"a\", \"c\", \"apple\", \"dog\"]): [1, [], 4, 2, 9, 3]" +ECHO: "Default list mixed search ([\"b\", 4, \"zzz\", \"c\", \"apple\", 500, \"a\", \"\"]): [1, 3, [], 2, 9, [], 4, []]" +ECHO: "Return all matches for mixed search ([\"b\", 4, \"zzz\", \"c\", \"apple\", 500, \"a\", \"\"]): [[1, 5], [3], [], [2, 6], [9], [], [4, 10], []]" +ECHO: "Return all matches for mixed search; alternate columns ([1, \"zz\", \"dog\", 500, 11]): [[0], [], [3], [], [10]]" diff --git a/tests/regression/echotest/search-tests-expected.txt b/tests/regression/echotest/search-tests-expected.txt deleted file mode 100644 index 0269f43..0000000 --- a/tests/regression/echotest/search-tests-expected.txt +++ /dev/null @@ -1,20 +0,0 @@ - WARNING: search term not found: "q" - WARNING: search term not found: 1000 - WARNING: search term not found: "zzz" - WARNING: search term not found: "zzz" - WARNING: search term not found: 500 - WARNING: search term not found: "" -ECHO: "Characters in string (\"a\"): [0]" -ECHO: "Characters in string (\"adeq\"): [[0, 5], [3, 8], [4], []]" -ECHO: "Default string search (\"abe\"): [0, 1, 8]" -ECHO: "Return all matches for string search (\"abe\"): [[0, 4, 9, 10], [1, 5], [8]]" -ECHO: "Return up to 2 matches for string search (\"abe\"): [[0, 4], [1, 5], [8]]" -ECHO: "Return up to 2 matches for string search; alternate columns (\"aebe\"): [[0, 4], [8], [1, 5], [8]]" -ECHO: "Default number search (7): [5]" -ECHO: "Return all matches for number search (1): [0, 4, 10]" -ECHO: "Return up to 2 matches for number search (1): [0, 4]" -ECHO: "Default list number search ([1, 3, 1000]): [0, 1, []]" -ECHO: "Default list string search ([\"b\", \"zzz\", \"a\", \"c\", \"apple\", \"dog\"]): [1, [], 4, 2, 9, 3]" -ECHO: "Default list mixed search ([\"b\", 4, \"zzz\", \"c\", \"apple\", 500, \"a\", \"\"]): [1, 3, [], 2, 9, [], 4, []]" -ECHO: "Return all matches for mixed search ([\"b\", 4, \"zzz\", \"c\", \"apple\", 500, \"a\", \"\"]): [[1, 5], [3], [], [2, 6], [9], [], [4, 10], []]" -ECHO: "Return all matches for mixed search; alternate columns ([1, \"zz\", \"dog\", 500, 11]): [[0], [], [3], [], [10]]" diff --git a/tests/regression/echotest/string-indexing-expected.echo b/tests/regression/echotest/string-indexing-expected.echo new file mode 100644 index 0000000..3fcdfa4 --- /dev/null +++ b/tests/regression/echotest/string-indexing-expected.echo @@ -0,0 +1,11 @@ +ECHO: "t" +ECHO: "e" +ECHO: "s" +ECHO: "t" +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: "e" diff --git a/tests/regression/echotest/string-indexing-expected.txt b/tests/regression/echotest/string-indexing-expected.txt deleted file mode 100644 index 3fcdfa4..0000000 --- a/tests/regression/echotest/string-indexing-expected.txt +++ /dev/null @@ -1,11 +0,0 @@ -ECHO: "t" -ECHO: "e" -ECHO: "s" -ECHO: "t" -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: "e" diff --git a/tests/regression/echotest/string-test-expected.echo b/tests/regression/echotest/string-test-expected.echo new file mode 100644 index 0000000..1969a74 --- /dev/null +++ b/tests/regression/echotest/string-test-expected.echo @@ -0,0 +1 @@ +ECHO: "The quick brown fox \tjumps \"over\" the lazy dog. The quick brown fox.\nThe \\lazy\\ dog." diff --git a/tests/regression/echotest/string-test-expected.txt b/tests/regression/echotest/string-test-expected.txt deleted file mode 100644 index 1969a74..0000000 --- a/tests/regression/echotest/string-test-expected.txt +++ /dev/null @@ -1 +0,0 @@ -ECHO: "The quick brown fox \tjumps \"over\" the lazy dog. The quick brown fox.\nThe \\lazy\\ dog." diff --git a/tests/regression/echotest/value-reassignment-tests-expected.echo b/tests/regression/echotest/value-reassignment-tests-expected.echo new file mode 100644 index 0000000..344f7ab --- /dev/null +++ b/tests/regression/echotest/value-reassignment-tests-expected.echo @@ -0,0 +1,2 @@ +WARNING: Ignoring unknown variable 'i'. +ECHO: undef, 2 diff --git a/tests/regression/echotest/value-reassignment-tests-expected.txt b/tests/regression/echotest/value-reassignment-tests-expected.txt deleted file mode 100644 index 344f7ab..0000000 --- a/tests/regression/echotest/value-reassignment-tests-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ -WARNING: Ignoring unknown variable 'i'. -ECHO: undef, 2 diff --git a/tests/regression/echotest/value-reassignment-tests2-expected.echo b/tests/regression/echotest/value-reassignment-tests2-expected.echo new file mode 100644 index 0000000..efb1be7 --- /dev/null +++ b/tests/regression/echotest/value-reassignment-tests2-expected.echo @@ -0,0 +1 @@ +ECHO: 3, 3 diff --git a/tests/regression/echotest/value-reassignment-tests2-expected.txt b/tests/regression/echotest/value-reassignment-tests2-expected.txt deleted file mode 100644 index efb1be7..0000000 --- a/tests/regression/echotest/value-reassignment-tests2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -ECHO: 3, 3 diff --git a/tests/regression/echotest/variable-scope-tests-expected.echo b/tests/regression/echotest/variable-scope-tests-expected.echo new file mode 100644 index 0000000..2a82090 --- /dev/null +++ b/tests/regression/echotest/variable-scope-tests-expected.echo @@ -0,0 +1,27 @@ +ECHO: "special variable inheritance" +ECHO: 23, 5 +WARNING: Ignoring unknown variable 'a'. +ECHO: undef +ECHO: 23, 5 +ECHO: "$children scope" +ECHO: "$children should be 1: ", 1 +ECHO: "$children should be 4: ", 4 +ECHO: "$children should be 1: ", 1 +ECHO: "child_module_1 child" +ECHO: "child_module_2 child 0" +ECHO: "child_module_2 child 1" +ECHO: "copy $children" +ECHO: "copy_children_module: ", 2, 2 +ECHO: "inner variables shadows parameter" +ECHO: 5, 24 +ECHO: "user-defined special variables as parameter" +ECHO: 7 +ECHO: 7 +ECHO: "assign only visible in children's scope" +WARNING: Ignoring unknown variable 'c'. +ECHO: undef +ECHO: 5 +ECHO: "undeclared variable can still be passed and used" +ECHO: 6 +ECHO: "attempt to assign from a not-yet-defined variable which also exists globally" +ECHO: 5, 1 diff --git a/tests/regression/echotest/variable-scope-tests-expected.txt b/tests/regression/echotest/variable-scope-tests-expected.txt deleted file mode 100644 index 2a82090..0000000 --- a/tests/regression/echotest/variable-scope-tests-expected.txt +++ /dev/null @@ -1,27 +0,0 @@ -ECHO: "special variable inheritance" -ECHO: 23, 5 -WARNING: Ignoring unknown variable 'a'. -ECHO: undef -ECHO: 23, 5 -ECHO: "$children scope" -ECHO: "$children should be 1: ", 1 -ECHO: "$children should be 4: ", 4 -ECHO: "$children should be 1: ", 1 -ECHO: "child_module_1 child" -ECHO: "child_module_2 child 0" -ECHO: "child_module_2 child 1" -ECHO: "copy $children" -ECHO: "copy_children_module: ", 2, 2 -ECHO: "inner variables shadows parameter" -ECHO: 5, 24 -ECHO: "user-defined special variables as parameter" -ECHO: 7 -ECHO: 7 -ECHO: "assign only visible in children's scope" -WARNING: Ignoring unknown variable 'c'. -ECHO: undef -ECHO: 5 -ECHO: "undeclared variable can still be passed and used" -ECHO: 6 -ECHO: "attempt to assign from a not-yet-defined variable which also exists globally" -ECHO: 5, 1 diff --git a/tests/regression/echotest/vector-values-expected.echo b/tests/regression/echotest/vector-values-expected.echo new file mode 100644 index 0000000..78053b9 --- /dev/null +++ b/tests/regression/echotest/vector-values-expected.echo @@ -0,0 +1,10 @@ +ECHO: "Testing vector dot product: 14" +ECHO: " Bounds check: undef" +ECHO: "Testing matrix * vector: [3, 2, 13]" +ECHO: " Bounds check: undef" +ECHO: "Testing vector * matrix: [9, 8]" +ECHO: " Bounds check: undef" +ECHO: "Testing id matrix * id matrix: [[1, 0], [0, 1]]" +ECHO: "Testing asymmetric matrix * matrix: [[2, 1], [-1, 0]]" +ECHO: "Testing alternate asymmetric matrix * matrix: [[1, 0, 1], [0, 1, -1], [1, 1, 0]]" +ECHO: " Bounds check: undef" diff --git a/tests/regression/echotest/vector-values-expected.txt b/tests/regression/echotest/vector-values-expected.txt deleted file mode 100644 index 78053b9..0000000 --- a/tests/regression/echotest/vector-values-expected.txt +++ /dev/null @@ -1,10 +0,0 @@ -ECHO: "Testing vector dot product: 14" -ECHO: " Bounds check: undef" -ECHO: "Testing matrix * vector: [3, 2, 13]" -ECHO: " Bounds check: undef" -ECHO: "Testing vector * matrix: [9, 8]" -ECHO: " Bounds check: undef" -ECHO: "Testing id matrix * id matrix: [[1, 0], [0, 1]]" -ECHO: "Testing asymmetric matrix * matrix: [[2, 1], [-1, 0]]" -ECHO: "Testing alternate asymmetric matrix * matrix: [[1, 0, 1], [0, 1, -1], [1, 1, 0]]" -ECHO: " Bounds check: undef" -- cgit v0.10.1