From: Thomas Walker Lynch Date: Wed, 20 Nov 2024 08:25:23 +0000 (+0000) Subject: more project directory structuring X-Git-Url: https://git.reasoningtechnology.com/style/static/git-logo.png?a=commitdiff_plain;h=54a7730450585b70db361c6dcf4dab3f6de37f0f;p=subu more project directory structuring --- diff --git a/document/.githolder b/document/.githolder new file mode 100644 index 0000000..e69de29 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/.githolder b/tester/jvm/.githolder deleted file mode 100644 index e69de29..0000000 diff --git a/tester/jvm/Test_Mosaic.jar b/tester/jvm/Test_Mosaic.jar deleted file mode 100644 index 71d53de..0000000 Binary files a/tester/jvm/Test_Mosaic.jar and /dev/null differ 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