diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3b635c2..c4d2508f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,19 +2,13 @@ name: '415 Tester CI' run-name: ${{ github.actor }} on: [push] jobs: - build-and-test-user: + build-and-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: build and run tester - run: tests/run_user_tests.sh - - build-and-test-grader: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: build and run tester - run: tests/run_grader_tests.sh + - uses: actions/checkout@v3 + + - name: build tester + run: tests/build.sh + - name: run single executable tests + run: tests/single_exe_tests/run.sh \ No newline at end of file diff --git a/include/Colors.h b/include/Colors.h index d0779eed..3beea4e8 100644 --- a/include/Colors.h +++ b/include/Colors.h @@ -5,9 +5,15 @@ namespace Colors { - inline const std::string GREEN = "\033[32m"; - inline const std::string RED = "\033[31m"; - inline const std::string RESET = "\033[0m"; + inline const std::string + GREEN = "\033[32m", + RED = "\033[31m", + YELLOW = "\033[33m", + BLUE = "\033[34m", + MAGENTA = "\033[35m", + CYAN = "\033[36m", + WHITE = "\033[37m", + RESET = "\033[0m"; } #endif \ No newline at end of file diff --git a/include/tests/TestFile.h b/include/tests/TestFile.h index b31891ab..47ef8961 100644 --- a/include/tests/TestFile.h +++ b/include/tests/TestFile.h @@ -38,11 +38,11 @@ class TestFile { uint64_t id; // getters - fs::path getTestPath() { return testPath; } - fs::path getInsPath() { return insPath; } - fs::path getOutPath() { return outPath; } + fs::path getTestPath() const { return testPath; } + fs::path getInsPath() const { return insPath; } + fs::path getOutPath() const { return outPath; } ParseError getErrorState() const { return errorState; } - const std::string &getErrorMessage() const { return errorMsg; } + std::string getErrorMessage() const; // setters void setTestPath(fs::path path) { testPath = path; } @@ -53,7 +53,7 @@ class TestFile { void setErrorMsg (std::string msg) { errorMsg = msg; } // if test has any input and if test uses input file specifically - bool usesInputStream, usesInputFile, usesOut; + bool usesInputStream, usesInputFile, usesOutStream, usesOutFile; friend class TestParser; diff --git a/src/testharness/TestHarness.cpp b/src/testharness/TestHarness.cpp index 7b70f804..6d413074 100644 --- a/src/testharness/TestHarness.cpp +++ b/src/testharness/TestHarness.cpp @@ -107,93 +107,90 @@ std::string TestHarness::getTestSummary() const { } bool TestHarness::runTestsForToolChain(std::string exeName, std::string tcName) { - bool failed = false; - - // Get the toolchain to use. - ToolChain toolChain = cfg.getToolChain(tcName); - - // Set the toolchain's exe to be tested. - const fs::path &exe = cfg.getExecutablePath(exeName); - std::cout << "\nTesting executable: " << exeName << " -> " << exe << '\n'; - toolChain.setTestedExecutable(exe); - - // If we have a runtime, set that as well. - if (cfg.hasRuntime(exeName)) - toolChain.setTestedRuntime(cfg.getRuntimePath(exeName)); - else - toolChain.setTestedRuntime(""); + bool failed = false; - // Say which toolchain. - std::cout << "With toolchain: " << tcName << " -> " << toolChain.getBriefDescription() << '\n'; + // Get the toolchain to use. + ToolChain toolChain = cfg.getToolChain(tcName); - // Stat tracking for toolchain tests. - unsigned int toolChainCount = 0, toolChainPasses = 0; - // track invalid tests - std::vector invalidTests; + // Set the toolchain's exe to be tested. + const fs::path& exe = cfg.getExecutablePath(exeName); + std::cout << "\nTesting executable: " << exeName << " -> " << exe << '\n'; + toolChain.setTestedExecutable(exe); - // Iterate over each package. - for (const auto& [packageName, package]: module) { - - std::cout << "Entering package: " << packageName << '\n'; - unsigned int packageCount = 0, packagePasses = 0; + // If we have a runtime, set that as well. + if (cfg.hasRuntime(exeName)) + toolChain.setTestedRuntime(cfg.getRuntimePath(exeName)); + else + toolChain.setTestedRuntime(""); - // Iterate over each subpackage - for (const auto& [subPackageName, subPackage] : package) { + // Say which toolchain. + std::cout << "With toolchain: " << tcName << " -> " << toolChain.getBriefDescription() << '\n'; - std::cout << " Entering subpackage: " << subPackageName << '\n'; - unsigned int subPackagePasses = 0, subPackageSize = subPackage.size(); + // Stat tracking for toolchain tests. + unsigned int toolChainCount = 0, toolChainPasses = 0; - // Iterate over each test in the package - for (const std::unique_ptr& test : subPackage) { - - if (test->getErrorState() == ParseError::NoError) { + // Track invalid tests + std::vector invalidTests; - TestResult result = runTest(test, toolChain, cfg); - results.addResult(exeName, tcName, subPackageName, result); - - std::cout << " " << (result.pass ? (Colors::GREEN + "[PASS]" + Colors::RESET) : (Colors::RED + "[FAIL]" + Colors::RESET)) - << " " << test->getTestPath().stem().string() << '\n'; - - if (result.pass) { - ++packagePasses; - ++subPackagePasses; - } else { - failed = true; - if (!cfg.isQuiet() && !result.error) - std::cout << '\n' << result.diff << '\n'; - } - } else { - std::cout << " " << test->getTestPath().stem().string() << ": " - << "INVALID" << '\n'; - --subPackageSize; - invalidTests.push_back(test->getTestPath()); + // Iterate over each package. + for (const auto& [packageName, package] : module) { + std::cout << "Entering package: " << packageName << '\n'; + unsigned int packageCount = 0, packagePasses = 0; + + // Iterate over each subpackage + for (const auto& [subPackageName, subPackage] : package) { + std::cout << " Entering subpackage: " << subPackageName << '\n'; + unsigned int subPackagePasses = 0, subPackageSize = subPackage.size(); + + // Iterate over each test in the package + for (const std::unique_ptr& test : subPackage) { + if (test->getErrorState() == ParseError::NoError) { + TestResult result = runTest(test, toolChain, cfg); + results.addResult(exeName, tcName, subPackageName, result); + + std::cout << " " << (result.pass ? (Colors::GREEN + "[PASS]" + Colors::RESET) : (Colors::RED + "[FAIL]" + Colors::RESET)) + << " " << test->getTestPath().stem().string() << '\n'; + + if (result.pass) { + ++packagePasses; + ++subPackagePasses; + } else { + failed = true; + if (!cfg.isQuiet() && !result.error) + std::cout << '\n' << result.diff << '\n'; + } + } else { + std::cout << " " << (Colors::YELLOW + "[INVALID]" + Colors::RESET) + << " " << test->getTestPath().stem().string() << '\n'; + --subPackageSize; + invalidTests.push_back(test.get()); + } + } + std::cout << " Subpackage passed " << subPackagePasses << " / " << subPackageSize << '\n'; + + // Track how many tests we run. + packageCount += subPackageSize; } - } - std::cout << " Subpackage passed " << subPackagePasses << " / " << subPackageSize - << '\n'; - // Track how many tests we run. - packageCount += subPackageSize; - } + // Update the toolchain stats from the package stats. + toolChainPasses += packagePasses; + toolChainCount += packageCount; - // Update the toolchain stats from the package stats. - toolChainPasses += packagePasses; - toolChainCount += packageCount; + std::cout << " Package passed " << packagePasses << " / " << packageCount << '\n'; + } - std::cout << " Package passed " << packagePasses<< " / " << packageCount << '\n'; - } + std::cout << "Toolchain passed " << toolChainPasses << " / " << toolChainCount << "\n\n"; + std::cout << "Invalid " << invalidTests.size() << " / " + << toolChainCount + invalidTests.size() << "\n"; - std::cout << "Toolchain passed " << toolChainPasses << " / " << toolChainCount << "\n\n"; - std::cout << "Skipped " << invalidTests.size() << " / " - << toolChainCount + invalidTests.size() << "\n"; - - for (auto& test: invalidTests) { - std::cout << " Skipped: " << test.stem().string() - << " With error: " << "1" << "\n"; - } - std::cout << "\n"; + for (const TestFile* test : invalidTests) { + std::cout << " Skipped: " << test->getTestPath().filename().stem() << std::endl + << " Error: " << Colors::YELLOW << test->getErrorMessage() << Colors::RESET << "\n"; + } + std::cout << "\n"; - return failed; + return failed; } + } // End namespace tester diff --git a/src/tests/TestFile.cpp b/src/tests/TestFile.cpp index f850a790..db5863a1 100644 --- a/src/tests/TestFile.cpp +++ b/src/tests/TestFile.cpp @@ -8,7 +8,6 @@ std::string stripFileExtension(const std::string &str) { return str.substr(0, lastIdx); } - } // anonymous namespace namespace tester { @@ -16,7 +15,8 @@ namespace tester { uint64_t TestFile::nextId = 0; TestFile::TestFile(const fs::path& path) - : id(++nextId), usesInputStream(false), usesInputFile(false), usesOut(false), testPath(path), + : id(++nextId), usesInputStream(false), usesInputFile(false), + usesOutStream(false), usesOutFile(false), testPath(path), errorState(ParseError::NoError) { @@ -36,9 +36,39 @@ TestFile::TestFile(const fs::path& path) } TestFile::~TestFile() { + // clean up allocated resources on Testfile de-allocation if (usesInputStream && !usesInputFile) { fs::remove(insPath); } + if (usesOutStream && !usesOutFile) { + fs::remove(outPath); + } +} + +std::string TestFile::getErrorMessage() const { + + switch (getErrorState()) { + case ParseError::NoError: + return "No error"; + break; + case ParseError::DirectiveConflict: + return "Two or more testfile directives supplied that can not coexist in one file."; + break; + case ParseError::MaxInputBytesExceeded: + return "Total bytes used for input stream exceeds maximum"; + break; + case ParseError::MaxOutputBytesExceeded: + return "Total bytes used for output stream exceeds maximum"; + break; + case ParseError::FileError: + return "A filepath provided in the testfile was unable to be located or opened."; + break; + case ParseError::RuntimeError: + return "An unexpected runtime error occured while parsing the testifle."; + break; + default: + return "No matching Parse State"; + } } } // namespace tester \ No newline at end of file diff --git a/src/tests/TestParser.cpp b/src/tests/TestParser.cpp index dc2a12ca..c5a107ec 100644 --- a/src/tests/TestParser.cpp +++ b/src/tests/TestParser.cpp @@ -231,8 +231,10 @@ int TestParser::parseTest() { testfile.usesInputStream = true; } if (foundInputFile) { testfile.usesInputFile = true; - } if (foundCheck | foundCheckFile) { - testfile.usesOut = true; + } if (foundCheck || foundCheckFile) { + testfile.usesOutStream = true; + } if (foundCheckFile) { + testfile.usesOutFile = true; } // check if input directives have exceeded maximum diff --git a/src/tests/TestRunning.cpp b/src/tests/TestRunning.cpp index 0f068f9b..4dacd169 100644 --- a/src/tests/TestRunning.cpp +++ b/src/tests/TestRunning.cpp @@ -166,7 +166,7 @@ std::pair diffFiles(const fs::path& file1, const fs::path& fi if (!ifs1.is_open() || !ifs2.is_open()) { std::cerr << "Error opening files." << std::endl; - return std::make_pair(false, ""); + return std::make_pair(true, ""); } std::string line1, line2; diff --git a/tests/run_user_tests.sh b/tests/build.sh similarity index 75% rename from tests/run_user_tests.sh rename to tests/build.sh index 61624163..c16b3891 100755 --- a/tests/run_user_tests.sh +++ b/tests/build.sh @@ -3,8 +3,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) PROJECT_BASE="$SCRIPT_DIR/.." -echo "Project Base: $PROJECT_BASE" - if [ -f $PROJECT_BASE/bin/tester ]; then echo "Tester binary found" else @@ -20,12 +18,6 @@ else cd - fi -# we need to be in the test dir to run tests -cd $SCRIPT_DIR - -# run C tests -$PROJECT_BASE/bin/tester $SCRIPT_DIR/UserTestConfig.json - status=$? if [ $status -eq 0 ]; then @@ -35,3 +27,4 @@ else fi exit $status + diff --git a/tests/GradeTestConfig.json b/tests/multi_exe_tests/GradeConfig.json similarity index 95% rename from tests/GradeTestConfig.json rename to tests/multi_exe_tests/GradeConfig.json index 654cb512..4cd9c904 100644 --- a/tests/GradeTestConfig.json +++ b/tests/multi_exe_tests/GradeConfig.json @@ -1,5 +1,5 @@ { - "testDir": "grade_tests/", + "testDir": "tests", "testedExecutablePaths": { "team1": "/usr/bin/clang", "team2": "/usr/bin/clang", diff --git a/tests/multi_exe_tests/MutliToolchain.json b/tests/multi_exe_tests/MutliToolchain.json new file mode 100644 index 00000000..af53e955 --- /dev/null +++ b/tests/multi_exe_tests/MutliToolchain.json @@ -0,0 +1,51 @@ +{ + "testDir": "tests", + "testedExecutablePaths": { + "clang": "/usr/bin/clang" + }, + "toolchains": { + "LLVM": [ + { + "stepName": "compile", + "executablePath": "$EXE", + "arguments": [ + "$INPUT", + "-Wno-everything", + "-fno-show-column", + "-fno-show-source-location", + "-o", "$OUTPUT" + ], + "output": "test", + "allowError": true + }, + { + "stepName": "run", + "executablePath": "$INPUT", + "arguments": [], + "output": "-", + "usesInStr": true, + "allowError": true + } + ] + }, + "GNU": [ + { + "stepName": "compile", + "executablePath": "$EXE", + "arguments": [ + "$INPUT", + "-o", "$OUTPUT" + ], + "output": "test", + "allowError": true + }, + { + "stepName": "run", + "executablePath": "$INPUT", + "arguments": [], + "output": "-", + "usesInStr": true, + "allowError": true + } + ] +} diff --git a/tests/run_grader_tests.sh b/tests/multi_exe_tests/run_tests.sh similarity index 59% rename from tests/run_grader_tests.sh rename to tests/multi_exe_tests/run_tests.sh index 0348a39b..8c70c203 100755 --- a/tests/run_grader_tests.sh +++ b/tests/multi_exe_tests/run_tests.sh @@ -1,7 +1,7 @@ #!/bin/bash SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -PROJECT_BASE="$SCRIPT_DIR/.." +PROJECT_BASE="$SCRIPT_DIR/../.." echo "Project Base: $PROJECT_BASE" @@ -23,30 +23,21 @@ fi # we need to be in the test dir to run tests cd $SCRIPT_DIR -echo "Tests passed." +$PROJECT_BASE/bin/tester $SCRIPT_DIR/GradeConfig.json --grade $SCRIPT_DIR/grades.json status=$? if [ $status -eq 0 ]; then echo "Passed tests with status: $status" + if [ -e $SCRIPT_DIR/grades.json ]; then + echo "Grade JSON successfuly created" + exit 0 + else + echo "Failed to output grade JSON" + exit 1 + fi else echo "Failed tester with exit status: $status" fi -exit $status - -# TODO: Determine how to assess the output of a grading run -# in CI. - -# run C tests -# $PROJECT_BASE/bin/tester $SCRIPT_DIR/GradeTestConfig.json --grade grades.csv - -# status=$? - -# if [ $status -eq 0 ]; then -# echo "Passed tests with status: $status" -# else -# echo "Failed tester with exit status: $status" -# fi - -# exit $status +exit 1 diff --git a/tests/grade_tests/team1/001.c b/tests/multi_exe_tests/tests/team1/001.c similarity index 100% rename from tests/grade_tests/team1/001.c rename to tests/multi_exe_tests/tests/team1/001.c diff --git a/tests/grade_tests/team1/002.c b/tests/multi_exe_tests/tests/team1/002.c similarity index 100% rename from tests/grade_tests/team1/002.c rename to tests/multi_exe_tests/tests/team1/002.c diff --git a/tests/grade_tests/team1/003.c b/tests/multi_exe_tests/tests/team1/003.c similarity index 100% rename from tests/grade_tests/team1/003.c rename to tests/multi_exe_tests/tests/team1/003.c diff --git a/tests/grade_tests/team2/001.c b/tests/multi_exe_tests/tests/team2/001.c similarity index 100% rename from tests/grade_tests/team2/001.c rename to tests/multi_exe_tests/tests/team2/001.c diff --git a/tests/grade_tests/team2/002.c b/tests/multi_exe_tests/tests/team2/002.c similarity index 100% rename from tests/grade_tests/team2/002.c rename to tests/multi_exe_tests/tests/team2/002.c diff --git a/tests/grade_tests/team3/001.c b/tests/multi_exe_tests/tests/team3/001.c similarity index 100% rename from tests/grade_tests/team3/001.c rename to tests/multi_exe_tests/tests/team3/001.c diff --git a/tests/UserTestConfig.json b/tests/single_exe_tests/BasicConfig.json similarity index 95% rename from tests/UserTestConfig.json rename to tests/single_exe_tests/BasicConfig.json index a23e7f39..da269a88 100644 --- a/tests/UserTestConfig.json +++ b/tests/single_exe_tests/BasicConfig.json @@ -1,5 +1,5 @@ { - "testDir": "user_tests/", + "testDir": "tests", "testedExecutablePaths": { "clang": "/usr/bin/clang" }, diff --git a/tests/single_exe_tests/run.sh b/tests/single_exe_tests/run.sh new file mode 100755 index 00000000..02f58391 --- /dev/null +++ b/tests/single_exe_tests/run.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +PROJECT_BASE="$SCRIPT_DIR/../.." + +TEST_CONFIGS=( + "$SCRIPT_DIR/BasicConfig.json" +) + +# we need to be in the test dir to run tests +cd $SCRIPT_DIR + +all_passed=true + +for TEST_CONFIG in "${TEST_CONFIGS[@]}"; do + + $PROJECT_BASE/bin/tester $TEST_CONFIG --timeout 10 + status=$? + + if [ $status -ne 0 ]; then + all_passed=false + echo "Tester failed test for config: $TEST_CONFIG" + fi +done + +# run C tests +if [ "$all_passed" = true ]; then + exit 0 +else + exit 1 +fi diff --git a/tests/single_exe_tests/tests/error_tests/001_compile_time_types.c b/tests/single_exe_tests/tests/error_tests/001_compile_time_types.c new file mode 100644 index 00000000..3740db76 --- /dev/null +++ b/tests/single_exe_tests/tests/error_tests/001_compile_time_types.c @@ -0,0 +1,27 @@ +#define TYPE_ERROR 0 + +typedef struct Apple{ + char a[5]; +} Apple; + +typedef struct Banana { + char b[6]; +} Banana ; + +int main() { + + Apple a = { "apple" }; + Banana b = { "banana" }; + +#if TYPE_ERROR + a = b; +#else + // We will emulate the type error to match the Error Test Specification + printf("TypeError on line 17: Assigning Banana to Apple."); + exit(1); +#endif + + return 0; +} + +// CHECK:TypeError on line 17 diff --git a/tests/user_tests/errors/002_runtime_math.c b/tests/single_exe_tests/tests/error_tests/002_runtime_math.c similarity index 97% rename from tests/user_tests/errors/002_runtime_math.c rename to tests/single_exe_tests/tests/error_tests/002_runtime_math.c index 511a5658..a6a079e6 100644 --- a/tests/user_tests/errors/002_runtime_math.c +++ b/tests/single_exe_tests/tests/error_tests/002_runtime_math.c @@ -15,8 +15,8 @@ int main() { } else { fprintf(stderr, "DivideByZeroError: a was about to be divided by 0!"); exit(EXIT_DIVIDE_BY_ZERO); - } - + } + return 0; } diff --git a/tests/single_exe_tests/tests/error_tests/003_runtime_index.c b/tests/single_exe_tests/tests/error_tests/003_runtime_index.c new file mode 100644 index 00000000..f00654e9 --- /dev/null +++ b/tests/single_exe_tests/tests/error_tests/003_runtime_index.c @@ -0,0 +1,28 @@ +#define OUT_OF_BOUNDS_ERROR 0 + + +// INPUT:9 +int main() { + + char c; + scanf("%c", &c); + + int x = (unsigned int)(c) - '0'; + int a[5] = {1, 2, 3, 4, 5}; + + if (x < 5 && x >= 0) { + printf("%d", a[x]); + } else { + // We will emulate the IndexError to match "Error Test Spec" since + // C will just let us poke around. + printf("IndexError: Don't do that! (The text past the first\ + colon is implementation specific so is not picked up by the tester)"); + + exit(1); + } + + + return 0; +} + +// CHECK:IndexError \ No newline at end of file diff --git a/tests/user_tests/invalid/001_input_exceed.c b/tests/single_exe_tests/tests/invalid_tests/001_input_exceed.c similarity index 68% rename from tests/user_tests/invalid/001_input_exceed.c rename to tests/single_exe_tests/tests/invalid_tests/001_input_exceed.c index 575faba2..e3b577e4 100644 --- a/tests/user_tests/invalid/001_input_exceed.c +++ b/tests/single_exe_tests/tests/invalid_tests/001_input_exceed.c @@ -1,4 +1,4 @@ -//INPUT_FILE:input_exceed.ins +//INPUT_FILE:./in-stream/input_exceed.ins #include diff --git a/tests/user_tests/invalid/002_output_exceed.c b/tests/single_exe_tests/tests/invalid_tests/002_output_exceed.c similarity index 70% rename from tests/user_tests/invalid/002_output_exceed.c rename to tests/single_exe_tests/tests/invalid_tests/002_output_exceed.c index bedac28d..898db4df 100644 --- a/tests/user_tests/invalid/002_output_exceed.c +++ b/tests/single_exe_tests/tests/invalid_tests/002_output_exceed.c @@ -1,4 +1,4 @@ -//CHECK_FILE:output_exceed.out +//CHECK_FILE:./out-stream/output_exceed.out #include diff --git a/tests/user_tests/invalid/003_file_errror.c b/tests/single_exe_tests/tests/invalid_tests/003_file_errror.c similarity index 100% rename from tests/user_tests/invalid/003_file_errror.c rename to tests/single_exe_tests/tests/invalid_tests/003_file_errror.c diff --git a/tests/user_tests/invalid/004_directive_conflict.c b/tests/single_exe_tests/tests/invalid_tests/004_directive_conflict.c similarity index 100% rename from tests/user_tests/invalid/004_directive_conflict.c rename to tests/single_exe_tests/tests/invalid_tests/004_directive_conflict.c diff --git a/tests/user_tests/invalid/005_directive_conflict.c b/tests/single_exe_tests/tests/invalid_tests/005_directive_conflict.c similarity index 100% rename from tests/user_tests/invalid/005_directive_conflict.c rename to tests/single_exe_tests/tests/invalid_tests/005_directive_conflict.c diff --git a/tests/user_tests/invalid/input_exceed.ins b/tests/single_exe_tests/tests/invalid_tests/in-stream/input_exceed.ins similarity index 100% rename from tests/user_tests/invalid/input_exceed.ins rename to tests/single_exe_tests/tests/invalid_tests/in-stream/input_exceed.ins diff --git a/tests/user_tests/invalid/output_exceed.out b/tests/single_exe_tests/tests/invalid_tests/out-stream/output_exceed.out similarity index 100% rename from tests/user_tests/invalid/output_exceed.out rename to tests/single_exe_tests/tests/invalid_tests/out-stream/output_exceed.out diff --git a/tests/user_tests/io/000_empty.c b/tests/single_exe_tests/tests/valid_tests/000_empty.c similarity index 100% rename from tests/user_tests/io/000_empty.c rename to tests/single_exe_tests/tests/valid_tests/000_empty.c diff --git a/tests/user_tests/io/001_basic_clang.c b/tests/single_exe_tests/tests/valid_tests/001_basic.c similarity index 100% rename from tests/user_tests/io/001_basic_clang.c rename to tests/single_exe_tests/tests/valid_tests/001_basic.c diff --git a/tests/user_tests/comments/003_comment_mixed.c b/tests/single_exe_tests/tests/valid_tests/002_comment_mixed.c similarity index 100% rename from tests/user_tests/comments/003_comment_mixed.c rename to tests/single_exe_tests/tests/valid_tests/002_comment_mixed.c diff --git a/tests/user_tests/io/003_input_file.c b/tests/single_exe_tests/tests/valid_tests/003_input_file.c similarity index 90% rename from tests/user_tests/io/003_input_file.c rename to tests/single_exe_tests/tests/valid_tests/003_input_file.c index a0d6721b..41284e5c 100644 --- a/tests/user_tests/io/003_input_file.c +++ b/tests/single_exe_tests/tests/valid_tests/003_input_file.c @@ -1,4 +1,4 @@ -// INPUT_FILE:./003_input_file.ins +// INPUT_FILE:./in-stream/003_input_file.ins #include diff --git a/tests/user_tests/io/004_check_multi.c b/tests/single_exe_tests/tests/valid_tests/004_check_multi.c similarity index 100% rename from tests/user_tests/io/004_check_multi.c rename to tests/single_exe_tests/tests/valid_tests/004_check_multi.c diff --git a/tests/user_tests/io/004_multi_nl_space.c b/tests/single_exe_tests/tests/valid_tests/004_multi_nl_space.c similarity index 100% rename from tests/user_tests/io/004_multi_nl_space.c rename to tests/single_exe_tests/tests/valid_tests/004_multi_nl_space.c diff --git a/tests/user_tests/comments/004_comment_block_inline.c b/tests/single_exe_tests/tests/valid_tests/005_comment_block_inline.c similarity index 100% rename from tests/user_tests/comments/004_comment_block_inline.c rename to tests/single_exe_tests/tests/valid_tests/005_comment_block_inline.c diff --git a/tests/user_tests/io/006_check_newline.c b/tests/single_exe_tests/tests/valid_tests/006_check_newline.c similarity index 100% rename from tests/user_tests/io/006_check_newline.c rename to tests/single_exe_tests/tests/valid_tests/006_check_newline.c diff --git a/tests/user_tests/comments/005_comment_mixed2.c b/tests/single_exe_tests/tests/valid_tests/006_comment_mixed2.c similarity index 100% rename from tests/user_tests/comments/005_comment_mixed2.c rename to tests/single_exe_tests/tests/valid_tests/006_comment_mixed2.c diff --git a/tests/user_tests/comments/006_string_esc.c b/tests/single_exe_tests/tests/valid_tests/007_string_escape.c similarity index 100% rename from tests/user_tests/comments/006_string_esc.c rename to tests/single_exe_tests/tests/valid_tests/007_string_escape.c diff --git a/tests/user_tests/io/008_escape_seq.c b/tests/single_exe_tests/tests/valid_tests/008_escape_seq.c similarity index 50% rename from tests/user_tests/io/008_escape_seq.c rename to tests/single_exe_tests/tests/valid_tests/008_escape_seq.c index e0e735c7..40889bee 100644 --- a/tests/user_tests/io/008_escape_seq.c +++ b/tests/single_exe_tests/tests/valid_tests/008_escape_seq.c @@ -3,4 +3,4 @@ int main() { printf("\tafter the tab"); } -//CHECK_FILE:008_escape_seq.out \ No newline at end of file +//CHECK_FILE:./out-stream/008_escape_seq.out \ No newline at end of file diff --git a/tests/user_tests/io/009_tab_newline.c b/tests/single_exe_tests/tests/valid_tests/009_tab_newline.c similarity index 63% rename from tests/user_tests/io/009_tab_newline.c rename to tests/single_exe_tests/tests/valid_tests/009_tab_newline.c index cd907304..92d49d89 100644 --- a/tests/user_tests/io/009_tab_newline.c +++ b/tests/single_exe_tests/tests/valid_tests/009_tab_newline.c @@ -6,4 +6,4 @@ int main() { return 0; } -// CHECK_FILE:009_tab_newline.out \ No newline at end of file +// CHECK_FILE:./out-stream/009_tab_newline.out \ No newline at end of file diff --git a/tests/user_tests/io/007_newline_space.c b/tests/single_exe_tests/tests/valid_tests/010_newline_check.c similarity index 100% rename from tests/user_tests/io/007_newline_space.c rename to tests/single_exe_tests/tests/valid_tests/010_newline_check.c diff --git a/tests/user_tests/comments/001_comment_line.c b/tests/single_exe_tests/tests/valid_tests/011_empty_check.c similarity index 100% rename from tests/user_tests/comments/001_comment_line.c rename to tests/single_exe_tests/tests/valid_tests/011_empty_check.c diff --git a/tests/user_tests/io/005_check_space.c b/tests/single_exe_tests/tests/valid_tests/012_space_check.c similarity index 100% rename from tests/user_tests/io/005_check_space.c rename to tests/single_exe_tests/tests/valid_tests/012_space_check.c diff --git a/tests/user_tests/io/002_input_multi.c b/tests/single_exe_tests/tests/valid_tests/013_io_multi.c similarity index 100% rename from tests/user_tests/io/002_input_multi.c rename to tests/single_exe_tests/tests/valid_tests/013_io_multi.c diff --git a/tests/user_tests/io/002_input_multi.ins b/tests/single_exe_tests/tests/valid_tests/in-stream/002_input_multi.ins similarity index 100% rename from tests/user_tests/io/002_input_multi.ins rename to tests/single_exe_tests/tests/valid_tests/in-stream/002_input_multi.ins diff --git a/tests/user_tests/io/003_input_file.ins b/tests/single_exe_tests/tests/valid_tests/in-stream/003_input_file.ins similarity index 100% rename from tests/user_tests/io/003_input_file.ins rename to tests/single_exe_tests/tests/valid_tests/in-stream/003_input_file.ins diff --git a/tests/user_tests/io/002.out b/tests/single_exe_tests/tests/valid_tests/out-stream/002.out similarity index 100% rename from tests/user_tests/io/002.out rename to tests/single_exe_tests/tests/valid_tests/out-stream/002.out diff --git a/tests/user_tests/io/008_escape_seq.out b/tests/single_exe_tests/tests/valid_tests/out-stream/008_escape_seq.out similarity index 100% rename from tests/user_tests/io/008_escape_seq.out rename to tests/single_exe_tests/tests/valid_tests/out-stream/008_escape_seq.out diff --git a/tests/user_tests/io/009_tab_newline.out b/tests/single_exe_tests/tests/valid_tests/out-stream/009_tab_newline.out similarity index 100% rename from tests/user_tests/io/009_tab_newline.out rename to tests/single_exe_tests/tests/valid_tests/out-stream/009_tab_newline.out diff --git a/tests/user_tests/errors/001_compile_time_types.c b/tests/user_tests/errors/001_compile_time_types.c deleted file mode 100644 index ea8c43dc..00000000 --- a/tests/user_tests/errors/001_compile_time_types.c +++ /dev/null @@ -1,18 +0,0 @@ -typedef struct Apple{ - char a[5]; -} Apple; - -typedef struct Banana { - char b[6]; -} Banana ; - -int main() { - - Apple a = { "apple" }; - Banana b = { "banana" }; - a = b; - - return 0; -} - -//CHECK:error: \ No newline at end of file diff --git a/tests/user_tests/io/a.out b/tests/user_tests/io/a.out deleted file mode 100755 index 8e88da27..00000000 Binary files a/tests/user_tests/io/a.out and /dev/null differ