From 54a7730450585b70db361c6dcf4dab3f6de37f0f Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Wed, 20 Nov 2024 08:25:23 +0000 Subject: [PATCH] more project directory structuring --- {tester/jvm => document}/.githolder | 0 tester/document/.githolder | 0 tester/document/Writing a test.txt | 50 --------- tester/document/build_run_transcript_v1.0.txt | 62 ----------- tester/document/build_run_transcript_v1.1.txt | 74 ------------- tester/document/jdb.txt | 54 ---------- tester/javac/Test0.java | 36 ------- tester/javac/Test_IO.java | 73 ------------- tester/javac/Test_MockClass_0.java | 98 ------------------ tester/javac/Test_Testbench.java | 82 --------------- tester/javac/Test_Util.java | 82 --------------- tester/jvm/Test_Mosaic.jar | Bin 7683 -> 0 bytes tester/shell/Test0 | 2 - tester/shell/Test_IO | 2 - tester/shell/Test_MockClass_0 | 2 - tester/shell/Test_Testbench | 2 - tester/shell/Test_Util | 2 - tester/shell/test_log.txt | 14 --- tester/tool/clean_build_directories | 24 ----- tester/tool/make | 32 ------ tester/tool/run_jdb | 12 --- tester/tool/run_tests | 23 ---- tester/tool/shell_wrapper_list | 13 --- tool/.githolder | 0 tool_shared/bespoke/git_holder | 20 ++++ tool_shared/bespoke/vl | 4 +- tool_shared/document/#install_java.txt# | 11 -- tool_shared/document/.githolder | 0 tool_shared/document/install_java.txt | 11 -- 29 files changed, 23 insertions(+), 762 deletions(-) rename {tester/jvm => document}/.githolder (100%) create mode 100644 tester/document/.githolder delete mode 100644 tester/document/Writing a test.txt delete mode 100644 tester/document/build_run_transcript_v1.0.txt delete mode 100644 tester/document/build_run_transcript_v1.1.txt delete mode 100644 tester/document/jdb.txt delete mode 100644 tester/javac/Test0.java delete mode 100644 tester/javac/Test_IO.java delete mode 100644 tester/javac/Test_MockClass_0.java delete mode 100644 tester/javac/Test_Testbench.java delete mode 100644 tester/javac/Test_Util.java delete mode 100644 tester/jvm/Test_Mosaic.jar delete mode 100755 tester/shell/Test0 delete mode 100755 tester/shell/Test_IO delete mode 100755 tester/shell/Test_MockClass_0 delete mode 100755 tester/shell/Test_Testbench delete mode 100755 tester/shell/Test_Util delete mode 100644 tester/shell/test_log.txt delete mode 100755 tester/tool/clean_build_directories delete mode 100755 tester/tool/make delete mode 100755 tester/tool/run_jdb delete mode 100755 tester/tool/run_tests delete mode 100755 tester/tool/shell_wrapper_list create mode 100644 tool/.githolder create mode 100755 tool_shared/bespoke/git_holder delete mode 100644 tool_shared/document/#install_java.txt# create mode 100644 tool_shared/document/.githolder delete mode 100644 tool_shared/document/install_java.txt diff --git a/tester/jvm/.githolder b/document/.githolder similarity index 100% rename from tester/jvm/.githolder rename to document/.githolder diff --git a/tester/document/.githolder b/tester/document/.githolder new file mode 100644 index 0000000..e69de29 diff --git a/tester/document/Writing a test.txt b/tester/document/Writing a test.txt deleted file mode 100644 index d2d02ed..0000000 --- a/tester/document/Writing a test.txt +++ /dev/null @@ -1,50 +0,0 @@ - -I did not use Mosaic to test itself, although Test_MockClass_0 comes close. - -TestMockClass has the general form of a test that uses Mosaic, though MockClass -itself does not exist. This general form: - -*. For block testing there conventionally be a correspondence between - The test classes and the a class being tested, so each test class will - be named: - - `Test__'. - - Typically the lowest `number` will be zero, and it will correspond to - smoke tests. - -* A `Test__' class will have inside of it another class - called `TestSuite`. By convention each method in this class is a test routine. For block - testing a test routine will has a correspondence to the method being tested, - and has the name: - - `test__`. - - This convention is not always followed, no that in `Test_MackClass_0` you will - notice that tests are named after the expected results rather than a method - that is being tested. - - Test routines can run a number of tests on a RUT, each of which is referred to - as a test case. So we have this hierarchy: - - `Test__' > `TestSuite` > test_routine > test_case - -*. The main call for a Test class will parse arguments and options, setup - the testing environment, make a `TestSuite` object, pass said object to - the `TestBench`, then take the return value from the `Testbench`, and set - the return value from the test. - -* A test routines will return `true` if the test passes. Any other return - value, any uncaught exception, or anything left on the stdout or stderr - will cause the test to be interpreted as a failure. (On the todo list is - an item to make unused stdin an error as well.) - -* A test reoutine (nor the contained test cases) should not themselves print - any messages. Generally it has always been this way, even before the Testbench - redirected and the i/o streams. Rather the test should simply return true - for a pass. This is because in testing we are looking for function failures, - and not for faults. The fault will be searched for later in the debugger. - - If a test routine has an internal error, such that the routine itself - has a problem (not the RUT it is testing), this can be put in a log - entry. See the Mosaic_Util for the log methods. diff --git a/tester/document/build_run_transcript_v1.0.txt b/tester/document/build_run_transcript_v1.0.txt deleted file mode 100644 index 615640a..0000000 --- a/tester/document/build_run_transcript_v1.0.txt +++ /dev/null @@ -1,62 +0,0 @@ -This shows all tests passing. - -Tests named `test_failure_` should fail. We need to know that the `TestBench` -can fail tests, so this is part of testing the `TestBench`. - -> cd Mosaic -> source env_tester -> emacs & - -... - -2024-11-04T11:23:08Z[Mosaic_tester] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic§ -> clean_build_directories -+ cd /var/user_data/Thomas-developer/Mosaic/tester -+ rm -r scratchpad/Test0.class scratchpad/Test_IO.class 'scratchpad/Test_MockClass$TestSuite.class' scratchpad/Test_MockClass.class scratchpad/Test_TestBench.class scratchpad/Test_Util.class -+ rm jvm/Test_Mosaic.jar -+ rm shell/Test0 shell/Test_IO shell/Test_MockClass shell/Test_TestBench shell/Test_Util -+ set +x -clean_build_directories done. - -2024-11-04T11:23:23Z[Mosaic_tester] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic§ -> make -Compiling files... -+ cd /var/user_data/Thomas-developer/Mosaic/tester -+ javac -g -d scratchpad javac/Test0.java javac/Test_IO.java javac/Test_MockClass.java javac/Test_TestBench.java javac/Test_Util.java -+ jar cf jvm/Test_Mosaic.jar -C scratchpad . -+ set +x -Creating shell wrappers... -tester/tool/make done. - -2024-11-04T11:23:27Z[Mosaic_tester] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic§ -> run_tests -Running Test0...Test0 passed -Running Test_Util...Test_Util passed -Running Test_IO...Test_IO passed -Running Test_TestBench...Expected output: Structural problem message for dummy_invalid_return_method. -Structural problem: dummy_invalid_return_method does not return Boolean. -Test_TestBench Total tests run: 3 -Test_TestBench Total tests passed: 3 -Test_TestBench Total tests failed: 0 -Running Test_MockClass...Test failed: 'test_failure_0' reported failure. -Structural problem: test_failure_1 does not return Boolean. -Error: test_failure_1 has an invalid structure. -Test failed: 'test_failure_2' threw an exception: java.lang.reflect.InvocationTargetException -Test failed: 'test_failure_3' produced extraneous stdout. -Test failed: 'test_failure_4' produced extraneous stderr. -Total tests run: 9 -Total tests passed: 4 -Total tests failed: 5 - -2024-11-04T11:23:33Z[Mosaic_tester] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic§ -> clean_build_directories -+ cd /var/user_data/Thomas-developer/Mosaic/tester -+ rm -r scratchpad/Test0.class scratchpad/Test_IO.class 'scratchpad/Test_MockClass$TestSuite.class' scratchpad/Test_MockClass.class scratchpad/Test_TestBench.class scratchpad/Test_Util.class -+ rm jvm/Test_Mosaic.jar -+ rm shell/Test0 shell/Test_IO shell/test_log.txt shell/Test_MockClass shell/Test_TestBench shell/Test_Util -+ set +x -clean_build_directories done. diff --git a/tester/document/build_run_transcript_v1.1.txt b/tester/document/build_run_transcript_v1.1.txt deleted file mode 100644 index feb0d04..0000000 --- a/tester/document/build_run_transcript_v1.1.txt +++ /dev/null @@ -1,74 +0,0 @@ -This shows all tests passing. - -Tests named `test_failure_` should fail. We need to know that the `TestBench` -can fail tests, so this is part of testing the `TestBench`. - -Staring the environment: - -2024-11-08T07:41:48Z[] -Thomas-developer@Blossac§/var/user_data/Thomas-developer§ -> bash - -2024-11-08T07:41:51Z[] -Thomas-developer@Blossac§/var/user_data/Thomas-developer§ -> cd Mosaic - -2024-11-08T07:41:54Z[] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic§ -> . env_tester -REPO_HOME /var/user_data/Thomas-developer/Mosaic -PROJECT Mosaic -ENV tool_shared/bespoke/env -ENV tester/tool/env - -2024-11-08T07:42:04Z[Mosaic_tester] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic/tester§ -> emacs & - -Running the tests: - -2024-11-08T09:58:40Z[Mosaic_tester] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic/tester§ -> clean_build_directories -+ cd /var/user_data/Thomas-developer/Mosaic/tester -+ rm -r scratchpad/Test0.class scratchpad/Test_IO.class 'scratchpad/Test_MockClass_0$TestSuite.class' scratchpad/Test_MockClass_0.class scratchpad/Test_Testbench.class scratchpad/Test_Util.class -+ rm jvm/Test_Mosaic.jar -+ rm shell/Test0 shell/Test_IO shell/test_log.txt shell/Test_MockClass_0 shell/Test_Testbench shell/Test_Util -+ set +x -clean_build_directories done. - -2024-11-08T09:58:46Z[Mosaic_tester] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic/tester§ -> make -Compiling files... -+ cd /var/user_data/Thomas-developer/Mosaic/tester -+ javac -g -d scratchpad javac/Test0.java javac/Test_IO.java javac/Test_MockClass_0.java javac/Test_Testbench.java javac/Test_Util.java -+ jar cf jvm/Test_Mosaic.jar -C scratchpad . -+ set +x -Creating shell wrappers... -tester/tool/make done. - -2024-11-08T09:58:50Z[Mosaic_tester] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic/tester§ -> run_tests -Running Test0...Test0 passed -Running Test_Util...Test_Util passed -Running Test_IO...Test_IO passed -Running Test_Testbench...Expected output: Structural problem message for dummy_invalid_return_method. -Structural problem: dummy_invalid_return_method does not return Boolean. -Test_Testbench Total tests run: 3 -Test_Testbench Total tests passed: 3 -Test_Testbench Total tests failed: 0 -Running Test_MockClass_0...Test failed: 'test_failure_0' reported failure. -Structural problem: test_failure_1 does not return Boolean. -Error: test_failure_1 has an invalid structure. -Test failed: 'test_failure_2' threw an exception: java.lang.reflect.InvocationTargetException -Test failed: 'test_failure_3' produced extraneous stdout. -Test failed: 'test_failure_4' produced extraneous stderr. -Total tests run: 9 -Total tests passed: 4 -Total tests failed: 5 - -2024-11-08T09:58:55Z[Mosaic_tester] -Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic/tester§ -> diff --git a/tester/document/jdb.txt b/tester/document/jdb.txt deleted file mode 100644 index 1ed956a..0000000 --- a/tester/document/jdb.txt +++ /dev/null @@ -1,54 +0,0 @@ -About `jdb` - -1. setting the environment - - The environment should be set before running the IDE. For example, - - > cd Mosaic - > source env_tester - > emacs & - - (I use emacs as my IDE. You might be using a different tool.) - -2. location of the executable - - Provided that the project administrator installed it, jdb is located in the - third_party tools directory. In the tester environment the variable - `JAVA_HOME` should hold the jdb directory path, and this should already - be in the `PATH`. For example: - - > echo $ENV - tester/tool/env - - > echo $JAVA_HOME - /var/user_data/Thomas-developer/Mosaic/tool_shared/third_party/jdk-11 - - > which jdb - /var/user_data/Thomas-developer/Mosaic/tool_shared/third_party/jdk-11/bin/jdb - -3. invocation from a shell command: - - jdb -sourcepath $SOURCEPATH - - The `SOURCEPATH` is assigned a value in `tester/tool/env`. In some versions - of jdb there is no space between `-sourcepath` and the `$SOURCDEPATH`. - - jdb will read CLASSPATH from the environment. In contrast jdb will not read - `SOURCEPATH` from the environment. It must be passed as an argument. - - There is a `run_jdb` script in the `tool` directory. - -4. invocation inside of Emacs - - The file `tool_shared/bespoke/emacs.el` holds a definition for the `jdbx` - command. This command will read the SOURCEPATH from the environment and run - jdb in Emacs. - - That file also holds the definition for a listener to the jdb `sourcepath` - command. - - - - - - diff --git a/tester/javac/Test0.java b/tester/javac/Test0.java deleted file mode 100644 index c4abc4a..0000000 --- a/tester/javac/Test0.java +++ /dev/null @@ -1,36 +0,0 @@ -import com.ReasoningTechnology.Mosaic.Mosaic_Util; - -/* -Test Zero - -Plug it in, see if there is smoke. There usually is. - -*/ - -public class Test0{ - - public static Boolean test_is_true(){ - return true; - } - - public static int run(){ - Boolean[] condition = new Boolean[1]; - condition[0] = test_is_true(); - - int i = 0; - if( !Mosaic_Util.all(condition) ){ - System.out.println("Test0 failed"); - return 1; - } - System.out.println("Test0 passed"); - return 0; - } - - // Main function to provide a shell interface for running tests - public static void main(String[] args){ - int return_code = run(); - System.exit(return_code); - return; - } - -} diff --git a/tester/javac/Test_IO.java b/tester/javac/Test_IO.java deleted file mode 100644 index a7f8248..0000000 --- a/tester/javac/Test_IO.java +++ /dev/null @@ -1,73 +0,0 @@ -import com.ReasoningTechnology.Mosaic.Mosaic_IO; -import com.ReasoningTechnology.Mosaic.Mosaic_Util; - -public class Test_IO{ - - public static int fut(){ - try{ - // Echo some characters from stdin to stdout - System.out.print((char) System.in.read()); - System.out.print((char) System.in.read()); - - // Echo some more characters from stdin to stderr - System.err.print((char) System.in.read()); - System.err.print((char) System.in.read()); - - // Count remaining characters until EOF - int count = 0; - while(System.in.read() != -1){ - count++; - } - - return count; - } catch(Exception e){ - e.printStackTrace(); - return -1; // Error case - } - } - - public static int run(){ - Mosaic_IO io = new Mosaic_IO(); - Boolean[] condition = new Boolean[3]; - - // Redirect IO streams - io.redirect(); - - // Provide input for the function under test - io.push_input("abcdefg"); - - // Execute function under test - int result = fut(); - - // Check stdout content - String stdout_string = io.get_out_content(); - condition[0] = stdout_string.equals("ab"); - - // Check stderr content - String stderr_string = io.get_err_content(); - condition[1] = stderr_string.equals("cd"); - - // Check returned character count (3 remaining characters: 'e','f','g') - condition[2] = result == 3; - - // Restore original IO streams - io.restore(); - - if(!Mosaic_Util.all(condition)){ - System.out.println("Test_IO failed"); - return 1; - } - System.out.println("Test_IO passed"); - return 0; - } - - // Main function to provide a shell interface for running tests - public static void main(String[] args){ - int return_code = run(); - System.exit(return_code); - return; - } - -} - - diff --git a/tester/javac/Test_MockClass_0.java b/tester/javac/Test_MockClass_0.java deleted file mode 100644 index 0f02a64..0000000 --- a/tester/javac/Test_MockClass_0.java +++ /dev/null @@ -1,98 +0,0 @@ -/* -------------------------------------------------------------------------------- - Integration tests directly simulate the use cases for Mosaic_Testbench. - Each test method validates a specific feature of Mosaic_Testbench ,including pass, - fail ,error handling ,and I/O interactions. -*/ - -import java.util.Scanner; -import com.ReasoningTechnology.Mosaic.Mosaic_IO; -import com.ReasoningTechnology.Mosaic.Mosaic_Testbench; - -public class Test_MockClass_0{ - - public class TestSuite{ - - public TestSuite() { - // no special initialization of data for this test - } - - public Boolean test_failure_0(Mosaic_IO io){ - return false; - } - - // returns a non-Boolean - public Object test_failure_1(Mosaic_IO io){ - return 1; - } - - // has an uncaught error - public Boolean test_failure_2(Mosaic_IO io) throws Exception { - throw new Exception("Intentional exception for testing error handling"); - } - - // extraneous characters on stdout - public Boolean test_failure_3(Mosaic_IO io) throws Exception { - System.out.println("Intentional extraneous chars to stdout for testing"); - return true; - } - - // extraneous characters on stderr - public Boolean test_failure_4(Mosaic_IO io) throws Exception { - System.err.println("Intentional extraneous chars to stderr for testing."); - return true; - } - - public Boolean test_success_0(Mosaic_IO io){ - return true; - } - - // pushing input for testing - - public Boolean test_success_1(Mosaic_IO io){ - io.push_input("input for the fut"); - - Scanner scanner = new Scanner(System.in); - String result = scanner.nextLine(); - scanner.close(); - - Boolean flag = result.equals("input for the fut"); - return flag; - } - - // checking fut stdout - public Boolean test_success_2(Mosaic_IO io){ - System.out.println("fut stdout"); // suppose the fut does this: - String peek_at_futs_output = io.get_out_content(); - Boolean flag0 = io.has_out_content(); - Boolean flag1 = peek_at_futs_output.equals("fut stdout\n"); - io.clear_buffers(); // otherwise extraneous chars will cause an fail - return flag0 && flag1; - } - - // checking fut stderr - public Boolean test_success_3(Mosaic_IO io){ - System.err.print("fut stderr"); // suppose the fut does this: - String peek_at_futs_output = io.get_err_content(); - Boolean flag0 = io.has_err_content(); - Boolean flag1 = peek_at_futs_output.equals("fut stderr"); - io.clear_buffers(); // otherwise extraneous chars will cause an fail - return flag0 && flag1; - } - - } - - public static void main(String[] args) { - Test_MockClass_0 outer = new Test_MockClass_0(); - TestSuite suite = outer.new TestSuite(); // Non-static instantiation - - /* for debug - Mosaic_IO io = new Mosaic_IO(); - io.redirect(); - suite.test_success_2(io); - */ - - int result = Mosaic_Testbench.run(suite); // Pass the suite instance to Mosaic_Testbench - System.exit(result); - } - -} diff --git a/tester/javac/Test_Testbench.java b/tester/javac/Test_Testbench.java deleted file mode 100644 index 56f9e21..0000000 --- a/tester/javac/Test_Testbench.java +++ /dev/null @@ -1,82 +0,0 @@ -import java.lang.reflect.Method; -import com.ReasoningTechnology.Mosaic.Mosaic_IO; -import com.ReasoningTechnology.Mosaic.Mosaic_Testbench; - -public class Test_Testbench { - - /* -------------------------------------------------------------------------------- - Test methods to validate Testbench functionality - Each method tests a specific aspect of the Testbench class, with a focus on - ensuring that well-formed and ill-formed test cases are correctly identified - and handled. - */ - - // Tests if a correctly formed method is recognized as well-formed by Testbench - public static Boolean test_method_is_wellformed_0(Mosaic_IO io) { - try { - Method validMethod = Test_Testbench.class.getMethod("dummy_test_method", Mosaic_IO.class); - return Boolean.TRUE.equals(Mosaic_Testbench.method_is_wellformed(validMethod)); - } catch (NoSuchMethodException e) { - return false; - } - } - - // Tests if a method with an invalid return type is identified as malformed by Testbench - public static Boolean test_method_is_wellformed_1(Mosaic_IO io) { - System.out.println("Expected output: Structural problem message for dummy_invalid_return_method."); - try { - Method invalidReturnMethod = Test_Testbench.class.getMethod("dummy_invalid_return_method", Mosaic_IO.class); - return Boolean.FALSE.equals(Mosaic_Testbench.method_is_wellformed(invalidReturnMethod)); - } catch (NoSuchMethodException e) { - return false; - } - } - - // Tests if a valid test method runs successfully with the Testbench - public static Boolean test_run_test_0(Mosaic_IO io) { - try { - Method validMethod = Test_Testbench.class.getMethod("dummy_test_method", Mosaic_IO.class); - return Boolean.TRUE.equals(Mosaic_Testbench.run_test(new Test_Testbench(), validMethod, io)); - } catch (NoSuchMethodException e) { - return false; - } - } - - /* Dummy methods for testing */ - public Boolean dummy_test_method(Mosaic_IO io) { - return true; // Simulates a passing test case - } - - public void dummy_invalid_return_method(Mosaic_IO io) { - // Simulates a test case with an invalid return type - } - - /* -------------------------------------------------------------------------------- - Manually run all tests and summarize results without using Testbench itself. - Each test's name is printed if it fails, and only pass/fail counts are summarized. - */ - public static int run() { - int passed_tests = 0; - int failed_tests = 0; - Mosaic_IO io = new Mosaic_IO(); - - if (test_method_is_wellformed_0(io)) passed_tests++; else { System.out.println("test_method_is_wellformed_0"); failed_tests++; } - if (test_method_is_wellformed_1(io)) passed_tests++; else { System.out.println("test_method_is_wellformed_1"); failed_tests++; } - if (test_run_test_0(io)) passed_tests++; else { System.out.println("test_run_test_0"); failed_tests++; } - - // Summary for all the tests - System.out.println("Test_Testbench Total tests run: " + (passed_tests + failed_tests)); - System.out.println("Test_Testbench Total tests passed: " + passed_tests); - System.out.println("Test_Testbench Total tests failed: " + failed_tests); - - return (failed_tests > 0) ? 1 : 0; - } - - /* -------------------------------------------------------------------------------- - Main method for shell interface, sets the exit status based on test results - */ - public static void main(String[] args) { - int exitCode = run(); - System.exit(exitCode); - } -} diff --git a/tester/javac/Test_Util.java b/tester/javac/Test_Util.java deleted file mode 100644 index b959d5e..0000000 --- a/tester/javac/Test_Util.java +++ /dev/null @@ -1,82 +0,0 @@ -import com.ReasoningTechnology.Mosaic.Mosaic_Util; - -/* -Test_Util - -*/ - -public class Test_Util{ - - public static Boolean test_all(){ - // Test with zero condition - Boolean[] condition0 = {}; - Boolean result = !Mosaic_Util.all(condition0); // Empty condition list is false. - - // Test with one condition - Boolean[] condition1_true = {true}; - Boolean[] condition1_false = {false}; - result &= Mosaic_Util.all(condition1_true); // should return true - result &= !Mosaic_Util.all(condition1_false); // should return false - - // Test with two condition - Boolean[] condition2_true = {true, true}; - Boolean[] condition2_false1 = {true, false}; - Boolean[] condition2_false2 = {false, true}; - Boolean[] condition2_false3 = {false, false}; - result &= Mosaic_Util.all(condition2_true); // should return true - result &= !Mosaic_Util.all(condition2_false1); // should return false - result &= !Mosaic_Util.all(condition2_false2); // should return false - result &= !Mosaic_Util.all(condition2_false3); // should return false - - // Test with three condition - Boolean[] condition3_false1 = {true, true, false}; - Boolean[] condition3_true = {true, true, true}; - Boolean[] condition3_false2 = {true, false, true}; - Boolean[] condition3_false3 = {false, true, true}; - Boolean[] condition3_false4 = {false, false, false}; - result &= !Mosaic_Util.all(condition3_false1); // should return false - result &= Mosaic_Util.all(condition3_true); // should return true - result &= !Mosaic_Util.all(condition3_false2); // should return false - result &= !Mosaic_Util.all(condition3_false3); // should return false - result &= !Mosaic_Util.all(condition3_false4); // should return false - - return result; - } - - public static Boolean test_all_set_false(){ - Boolean[] condition_list = {true, true, true}; - Mosaic_Util.all_set_false(condition_list); - return !condition_list[0] && !condition_list[1] && !condition_list[2]; - } - - public static Boolean test_all_set_true(){ - Boolean[] condition_list = {false, false, false}; - Mosaic_Util.all_set_true(condition_list); - return condition_list[0] && condition_list[1] && condition_list[2]; - } - - public static int run(){ - Boolean[] condition_list = new Boolean[3]; - condition_list[0] = test_all(); - condition_list[1] = test_all_set_false(); - condition_list[2] = test_all_set_true(); - - if( - !condition_list[0] - || !condition_list[1] - || !condition_list[2] - ){ - System.out.println("Test_Util failed"); - return 1; - } - System.out.println("Test_Util passed"); - return 0; - } - - // Main function to provide a shell interface for running tests - public static void main(String[] args){ - int return_code = run(); - System.exit(return_code); - return; - } -} diff --git a/tester/jvm/Test_Mosaic.jar b/tester/jvm/Test_Mosaic.jar deleted file mode 100644 index 71d53deed1ff8e84513edab7bfb26c2b31042edf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7683 zcmaJ`1z42bwgw4-p(Lcc8>Ky=Toc^Xz%Pz1Hm6&)VzV?|PNxQBaAHFfcHXw3V#1k$y8wBvd2?X>}kMNKuC8 zXCD$03X-z?eT=&q_x_%y{Qo)=-Ol)rvjR{NBqOb+&aEKxO<|z_r92n+D2_ZA`_RB} zl`8K9-|~htx10heNMY2is9Keme}Zp>k6&%XNnxm$lT}f}>18huYcJ>Em-UU+jeCDB zLcxVJ`T6Zn0B_&F7U5^4^pAglb^Dat(%RM9(!tT$e0)`PVoH9Pv-jn2Kabqsfq0^3 zc^}+P!}~{|KeqyK`&8ZB#g&)a)Xvz&#VvlpnMj(b+n4F#pq-DmEM~1eKC_yuhk!N?i`>Mx z3|)U8KJ>pgb-`{1!IONFid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Rsu+9UDi-_H`9f`XF>eJb_f_hs(m;a(>$oGhl{wdo1TamjH?fz;1QQ__+ zJZ1TRy8f=C-Ce|gnfUGSKd!$Cc)v%u)7yR*(C+lMU)FIu{H4DA?swPG`(2{Alh=M3 z0Qnzc+n4O JRTOvM{s-y8re**D diff --git a/tester/shell/Test0 b/tester/shell/Test0 deleted file mode 100755 index 5b3584f..0000000 --- a/tester/shell/Test0 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/env bash -java Test0 diff --git a/tester/shell/Test_IO b/tester/shell/Test_IO deleted file mode 100755 index 72977e7..0000000 --- a/tester/shell/Test_IO +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/env bash -java Test_IO diff --git a/tester/shell/Test_MockClass_0 b/tester/shell/Test_MockClass_0 deleted file mode 100755 index d24ad96..0000000 --- a/tester/shell/Test_MockClass_0 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/env bash -java Test_MockClass_0 diff --git a/tester/shell/Test_Testbench b/tester/shell/Test_Testbench deleted file mode 100755 index b46456c..0000000 --- a/tester/shell/Test_Testbench +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/env bash -java Test_Testbench diff --git a/tester/shell/Test_Util b/tester/shell/Test_Util deleted file mode 100755 index 0e4ba3d..0000000 --- a/tester/shell/Test_Util +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/env bash -java Test_Util diff --git a/tester/shell/test_log.txt b/tester/shell/test_log.txt deleted file mode 100644 index fcb2724..0000000 --- a/tester/shell/test_log.txt +++ /dev/null @@ -1,14 +0,0 @@ - -2024-11-08T09:58:55.370638Z ----------------------------------------------------------- -Test: test_failure_3 -Stream: stdout -Output: -Intentional extraneous chars to stdout for testing - - -2024-11-08T09:58:55.380370Z ----------------------------------------------------------- -Test: test_failure_4 -Stream: stderr -Output: -Intentional extraneous chars to stderr for testing. - diff --git a/tester/tool/clean_build_directories b/tester/tool/clean_build_directories deleted file mode 100755 index 5b84fd0..0000000 --- a/tester/tool/clean_build_directories +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -script_afp=$(realpath "${BASH_SOURCE[0]}") - -# Caveat: the 'shell' directory is for built wrapper -# functions. `clean_build_directories` will remove all the files in this -# directory. For bespoke scripts used by the tester, put them in the `tool` -# directory. - -# input guards - env_must_be="tester/tool/env" - if [ "$ENV" != "$env_must_be" ]; then - echo "$(script_fp):: error: must be run in the $env_must_be environment" - exit 1 - fi - -# remove files - set -x - cd "$REPO_HOME"/tester - rm -r scratchpad/* - rm jvm/* - rm shell/* - set +x - -echo "$(script_fn) done." diff --git a/tester/tool/make b/tester/tool/make deleted file mode 100755 index deae0a1..0000000 --- a/tester/tool/make +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/env bash -script_afp=$(realpath "${BASH_SOURCE[0]}") - -# input guards - - env_must_be="tester/tool/env" - if [ "$ENV" != "$env_must_be" ]; then - echo "$(script_fp):: error: must be run in the $env_must_be environment" - exit 1 - fi - -echo "Compiling files..." - - set -x - cd $REPO_HOME/tester - javac -g -d scratchpad javac/*.java - jar cf jvm/Test_"$PROJECT".jar -C scratchpad . - set +x - -echo "Creating shell wrappers..." - mkdir -p shell - # wrapper is a space separated list - wrapper=$(shell_wrapper_list) - for file in $wrapper;do - cat > shell/$file << EOL -#!/bin/env bash -java $file -EOL - chmod +x shell/$file - done - -echo "$(script_fp) done." diff --git a/tester/tool/run_jdb b/tester/tool/run_jdb deleted file mode 100755 index 9c472f4..0000000 --- a/tester/tool/run_jdb +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/env bash -script_afp=$(realpath "${BASH_SOURCE[0]}") - -# input guards -env_must_be="tester/tool/env" -if [ "$ENV" != "$env_must_be" ]; then - echo "$(script_fp):: error: must be run in the $env_must_be environment" - exit 1 -fi - -jdb -sourcepath "$SOURCEPATH" "$@" - diff --git a/tester/tool/run_tests b/tester/tool/run_tests deleted file mode 100755 index 1e7182b..0000000 --- a/tester/tool/run_tests +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/env bash - -# Ensure REPO_HOME is set -if [ -z "$REPO_HOME" ]; then - echo "Error: REPO_HOME is not set." - exit 1 -fi - -# Navigate to the shell directory -cd "$REPO_HOME/tester/shell" || exit - -# Get the list of test scripts in the specific order from shell_wrapper_list -test_list=$(shell_wrapper_list) - -# Execute each test in the specified order -for file in $test_list; do - if [[ -x "$file" && ! -d "$file" ]]; then - echo -n "Running $file..." - ./"$file" - else - echo "Skipping $file (not executable or is a directory)" - fi -done diff --git a/tester/tool/shell_wrapper_list b/tester/tool/shell_wrapper_list deleted file mode 100755 index 29dd738..0000000 --- a/tester/tool/shell_wrapper_list +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/env bash -script_afp=$(realpath "${BASH_SOURCE[0]}") - -# input guards -env_must_be="tester/tool/env" -if [ "$ENV" != "$env_must_be" ]; then - echo "$(script_fp):: error: must be run in the $env_must_be environment" - exit 1 -fi - -# space separated list of shell interface wrappers -echo Test0 Test_Util Test_IO Test_Testbench Test_MockClass_0 - diff --git a/tool/.githolder b/tool/.githolder new file mode 100644 index 0000000..e69de29 diff --git a/tool_shared/bespoke/git_holder b/tool_shared/bespoke/git_holder new file mode 100755 index 0000000..7c6a3a9 --- /dev/null +++ b/tool_shared/bespoke/git_holder @@ -0,0 +1,20 @@ +#!/bin/env /bin/bash + +# Description: Finds all empty directories and adds a `.githolder` file to ensure Git tracking. + +# Function to add .githolder to empty directories +add_githolders() { + echo "Searching for empty directories..." + + # Find all empty directories and loop through them + find . -type d -empty | while read -r dir; do + # Add .githolder file in each empty directory + echo "Adding .githolder to $dir" + touch "$dir/.githolder" + done + + echo "Done! Empty directories are now tracked by Git with .githolder files." +} + +# Run the function +add_githolders diff --git a/tool_shared/bespoke/vl b/tool_shared/bespoke/vl index 2c968d3..5a80d45 100755 --- a/tool_shared/bespoke/vl +++ b/tool_shared/bespoke/vl @@ -1,8 +1,10 @@ #!/usr/bin/env bash script_afp=$(realpath "${BASH_SOURCE[0]}") + # vl 'vertical list' +# e.g.: +# > vl echo $PATH -# Check if the command is provided if [ -z "$1" ]; then echo "Usage: vl [args...]" exit 1 diff --git a/tool_shared/document/#install_java.txt# b/tool_shared/document/#install_java.txt# deleted file mode 100644 index 0091eac..0000000 --- a/tool_shared/document/#install_java.txt# +++ /dev/null @@ -1,11 +0,0 @@ - -#1. downlaod - -cd "$REPO_HOME/tool/upstream" -curl -C - -o OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.16+8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz - -#2. extract - -cd "$REPO_HOME/tool" -mkdir -p jdk-11 -tar -xzf "$REPO_HOME/tool/upstream/OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz" -C jdk-11 --strip-components 1 diff --git a/tool_shared/document/.githolder b/tool_shared/document/.githolder new file mode 100644 index 0000000..e69de29 diff --git a/tool_shared/document/install_java.txt b/tool_shared/document/install_java.txt deleted file mode 100644 index c9e5743..0000000 --- a/tool_shared/document/install_java.txt +++ /dev/null @@ -1,11 +0,0 @@ - -#1. downlaod - -cd "$REPO_HOME/tool/upstream" -curl -C - -o OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.16+8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz - -#2. extract - -cd "$REPO_HOME/tool" -mkdir jdk-11 -tar -xzf "$REPO_HOME/tool/upstream/OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz" -C jdk-11 --strip-components 1 -- 2.20.1