diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/suite/test.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/suite/test.cc b/test/suite/test.cc index bb62d9d..b096a8b 100644 --- a/test/suite/test.cc +++ b/test/suite/test.cc @@ -38,7 +38,7 @@ void run_ctor(const std::vector<std::string>& args, void assert_not_exists(const std::string& path, const std::source_location location = std::source_location::current()) { - if(!std::filesystem::exists(path)) + if(std::filesystem::exists(path)) { fail(1, location); } @@ -47,7 +47,7 @@ void assert_not_exists(const std::string& path, void assert_exists(const std::string& path, const std::source_location location = std::source_location::current()) { - if(std::filesystem::exists(path)) + if(!std::filesystem::exists(path)) { fail(1, location); } @@ -169,7 +169,7 @@ int main() // check if source file changes are tracked { // No build files should have been created yet - assert_exists(BUILDDIR); + assert_not_exists(BUILDDIR); // capture ctor binary before configure is called Tracker ctor_bin(ctor_exe); @@ -181,11 +181,11 @@ int main() assert_changed(ctor_bin); // configuration.cc should have been generated now - assert_not_exists("configuration.cc"); - assert_not_exists("config.h"); + assert_exists("configuration.cc"); + assert_exists("config.h"); // Shouldn't compile anything yet - only configure - assert_exists(BUILDDIR + "/hello-hello_cc" + obj_ext); + assert_not_exists(BUILDDIR + "/hello-hello_cc" + obj_ext); ctor_bin.capture(); @@ -193,7 +193,7 @@ int main() run_ctor({"-v"}); // Compiled object should now exist - assert_not_exists(BUILDDIR + "/hello-hello_cc" + obj_ext); + assert_exists(BUILDDIR + "/hello-hello_cc" + obj_ext); // ctor should not have been rebuilt, so binary should be the same assert_not_changed(ctor_bin); @@ -298,7 +298,7 @@ int main() assert_changed(ctor_bin); // foo.cc should not be generated at this point - assert_exists(BUILDDIR+"/foo.cc"); + assert_not_exists(BUILDDIR+"/foo.cc"); auto time_w = std::filesystem::last_write_time(BUILDDIR + "/world.cc"); auto time_wo = @@ -335,13 +335,13 @@ int main() run_ctor({"-v", "many_to_one"}); // world.cc should not be generated at this point - assert_exists(BUILDDIR+"/world.cc"); + assert_not_exists(BUILDDIR+"/world.cc"); // foo.cc should have been generated at this point - assert_not_exists(BUILDDIR+"/foo.cc"); + assert_exists(BUILDDIR+"/foo.cc"); // many_to_one.cc should have been generated - assert_not_exists(BUILDDIR+"/many_to_one.cc"); + assert_exists(BUILDDIR+"/many_to_one.cc"); auto time = std::filesystem::last_write_time(BUILDDIR + "/many_to_one.cc"); std::this_thread::sleep_for(1100ms); |
